summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/graphics/BitmapShader.java
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2014-07-22 17:25:22 -0400
committerLeon Scroggins III <scroggo@google.com>2014-07-24 09:30:23 -0400
commit866cf65cc3c53f67836c9157d5c661adfdbd25e1 (patch)
tree11e149b2add7d7b3e6f3e4ba7ac79c9c45dd9abf /graphics/java/android/graphics/BitmapShader.java
parent2b122164c8e728069b3f43a0c9fd278ef0392174 (diff)
downloadframeworks_base-866cf65cc3c53f67836c9157d5c661adfdbd25e1.zip
frameworks_base-866cf65cc3c53f67836c9157d5c661adfdbd25e1.tar.gz
frameworks_base-866cf65cc3c53f67836c9157d5c661adfdbd25e1.tar.bz2
Make updateLocalMatrix replace the current Matrix.
Fixes a bug introduced in I3c3316377874e89fccc85afb864bc038b0ef3890. CreateLocalMatrixShader combines the existing matrix with the new matrix, which is not what we want. Keep track of the original SkShader at all times, and always create the local matrix shader with the original. Store the SkShader with a local matrix as Shader.native_with_local_matrix. Make Shader.native_instance private. Instead of allowing direct access, add an init() method which sets it, and getNativeInstance(), which returns either native_instance or native_with_local_matrix, as appropriate. Make Shader subclasses call init(), instead of setting native_instance directly. Pass native_with_local_matrix pointer to nativeSetLocalMatrix and nativeDestructor, which unrefs it (if not null). Since nativeSetLocalMatrix no longer replaces the original, do not unref it. Add a comment to Shader.updateLocalMatrix that it does not affect ComposeShaders created with this Shader. (This should have been a part of I3c3316377874e89fccc85afb864bc038b0ef3890.) BUG:16293121 Change-Id: Ieb31c7e1fe99081f6b81493178f4a18d3c5df643
Diffstat (limited to 'graphics/java/android/graphics/BitmapShader.java')
-rw-r--r--graphics/java/android/graphics/BitmapShader.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/BitmapShader.java b/graphics/java/android/graphics/BitmapShader.java
index 3ab57c1..5e004a3 100644
--- a/graphics/java/android/graphics/BitmapShader.java
+++ b/graphics/java/android/graphics/BitmapShader.java
@@ -43,7 +43,7 @@ public class BitmapShader extends Shader {
mTileX = tileX;
mTileY = tileY;
final long b = bitmap.ni();
- native_instance = nativeCreate(b, tileX.nativeInt, tileY.nativeInt);
+ init(nativeCreate(b, tileX.nativeInt, tileY.nativeInt));
}
/**