Loading graphics/java/android/graphics/ComposeShader.java +13 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,12 @@ package android.graphics; an {@link android.graphics.Xfermode} subclass. */ public class ComposeShader extends Shader { /** * Hold onto the shaders to avoid GC. */ @SuppressWarnings({"UnusedDeclaration"}) private final Shader mShaderA; @SuppressWarnings({"UnusedDeclaration"}) private final Shader mShaderB; /** Create a new compose shader, given shaders A, B, and a combining mode. Loading @@ -36,8 +41,14 @@ public class ComposeShader extends Shader { mShaderB = shaderB; native_instance = nativeCreate1(shaderA.native_instance, shaderB.native_instance, (mode != null) ? mode.native_instance : 0); if (mode instanceof PorterDuffXfermode) { PorterDuff.Mode pdMode = ((PorterDuffXfermode) mode).mode; native_shader = nativePostCreate1(native_instance, shaderA.native_shader, shaderB.native_shader, pdMode != null ? pdMode.nativeInt : 0); } else { native_shader = nativePostCreate1(native_instance, shaderA.native_shader, shaderB.native_shader, (mode != null) ? mode.native_instance : 0); shaderB.native_shader, mode != null ? mode.native_instance : 0); } } /** Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. Loading graphics/java/android/graphics/PorterDuffXfermode.java +6 −0 Original line number Diff line number Diff line Loading @@ -17,12 +17,18 @@ package android.graphics; public class PorterDuffXfermode extends Xfermode { /** * @hide */ public final PorterDuff.Mode mode; /** * Create an xfermode that uses the specified porter-duff mode. * * @param mode The porter-duff mode that is applied */ public PorterDuffXfermode(PorterDuff.Mode mode) { this.mode = mode; native_instance = nativeCreateXfermode(mode.nativeInt); } Loading graphics/java/android/graphics/Xfermode.java +5 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,11 @@ package android.graphics; public class Xfermode { protected void finalize() throws Throwable { try { finalizer(native_instance); } finally { super.finalize(); } } private static native void finalizer(int native_instance); Loading Loading
graphics/java/android/graphics/ComposeShader.java +13 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,12 @@ package android.graphics; an {@link android.graphics.Xfermode} subclass. */ public class ComposeShader extends Shader { /** * Hold onto the shaders to avoid GC. */ @SuppressWarnings({"UnusedDeclaration"}) private final Shader mShaderA; @SuppressWarnings({"UnusedDeclaration"}) private final Shader mShaderB; /** Create a new compose shader, given shaders A, B, and a combining mode. Loading @@ -36,8 +41,14 @@ public class ComposeShader extends Shader { mShaderB = shaderB; native_instance = nativeCreate1(shaderA.native_instance, shaderB.native_instance, (mode != null) ? mode.native_instance : 0); if (mode instanceof PorterDuffXfermode) { PorterDuff.Mode pdMode = ((PorterDuffXfermode) mode).mode; native_shader = nativePostCreate1(native_instance, shaderA.native_shader, shaderB.native_shader, pdMode != null ? pdMode.nativeInt : 0); } else { native_shader = nativePostCreate1(native_instance, shaderA.native_shader, shaderB.native_shader, (mode != null) ? mode.native_instance : 0); shaderB.native_shader, mode != null ? mode.native_instance : 0); } } /** Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. Loading
graphics/java/android/graphics/PorterDuffXfermode.java +6 −0 Original line number Diff line number Diff line Loading @@ -17,12 +17,18 @@ package android.graphics; public class PorterDuffXfermode extends Xfermode { /** * @hide */ public final PorterDuff.Mode mode; /** * Create an xfermode that uses the specified porter-duff mode. * * @param mode The porter-duff mode that is applied */ public PorterDuffXfermode(PorterDuff.Mode mode) { this.mode = mode; native_instance = nativeCreateXfermode(mode.nativeInt); } Loading
graphics/java/android/graphics/Xfermode.java +5 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,11 @@ package android.graphics; public class Xfermode { protected void finalize() throws Throwable { try { finalizer(native_instance); } finally { super.finalize(); } } private static native void finalizer(int native_instance); Loading