From 18f20b9f460a8e329dd5af1e035d23931e7e1910 Mon Sep 17 00:00:00 2001 From: Doris Liu Date: Wed, 9 Oct 2013 20:51:23 -0700 Subject: [PATCH] Workaround for re-applying transform on new surface texuture Bug: 10981460 Change-Id: Ic7fca757f3c1171317c76cd90fad43ff5c5ae5d2 --- src/com/android/camera/PhotoUI.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 3b4d04dc7..58751efbf 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -126,13 +126,6 @@ public class PhotoUI implements PieListener, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { int width = right - left; int height = bottom - top; - // Full-screen preview - int w = width; - int h = height; - if (CameraUtil.getDisplayRotation(mActivity) % 180 != 0) { - w = height; - h = width; - } if (mPreviewWidth != width || mPreviewHeight != height) { mPreviewWidth = width; mPreviewHeight = height; @@ -266,6 +259,11 @@ public class PhotoUI implements PieListener, Log.v(TAG, "SurfaceTexture ready."); mSurfaceTexture = surface; mController.onPreviewUIReady(); + // Workaround for b/11168275, see b/10981460 for more details + if (mPreviewWidth != 0 && mPreviewHeight != 0) { + // Re-apply transform matrix for new surface texture + setTransformMatrix(mPreviewWidth, mPreviewHeight); + } } @Override -- 2.11.0