diff options
| author | Alan Viverette <alanv@google.com> | 2015-05-15 18:31:40 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-15 18:31:54 +0000 |
| commit | 2cc4a4755fcd41900e042c75cc47879d46acecda (patch) | |
| tree | ff3306dc025499eb1b1011ce273fae3035168630 /core/java/android/view/ViewRootImpl.java | |
| parent | 6a5f85080e1a3656fc9a4a22c71cf7bc1f9239de (diff) | |
| parent | 50210d912925aef14e4ce69be82e4949122a3cd9 (diff) | |
| download | frameworks_base-2cc4a4755fcd41900e042c75cc47879d46acecda.zip frameworks_base-2cc4a4755fcd41900e042c75cc47879d46acecda.tar.gz frameworks_base-2cc4a4755fcd41900e042c75cc47879d46acecda.tar.bz2 | |
Merge "Adjust light source for window position" into mnc-dev
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 4f2a3fa..06dddfb 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1813,15 +1813,15 @@ public final class ViewRootImpl implements ViewParent, } } - if (mAttachInfo.mHardwareRenderer != null && - mAttachInfo.mHardwareRenderer.isEnabled()) { - if (hwInitialized || - mWidth != mAttachInfo.mHardwareRenderer.getWidth() || - mHeight != mAttachInfo.mHardwareRenderer.getHeight()) { - mAttachInfo.mHardwareRenderer.setup( - mWidth, mHeight, mWindowAttributes.surfaceInsets); + final HardwareRenderer hardwareRenderer = mAttachInfo.mHardwareRenderer; + if (hardwareRenderer != null && hardwareRenderer.isEnabled()) { + if (hwInitialized + || mWidth != hardwareRenderer.getWidth() + || mHeight != hardwareRenderer.getHeight()) { + hardwareRenderer.setup(mWidth, mHeight, mAttachInfo, + mWindowAttributes.surfaceInsets); if (!hwInitialized) { - mAttachInfo.mHardwareRenderer.invalidate(mSurface); + hardwareRenderer.invalidate(mSurface); mFullRedrawNeeded = true; } } @@ -1897,6 +1897,11 @@ public final class ViewRootImpl implements ViewParent, } mAttachInfo.mWindowLeft = frame.left; mAttachInfo.mWindowTop = frame.top; + + // Update the light position for the new window offsets. + if (mAttachInfo.mHardwareRenderer != null) { + mAttachInfo.mHardwareRenderer.setLightCenter(mAttachInfo); + } } } @@ -2605,7 +2610,7 @@ public final class ViewRootImpl implements ViewParent, try { mAttachInfo.mHardwareRenderer.initializeIfNeeded( - mWidth, mHeight, mSurface, surfaceInsets); + mWidth, mHeight, mAttachInfo, mSurface, surfaceInsets); } catch (OutOfResourcesException e) { handleOutOfResourcesException(e); return; @@ -3300,7 +3305,7 @@ public final class ViewRootImpl implements ViewParent, final WindowManager.LayoutParams lp = mWindowAttributes; final Rect surfaceInsets = lp != null ? lp.surfaceInsets : null; mAttachInfo.mHardwareRenderer.initializeIfNeeded( - mWidth, mHeight, mSurface, surfaceInsets); + mWidth, mHeight, mAttachInfo, mSurface, surfaceInsets); } catch (OutOfResourcesException e) { Log.e(TAG, "OutOfResourcesException locking surface", e); try { |
