From bc341912b124ea52d1a383bb8cc0a12d0671eaa2 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 22 Sep 2014 18:17:39 -0700 Subject: [PATCH] Reject transparent draws more conservatively bug:17600162 Transparent draws are not safe to reject for all xfermodes other than clear. Now, to be safe, only perform the rejection for SrcOver draws since other modes are fairly uncommon. We could specifically determine whether the xfermode could change the output given a transparent input, but there's little to be gained from the additional complexity. Change-Id: Ia699ac4bdc4da3353955840b53f1922d3cb1d85d --- libs/hwui/Renderer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hwui/Renderer.h b/libs/hwui/Renderer.h index 3681637a962eb..9cedd5aa108b8 100644 --- a/libs/hwui/Renderer.h +++ b/libs/hwui/Renderer.h @@ -71,7 +71,7 @@ public: static inline bool paintWillNotDraw(const SkPaint& paint) { return paint.getAlpha() == 0 && !paint.getColorFilter() - && getXfermode(paint.getXfermode()) != SkXfermode::kClear_Mode; + && getXfermode(paint.getXfermode()) == SkXfermode::kSrcOver_Mode; } // TODO: move to a method on android:Paint