From 370ab062a0a18723531258896b352d5f5dd55ae7 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 21 May 2013 12:15:07 -0700 Subject: Avoid extraneous EGL surface allocations Bug #8667873 windowShouldResize means we need to layout the window, it doesn't mean the dimensions of the surface have changed. We should only check the width and the height. With this fix we can avoid a surface allocation every time the window shade is opened or closed. Change-Id: I8afe97b820a865723f2aab7a5aa4ddc8eaaec6e1 --- core/java/android/view/ViewRootImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index b63ccab6de85..bbf5ae933153 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1639,7 +1639,7 @@ public final class ViewRootImpl implements ViewParent, if (mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled()) { - if (hwInitialized || windowShouldResize || + if (hwInitialized || mWidth != mAttachInfo.mHardwareRenderer.getWidth() || mHeight != mAttachInfo.mHardwareRenderer.getHeight()) { mAttachInfo.mHardwareRenderer.setup(mWidth, mHeight); -- cgit v1.2.3