summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/Paint.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 966e171a9c04..04385c628c35 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1066,12 +1066,8 @@ public class Paint {
*/
public void setColor(@ColorLong long color) {
ColorSpace cs = Color.colorSpace(color);
- float r = Color.red(color);
- float g = Color.green(color);
- float b = Color.blue(color);
- float a = Color.alpha(color);
- nSetColor(mNativePaint, cs.getNativeInstance(), r, g, b, a);
+ nSetColor(mNativePaint, cs.getNativeInstance(), color);
mColor = color;
}
@@ -1501,11 +1497,7 @@ public class Paint {
*/
public void setShadowLayer(float radius, float dx, float dy, @ColorLong long shadowColor) {
ColorSpace cs = Color.colorSpace(shadowColor);
- float r = Color.red(shadowColor);
- float g = Color.green(shadowColor);
- float b = Color.blue(shadowColor);
- float a = Color.alpha(shadowColor);
- nSetShadowLayer(mNativePaint, radius, dx, dy, cs.getNativeInstance(), r, g, b, a);
+ nSetShadowLayer(mNativePaint, radius, dx, dy, cs.getNativeInstance(), shadowColor);
mShadowLayerRadius = radius;
mShadowLayerDx = dx;
@@ -1533,6 +1525,7 @@ public class Paint {
/**
* Returns the blur radius of the shadow layer.
* @see #setShadowLayer(float,float,float,int)
+ * @see #setShadowLayer(float,float,float,long)
*/
public float getShadowLayerRadius() {
return mShadowLayerRadius;
@@ -1541,6 +1534,7 @@ public class Paint {
/**
* Returns the x offset of the shadow layer.
* @see #setShadowLayer(float,float,float,int)
+ * @see #setShadowLayer(float,float,float,long)
*/
public float getShadowLayerDx() {
return mShadowLayerDx;
@@ -1549,6 +1543,7 @@ public class Paint {
/**
* Returns the y offset of the shadow layer.
* @see #setShadowLayer(float,float,float,int)
+ * @see #setShadowLayer(float,float,float,long)
*/
public float getShadowLayerDy() {
return mShadowLayerDy;
@@ -3138,7 +3133,7 @@ public class Paint {
@CriticalNative
private static native void nSetShadowLayer(long paintPtr,
float radius, float dx, float dy, long colorSpaceHandle,
- float r, float g, float b, float a);
+ @ColorLong long shadowColor);
@CriticalNative
private static native boolean nHasShadowLayer(long paintPtr);
@CriticalNative
@@ -3191,7 +3186,7 @@ public class Paint {
private static native void nSetFilterBitmap(long paintPtr, boolean filter);
@CriticalNative
private static native void nSetColor(long paintPtr, long colorSpaceHandle,
- float r, float g, float b, float a);
+ @ColorLong long color);
@CriticalNative
private static native void nSetColor(long paintPtr, @ColorInt int color);
@CriticalNative