summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-01-04 15:00:48 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-04 15:00:48 -0800
commit6b1f6e6ac1d8c8cff778ee161f430e077a82082e (patch)
tree0c43c7fc3334879ad8f480d134759bf75fe1d0ba /graphics
parentb794a5e53a8a954d7f8c2be1d321f1c87bfc556f (diff)
parenta9ebfa6bcce62d7fee69693fe3dee6027afd3f0e (diff)
downloadframeworks_base-6b1f6e6ac1d8c8cff778ee161f430e077a82082e.zip
frameworks_base-6b1f6e6ac1d8c8cff778ee161f430e077a82082e.tar.gz
frameworks_base-6b1f6e6ac1d8c8cff778ee161f430e077a82082e.tar.bz2
Merge "Keep a reference to the local matrix. Bug #3299324"
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/Shader.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/graphics/java/android/graphics/Shader.java b/graphics/java/android/graphics/Shader.java
index 0400b5c..3acf1ea 100644
--- a/graphics/java/android/graphics/Shader.java
+++ b/graphics/java/android/graphics/Shader.java
@@ -34,6 +34,8 @@ public class Shader {
*/
public int native_shader;
+ private Matrix mLocalMatrix;
+
public enum TileMode {
/**
* replicate the edge color if the shader draws outside of its
@@ -62,7 +64,11 @@ public class Shader {
* @return true if the shader has a non-identity local matrix
*/
public boolean getLocalMatrix(Matrix localM) {
- return nativeGetLocalMatrix(native_instance, localM.native_instance);
+ if (mLocalMatrix != null) {
+ localM.set(mLocalMatrix);
+ return true;
+ }
+ return false;
}
/**
@@ -71,6 +77,7 @@ public class Shader {
* @param localM The shader's new local matrix, or null to specify identity
*/
public void setLocalMatrix(Matrix localM) {
+ mLocalMatrix = localM;
nativeSetLocalMatrix(native_instance, native_shader,
localM == null ? 0 : localM.native_instance);
}
@@ -84,8 +91,6 @@ public class Shader {
}
private static native void nativeDestructor(int native_shader, int native_skiaShader);
- private static native boolean nativeGetLocalMatrix(int native_shader,
- int matrix_instance);
private static native void nativeSetLocalMatrix(int native_shader,
int native_skiaShader, int matrix_instance);
}