Skip to content

Commit b47232b

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Don't call saveLayer() when it's not required Bug #5435653"
2 parents 50c3102 + 098ffcd commit b47232b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphics/java/android/graphics/drawable/GradientDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void draw(Canvas canvas) {
285285
of the fill (if any) without worrying about blending artifacts.
286286
*/
287287
final boolean useLayer = haveStroke && haveFill && st.mShape != LINE &&
288-
currStrokeAlpha < 255;
288+
currStrokeAlpha < 255 && (mAlpha < 255 || mColorFilter != null);
289289

290290
/* Drawing with a layer is slower than direct drawing, but it
291291
allows us to apply paint effects like alpha and colorfilter to

0 commit comments

Comments
 (0)