summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-09-20 17:53:08 -0700
committerRomain Guy <romainguy@google.com>2010-09-20 17:54:17 -0700
commitee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f (patch)
tree4fd53bcd273d42fa1aebb064b18563aa293467b1 /graphics/java/android
parentb5ab4173e0927e4668a45298c9900cd8007584e1 (diff)
downloadframeworks_base-ee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f.zip
frameworks_base-ee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f.tar.gz
frameworks_base-ee916f14cbd1fe1422c063ce2ef7b185e2bc5c6f.tar.bz2
Add support for SweepGradient in the GL renderer.
Change-Id: I7aa397ed4e34655ead9ba1f5b4ce087665e0f022
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/Shader.java3
-rw-r--r--graphics/java/android/graphics/SweepGradient.java13
2 files changed, 11 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/Shader.java b/graphics/java/android/graphics/Shader.java
index b397662..0400b5c 100644
--- a/graphics/java/android/graphics/Shader.java
+++ b/graphics/java/android/graphics/Shader.java
@@ -71,7 +71,8 @@ public class Shader {
* @param localM The shader's new local matrix, or null to specify identity
*/
public void setLocalMatrix(Matrix localM) {
- nativeSetLocalMatrix(native_instance, native_shader, localM.native_instance);
+ nativeSetLocalMatrix(native_instance, native_shader,
+ localM == null ? 0 : localM.native_instance);
}
protected void finalize() throws Throwable {
diff --git a/graphics/java/android/graphics/SweepGradient.java b/graphics/java/android/graphics/SweepGradient.java
index 7456993..2afdd4d 100644
--- a/graphics/java/android/graphics/SweepGradient.java
+++ b/graphics/java/android/graphics/SweepGradient.java
@@ -42,6 +42,7 @@ public class SweepGradient extends Shader {
"color and position arrays must be of equal length");
}
native_instance = nativeCreate1(cx, cy, colors, positions);
+ native_shader = nativePostCreate1(native_instance, cx, cy, colors, positions);
}
/**
@@ -54,11 +55,15 @@ public class SweepGradient extends Shader {
*/
public SweepGradient(float cx, float cy, int color0, int color1) {
native_instance = nativeCreate2(cx, cy, color0, color1);
+ native_shader = nativePostCreate2(native_instance, cx, cy, color0, color1);
}
- private static native int nativeCreate1(float x, float y,
- int colors[], float positions[]);
- private static native int nativeCreate2(float x, float y,
- int color0, int color1);
+ private static native int nativeCreate1(float x, float y, int colors[], float positions[]);
+ private static native int nativeCreate2(float x, float y, int color0, int color1);
+
+ private static native int nativePostCreate1(int native_shader, float cx, float cy,
+ int[] colors, float[] positions);
+ private static native int nativePostCreate2(int native_shader, float cx, float cy,
+ int color0, int color1);
}