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; |