OSDN Git Service

SurfaceView: Update matrix when buffer size changes.
authorRobert Carr <racarr@google.com>
Mon, 13 Mar 2017 22:27:15 +0000 (15:27 -0700)
committerRobert Carr <racarr@google.com>
Mon, 13 Mar 2017 22:28:41 +0000 (15:28 -0700)
This restores the N behavior where RT synchronization
was broken for buffer size changes.

Bug: 36180927
Bug: 28866173
Test: Manual. Will follow up once dechaselisted.
Change-Id: I31c4f83858a096af0dd73611ed120861911fc9d9

core/java/android/view/SurfaceView.java

index 61b1247..6d320ef 100644 (file)
@@ -500,7 +500,12 @@ public class SurfaceView extends View {
                         // While creating the surface, we will set it's initial
                         // geometry. Outside of that though, we should generally
                         // leave it to the RenderThread.
-                        if (creating || !mRtHandlingPositionUpdates) {
+                        //
+                        // There is one more case when the buffer size changes we aren't yet
+                        // prepared to sync (as even following the transaction applying
+                        // we still need to latch a buffer).
+                        // b/28866173
+                        if (sizeChanged || creating || !mRtHandlingPositionUpdates) {
                             mSurfaceControl.setPosition(mScreenRect.left, mScreenRect.top);
                             mSurfaceControl.setMatrix(mScreenRect.width() / (float) mSurfaceWidth,
                                     0.0f, 0.0f,