Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: src/core/SkSpriteBlitter_ARGB32.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkSpriteBlitter4f.cpp ('k') | src/core/SkSpriteBlitter_RGB16.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/core/SkSpriteBlitter4f.cpp ('k') | src/core/SkSpriteBlitter_RGB16.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698