diff options
| author | Romain Guy <romainguy@google.com> | 2010-09-20 19:04:33 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2010-09-21 16:48:50 -0700 |
| commit | ddb80bebb0776e6d852aab6e8bba5d5591847a55 (patch) | |
| tree | 460e39e115bf75648a3b4dbc9788c911751bd848 /graphics/java | |
| parent | ee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f (diff) | |
| download | frameworks_base-ddb80bebb0776e6d852aab6e8bba5d5591847a55.zip frameworks_base-ddb80bebb0776e6d852aab6e8bba5d5591847a55.tar.gz frameworks_base-ddb80bebb0776e6d852aab6e8bba5d5591847a55.tar.bz2 | |
Add support for circular gradients to the GL renderer.
This change also adds full support for local transformation matrices on
sweep and radial gradients.
Change-Id: Id8773bc0766575190e3f3d51984fc5e57b266c3f
Diffstat (limited to 'graphics/java')
| -rw-r--r-- | graphics/java/android/graphics/RadialGradient.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/RadialGradient.java b/graphics/java/android/graphics/RadialGradient.java index b4e902d..897762c 100644 --- a/graphics/java/android/graphics/RadialGradient.java +++ b/graphics/java/android/graphics/RadialGradient.java @@ -40,6 +40,8 @@ public class RadialGradient extends Shader { throw new IllegalArgumentException("color and position arrays must be of equal length"); } native_instance = nativeCreate1(x, y, radius, colors, positions, tile.nativeInt); + native_shader = nativePostCreate1(native_instance, x, y, radius, colors, positions, + tile.nativeInt); } /** Create a shader that draws a radial gradient given the center and radius. @@ -56,11 +58,18 @@ public class RadialGradient extends Shader { throw new IllegalArgumentException("radius must be > 0"); } native_instance = nativeCreate2(x, y, radius, color0, color1, tile.nativeInt); + native_shader = nativePostCreate2(native_instance, x, y, radius, color0, color1, + tile.nativeInt); } private static native int nativeCreate1(float x, float y, float radius, - int colors[], float positions[], int tileMode); + int colors[], float positions[], int tileMode); private static native int nativeCreate2(float x, float y, float radius, - int color0, int color1, int tileMode); + int color0, int color1, int tileMode); + + private static native int nativePostCreate1(int native_shader, float x, float y, float radius, + int colors[], float positions[], int tileMode); + private static native int nativePostCreate2(int native_shader, float x, float y, float radius, + int color0, int color1, int tileMode); } |
