aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpriteBlitter_ARGB32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkSpriteBlitter_ARGB32.cpp')
-rw-r--r--src/core/SkSpriteBlitter_ARGB32.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/SkSpriteBlitter_ARGB32.cpp b/src/core/SkSpriteBlitter_ARGB32.cpp
index 93885996ea..1a76b1b2fe 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);