aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/utils/SkDeferredCanvas.cpp4
-rw-r--r--tests/DeferredCanvasTest.cpp8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index c3de393290..13b8d282c6 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -93,6 +93,10 @@ bool isPaintOpaque(const SkPaint* paint,
SkXfermode::Coeff srcCoeff, dstCoeff;
if (SkXfermode::AsCoeff(paint->getXfermode(), &srcCoeff, &dstCoeff)){
+ if (SkXfermode::kDA_Coeff == srcCoeff || SkXfermode::kDC_Coeff == srcCoeff ||
+ SkXfermode::kIDA_Coeff == srcCoeff || SkXfermode::kIDC_Coeff == srcCoeff) {
+ return false;
+ }
switch (dstCoeff) {
case SkXfermode::kZero_Coeff:
return true;
diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp
index f0b4ad2279..80747a47aa 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -101,6 +101,14 @@ static void TestDeferredCanvasFreshFrame(skiatest::Reporter* reporter) {
canvas.drawRect(fullRect, paint);
REPORTER_ASSERT(reporter, canvas.isFreshFrame());
}
+ {
+ SkPaint paint;
+ paint.setStyle( SkPaint::kFill_Style );
+ paint.setAlpha( 255 );
+ paint.setXfermodeMode(SkXfermode::kSrcIn_Mode);
+ canvas.drawRect(fullRect, paint);
+ REPORTER_ASSERT(reporter, !canvas.isFreshFrame());
+ }
{
SkPaint paint;
paint.setStyle( SkPaint::kFill_Style );