Index: src/core/SkSpriteBlitter_ARGB32.cpp |
diff --git a/src/core/SkSpriteBlitter_ARGB32.cpp b/src/core/SkSpriteBlitter_ARGB32.cpp |
index 93885996ea4e7a1490c7862028440cf952d924b8..1a76b1b2fe1511c8c153370aaf56a8ea3603e9b0 100644 |
--- a/src/core/SkSpriteBlitter_ARGB32.cpp |
+++ b/src/core/SkSpriteBlitter_ARGB32.cpp |
@@ -63,8 +63,7 @@ public: |
fColorFilter = paint.getColorFilter(); |
SkSafeRef(fColorFilter); |
- fXfermode = paint.getXfermode(); |
- SkSafeRef(fXfermode); |
+ fXfermode = SkXfermode::Peek(paint.getBlendMode()); |
fBufferSize = 0; |
fBuffer = nullptr; |
@@ -83,7 +82,6 @@ public: |
virtual ~Sprite_D32_XferFilter() { |
delete[] fBuffer; |
- SkSafeUnref(fXfermode); |
SkSafeUnref(fColorFilter); |
} |
@@ -263,7 +261,7 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseL32(const SkPixmap& source, const SkPain |
} |
U8CPU alpha = paint.getAlpha(); |
- SkXfermode* xfermode = paint.getXfermode(); |
+ bool isSrcOver = paint.isSrcOver(); |
SkColorFilter* filter = paint.getColorFilter(); |
SkSpriteBlitter* blitter = nullptr; |
@@ -272,7 +270,7 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseL32(const SkPixmap& source, const SkPain |
if (alpha != 0xFF) { |
return nullptr; // we only have opaque sprites |
} |
- if (xfermode || filter) { |
+ if (!isSrcOver || filter) { |
blitter = allocator->createT<Sprite_D32_S4444_XferFilter>(source, paint); |
} else if (source.isOpaque()) { |
blitter = allocator->createT<Sprite_D32_S4444_Opaque>(source); |
@@ -281,7 +279,7 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseL32(const SkPixmap& source, const SkPain |
} |
break; |
case kN32_SkColorType: |
- if (xfermode || filter) { |
+ if (!isSrcOver || filter) { |
if (255 == alpha) { |
// this can handle xfermode or filter, but not alpha |
blitter = allocator->createT<Sprite_D32_S32A_XferFilter>(source, paint); |