diff options
Diffstat (limited to 'graphics/java/android/graphics/Shader.java')
-rw-r--r-- | graphics/java/android/graphics/Shader.java | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/graphics/java/android/graphics/Shader.java b/graphics/java/android/graphics/Shader.java index ae0304e..b397662 100644 --- a/graphics/java/android/graphics/Shader.java +++ b/graphics/java/android/graphics/Shader.java @@ -23,9 +23,16 @@ package android.graphics; * drawn with that paint will get its color(s) from the shader. */ public class Shader { - - // this is set by subclasses, but don't make it public - /* package */ int native_instance; + /** + * This is set by subclasses, but don't make it public. + * + * @hide + */ + public int native_instance; + /** + * @hide + */ + public int native_shader; public enum TileMode { /** @@ -64,17 +71,20 @@ public class Shader { * @param localM The shader's new local matrix, or null to specify identity */ public void setLocalMatrix(Matrix localM) { - nativeSetLocalMatrix(native_instance, - localM != null ? localM.native_instance : 0); + nativeSetLocalMatrix(native_instance, native_shader, localM.native_instance); } protected void finalize() throws Throwable { - nativeDestructor(native_instance); + try { + super.finalize(); + } finally { + nativeDestructor(native_instance, native_shader); + } } - private static native void nativeDestructor(int native_shader); + private static native void nativeDestructor(int native_shader, int native_skiaShader); private static native boolean nativeGetLocalMatrix(int native_shader, - int matrix_instance); + int matrix_instance); private static native void nativeSetLocalMatrix(int native_shader, - int matrix_instance); + int native_skiaShader, int matrix_instance); } |