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

Unified Diff: src/core/SkRecordDraw.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/SkReadBuffer.h ('k') | src/core/SkRecordOpts.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index ca9c1b6f785a0349059133743e6c3e618613e2a9..dca19df1005cab64277135314255f92d8b5f968c 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -341,34 +341,27 @@ private:
return true;
}
- // Unusual Xfermodes require us to process a saved layer
+ // Unusual blendmodes require us to process a saved layer
// even with operations outisde the clip.
// For example, DstIn is used by masking layers.
// https://code.google.com/p/skia/issues/detail?id=1291
// https://crbug.com/401593
- SkXfermode* xfermode = paint->getXfermode();
- SkXfermode::Mode mode;
- // SrcOver is ok, and is also the common case with a nullptr xfermode.
- // So we should make that the fast path and bypass the mode extraction
- // and test.
- if (xfermode && xfermode->asMode(&mode)) {
- switch (mode) {
- // For each of the following transfer modes, if the source
- // alpha is zero (our transparent black), the resulting
- // blended alpha is not necessarily equal to the original
- // destination alpha.
- case SkXfermode::kClear_Mode:
- case SkXfermode::kSrc_Mode:
- case SkXfermode::kSrcIn_Mode:
- case SkXfermode::kDstIn_Mode:
- case SkXfermode::kSrcOut_Mode:
- case SkXfermode::kDstATop_Mode:
- case SkXfermode::kModulate_Mode:
- return true;
- break;
- default:
- break;
- }
+ switch (paint->getBlendMode()) {
+ // For each of the following transfer modes, if the source
+ // alpha is zero (our transparent black), the resulting
+ // blended alpha is not necessarily equal to the original
+ // destination alpha.
+ case SkBlendMode::kClear:
+ case SkBlendMode::kSrc:
+ case SkBlendMode::kSrcIn:
+ case SkBlendMode::kDstIn:
+ case SkBlendMode::kSrcOut:
+ case SkBlendMode::kDstATop:
+ case SkBlendMode::kModulate:
+ return true;
+ break;
+ default:
+ break;
}
}
return false;
« no previous file with comments | « src/core/SkReadBuffer.h ('k') | src/core/SkRecordOpts.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698