diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-02-04 16:05:03 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-02-04 16:05:03 -0800 |
commit | f882dd2321f97fc69a6a69dd42a9e97a6fadb982 (patch) | |
tree | 48ecf27402dfcf563671ebf58be353427052f50f | |
parent | ce860996e59dcf4ebcabb9b6801971098a3e88b5 (diff) | |
parent | db90ccc676036406730ffdcd666d146c18e0aed8 (diff) | |
download | android_packages_apps_Snap-f882dd2321f97fc69a6a69dd42a9e97a6fadb982.tar.gz android_packages_apps_Snap-f882dd2321f97fc69a6a69dd42a9e97a6fadb982.tar.bz2 android_packages_apps_Snap-f882dd2321f97fc69a6a69dd42a9e97a6fadb982.zip |
Merge "Camera2: Calculate UI aspect ratio based on preview size"
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 6 | ||||
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 20 |
2 files changed, 1 insertions, 25 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 45a7c8837..dd0521576 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -667,7 +667,7 @@ public class PhotoModule return; } setPreviewFrameLayoutCameraOrientation(); - Size size = mParameters.getPictureSize(); + Size size = mParameters.getPreviewSize(); Log.e(TAG,"Width = "+ size.width+ "Height = "+size.height); mUI.setAspectRatio((float) size.width / size.height); } @@ -2572,10 +2572,6 @@ public class PhotoModule mRestartPreview = true; } - if(optimalSize.width != 0 && optimalSize.height != 0) { - mUI.updatePreviewAspectRatio((float) optimalSize.width - / (float) optimalSize.height); - } Log.v(TAG, "Preview size is " + optimalSize.width + "x" + optimalSize.height); // Since changing scene mode may change supported values, set scene mode diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index e178a3092..eff302212 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -258,26 +258,6 @@ public class PhotoUI implements PieListener, mSurfaceTextureSizeListener = listener; } - public void updatePreviewAspectRatio(float aspectRatio) { - if (aspectRatio <= 0) { - Log.e(TAG, "Invalid aspect ratio: " + aspectRatio); - return; - } - if (mOrientationResize && - mActivity.getResources().getConfiguration().orientation - != Configuration.ORIENTATION_PORTRAIT) { - aspectRatio = 1f / aspectRatio; - } - - if (mAspectRatio != aspectRatio) { - mAspectRatio = aspectRatio; - // Update transform matrix with the new aspect ratio. - if (mPreviewWidth != 0 && mPreviewHeight != 0) { - setTransformMatrix(mPreviewWidth, mPreviewHeight); - } - } - } - private void setTransformMatrix(int width, int height) { mMatrix = mTextureView.getTransform(mMatrix); float scaleX = 1f, scaleY = 1f; |