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

Unified Diff: src/core/SkBlitter_Sprite.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/SkBlitter_RGB16.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_Sprite.cpp
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index 950f18791fe6be4b47ef80469df4e296c69382d9..cef4cfaa2f091f4bb8435541513ad925a2c99812 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -68,14 +68,11 @@ public:
if (0xFF != paint.getAlpha()) {
return false;
}
- SkXfermode::Mode mode;
- if (!SkXfermode::AsMode(paint.getXfermode(), &mode)) {
- return false;
- }
- if (SkXfermode::kSrc_Mode == mode) {
+ SkBlendMode mode = paint.getBlendMode();
+ if (SkBlendMode::kSrc == mode) {
return true;
}
- if (SkXfermode::kSrcOver_Mode == mode && src.isOpaque()) {
+ if (SkBlendMode::kSrcOver == mode && src.isOpaque()) {
return true;
}
@@ -85,7 +82,7 @@ public:
return false;
}
- return SkXfermode::kSrcOver_Mode == mode;
+ return SkBlendMode::kSrcOver == mode;
}
SkSpriteBlitter_Src_SrcOver(const SkPixmap& src)
@@ -94,14 +91,11 @@ public:
void setup(const SkPixmap& dst, int left, int top, const SkPaint& paint) override {
SkASSERT(Supports(dst, fSource, paint));
this->INHERITED::setup(dst, left, top, paint);
- SkXfermode::Mode mode;
- if (!SkXfermode::AsMode(paint.getXfermode(), &mode)) {
- SkFAIL("Should never happen.");
- }
+ SkBlendMode mode = paint.getBlendMode();
- SkASSERT(mode == SkXfermode::kSrcOver_Mode || mode == SkXfermode::kSrc_Mode);
+ SkASSERT(mode == SkBlendMode::kSrcOver || mode == SkBlendMode::kSrc);
- if (mode == SkXfermode::kSrcOver_Mode && !fSource.isOpaque()) {
+ if (mode == SkBlendMode::kSrcOver && !fSource.isOpaque()) {
fUseMemcpy = false;
}
}
« no previous file with comments | « src/core/SkBlitter_RGB16.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698