diff options
author | John Reck <jreck@google.com> | 2012-10-16 17:06:13 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-10-16 17:06:13 -0700 |
commit | 2a9a6b53fb4a07b27773ee31171f441bc8aa08b3 (patch) | |
tree | 50dedcbe5f0b3e797f9d1e3d447b9e874307ebfa | |
parent | 306d7745b13ed3e489556e1e0019130e434499b7 (diff) | |
download | android_packages_apps_Snap-2a9a6b53fb4a07b27773ee31171f441bc8aa08b3.tar.gz android_packages_apps_Snap-2a9a6b53fb4a07b27773ee31171f441bc8aa08b3.tar.bz2 android_packages_apps_Snap-2a9a6b53fb4a07b27773ee31171f441bc8aa08b3.zip |
Add hook to manipulate SurfaceTexture transform
Bug: 7302956
Change-Id: I32bdeb22630dbeba9f028e1c68167d10a5288a28
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/Utils.java | 2 | ||||
-rw-r--r-- | src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/Utils.java b/gallerycommon/src/com/android/gallery3d/common/Utils.java index f5a266706..3a68745c4 100644 --- a/gallerycommon/src/com/android/gallery3d/common/Utils.java +++ b/gallerycommon/src/com/android/gallery3d/common/Utils.java @@ -76,7 +76,7 @@ public class Utils { // Throws IllegalArgumentException if the input is <= 0 or // the answer overflows. public static int nextPowerOf2(int n) { - if (n <= 0 || n > (1 << 30)) throw new IllegalArgumentException(); + if (n <= 0 || n > (1 << 30)) throw new IllegalArgumentException("n is invalid: " + n); n -= 1; n |= n >> 16; n |= n >> 8; diff --git a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java index 1930e3877..7cb894845 100644 --- a/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java +++ b/src/com/android/gallery3d/ui/SurfaceTextureScreenNail.java @@ -109,6 +109,7 @@ public abstract class SurfaceTextureScreenNail implements ScreenNail, canvas.translate(cx, cy); canvas.scale(1, -1, 1); canvas.translate(-cx, -cy); + updateTransformMatrix(mTransform); canvas.drawTexture(mExtTexture, mTransform, x, y, width, height); canvas.restore(); } @@ -119,6 +120,8 @@ public abstract class SurfaceTextureScreenNail implements ScreenNail, throw new UnsupportedOperationException(); } + protected void updateTransformMatrix(float[] matrix) {} + @Override abstract public void noDraw(); |