summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
authorNader Jawad <njawad@google.com>2019-10-31 11:09:18 -0700
committerNader Jawad <njawad@google.com>2019-10-31 11:09:18 -0700
commit214e485373ed88d8fd74351023c49c2c922f91de (patch)
tree979c444994914a3ba452563f6a24f95d1176b0c6 /graphics/java
parent91ede359fa122d8e3defb08d451fae1814d1ded4 (diff)
Fixed issue where tint would be applied to solid
region of GradientDrawable even if none was defined Fixed issue where solid black would be applied through modulated default alpha value if both solid and gradient colors were not applied to the gradient. Test: Added CTS test Bug: 142733137 Change-Id: Iecb7010f6d318cc962113528aac694b0de47d9dd
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/drawable/GradientDrawable.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java
index 96ac0f9b38b5..3f887f720e23 100644
--- a/graphics/java/android/graphics/drawable/GradientDrawable.java
+++ b/graphics/java/android/graphics/drawable/GradientDrawable.java
@@ -773,7 +773,9 @@ public class GradientDrawable extends Drawable {
mFillPaint.setDither(st.mDither);
mFillPaint.setColorFilter(colorFilter);
if (colorFilter != null && st.mSolidColors == null) {
- mFillPaint.setColor(mAlpha << 24);
+ // If we don't have a solid color and we don't have a gradient,
+ // the app is stroking the shape, set the color to transparent
+ mFillPaint.setColor(st.mGradientColors != null ? mAlpha << 24 : 0);
}
if (haveStroke) {
mStrokePaint.setAlpha(currStrokeAlpha);