From d443ba4534b88fe6dfd3bd8f1dd1dc8451ed6734 Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Fri, 9 Oct 2009 17:37:50 -0700 Subject: [PATCH] Prevent transparent region from getting out of sync with Surface Flinger The ViewRoot is responsible for calculating the current view's surface's transparent region and reporting this to the window server, which in turn notifies Surface Flinger. To minimize cross-process traffic, ViewRoot keeps track of the most recent transparent region that it has reported to the window server, and only sends updates when the region shape changes. ViewRoot is effectively shadowing the internal state of the window server, and usually this works fine, because ViewRoot is usually the only thing that changes this value. But when the surface is recreated, the window server resets the transparent region to empty. So in order to properly update the window server we need to reset our copy of its state to empty too. Fixes issue #2133090: GL Gears runs at half speed in some cases --- core/java/android/view/ViewRoot.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index a6d644be201eb..3b8304488a4aa 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -898,6 +898,7 @@ public final class ViewRoot extends Handler implements ViewParent, // all at once. newSurface = true; fullRedrawNeeded = true; + mPreviousTransparentRegion.setEmpty(); if (mGlWanted && !mUseGL) { initializeGL();