summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2015-10-07 11:24:31 -0700
committerTim Murray <timmurray@google.com>2015-10-07 20:39:11 +0000
commit57caeb5703de0c86be04f597d14e954987cd7955 (patch)
treeb04dbd4a4755a415d559f0dea7a43993763267ad /core
parent2a6f1d4af39a72abecf16cc0a95feda7431afc07 (diff)
downloadframeworks_base-57caeb5703de0c86be04f597d14e954987cd7955.zip
frameworks_base-57caeb5703de0c86be04f597d14e954987cd7955.tar.gz
frameworks_base-57caeb5703de0c86be04f597d14e954987cd7955.tar.bz2
Ensure SurfaceView requests WM relayout when size changes.
In the case of scaled SurfaceViews with a fixed size. It is possible for the surface layout size to change without a change to the surface size or position. In this case we need to inform the window manager so it can update frames and scaling. This has presented in Camera and required workarounds such as changing the fixed surface size to trigger an update (leading to visual artifacts). Bug:23974105 Change-Id: I195aa0832907c32874b294101b56e198e853dce5 (cherry picked from commit a8fe43f09c0ed2119e55139a482f7f12fbe7d725)
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/SurfaceView.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 7d48a9a..db68c29 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -447,10 +447,11 @@ public class SurfaceView extends View {
final boolean formatChanged = mFormat != mRequestedFormat;
final boolean sizeChanged = mWidth != myWidth || mHeight != myHeight;
final boolean visibleChanged = mVisible != mRequestedVisible;
+ final boolean layoutSizeChanged = getWidth() != mLayout.width || getHeight() != mLayout.height;
if (force || creating || formatChanged || sizeChanged || visibleChanged
|| mLeft != mLocation[0] || mTop != mLocation[1]
- || mUpdateWindowNeeded || mReportDrawNeeded || redrawNeeded) {
+ || mUpdateWindowNeeded || mReportDrawNeeded || redrawNeeded || layoutSizeChanged) {
if (DEBUG) Log.i(TAG, "Changes: creating=" + creating
+ " format=" + formatChanged + " size=" + sizeChanged