summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoUI.java
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2014-09-04 17:43:28 +0800
committerLikai Ding <likaid@codeaurora.org>2014-10-15 14:17:22 +0800
commit2f163f24a308b753493654d9b4720ee8b35acf81 (patch)
tree99e0335da68034cad6dbc70889ceaeb136c11b9c /src/com/android/camera/VideoUI.java
parentd7810337255f08f3c89e2fb02ca393fc2997ca8d (diff)
downloadandroid_packages_apps_Snap-2f163f24a308b753493654d9b4720ee8b35acf81.tar.gz
android_packages_apps_Snap-2f163f24a308b753493654d9b4720ee8b35acf81.tar.bz2
android_packages_apps_Snap-2f163f24a308b753493654d9b4720ee8b35acf81.zip
Camera2: fix sawtooth in camera preview
Under certain combination of preview/screen resolution, sawtooth is seen on preview image. In setTransformMatrix(), scaledTextureWidth/Height is unnecessarily rounded to integers, losing precision. Removing the rounding fixes the problem. CRs-Fixed: 705322 Change-Id: Ia78b012cf530528b3677a8684279862a81b145ed
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rw-r--r--src/com/android/camera/VideoUI.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 8de713adf..899226bb4 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -311,15 +311,11 @@ public class VideoUI implements PieRenderer.PieListener,
}
} else {
if (width > height) {
- scaledTextureWidth = Math.max(width,
- (int) (height * mAspectRatio));
- scaledTextureHeight = Math.max(height,
- (int)(width / mAspectRatio));
+ scaledTextureWidth = Math.max(width, height * mAspectRatio);
+ scaledTextureHeight = Math.max(height, width / mAspectRatio);
} else {
- scaledTextureWidth = Math.max(width,
- (int) (height / mAspectRatio));
- scaledTextureHeight = Math.max(height,
- (int) (width * mAspectRatio));
+ scaledTextureWidth = Math.max(width, height / mAspectRatio);
+ scaledTextureHeight = Math.max(height, width * mAspectRatio);
}
}