diff options
author | Romain Guy <romainguy@google.com> | 2013-08-13 17:46:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-13 17:46:19 +0000 |
commit | 9955699d30eaab964549b8173fe9a52dca782877 (patch) | |
tree | 255d1a362b71d48ae5f99a3635637ec90544b648 | |
parent | e932e30eadb5978591316ffe3d21d60604c0cd91 (diff) | |
parent | 7fbbc3c9c3dc25c2bc78bba6fd267bfd99c96b2b (diff) | |
download | frameworks_base-9955699d30eaab964549b8173fe9a52dca782877.zip frameworks_base-9955699d30eaab964549b8173fe9a52dca782877.tar.gz frameworks_base-9955699d30eaab964549b8173fe9a52dca782877.tar.bz2 |
Merge "Camera.applyToCanvas() now works with hardware canvases" into klp-dev
-rw-r--r-- | graphics/java/android/graphics/Camera.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Camera.java b/graphics/java/android/graphics/Camera.java index 6f71a2b..9e07bd4 100644 --- a/graphics/java/android/graphics/Camera.java +++ b/graphics/java/android/graphics/Camera.java @@ -22,6 +22,8 @@ package android.graphics; * {@link Canvas}. */ public class Camera { + private Matrix mMatrix; + /** * Creates a new camera, with empty transformations. */ @@ -147,7 +149,13 @@ public class Camera { * @param canvas The Canvas to set the transform matrix onto */ public void applyToCanvas(Canvas canvas) { - nativeApplyToCanvas(canvas.mNativeCanvas); + if (canvas.isHardwareAccelerated()) { + if (mMatrix == null) mMatrix = new Matrix(); + getMatrix(mMatrix); + canvas.concat(mMatrix); + } else { + nativeApplyToCanvas(canvas.mNativeCanvas); + } } public native float dotWithNormal(float dx, float dy, float dz); |