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

Unified Diff: src/pipe/SkPipeReader.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/pipe/SkPipeFormat.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkPipeReader.cpp
diff --git a/src/pipe/SkPipeReader.cpp b/src/pipe/SkPipeReader.cpp
index 8840da1c83af9c734a847908f4128db7321834c9..47d4072d0661ad690ea23bfedfff117cb23e4b25 100644
--- a/src/pipe/SkPipeReader.cpp
+++ b/src/pipe/SkPipeReader.cpp
@@ -149,13 +149,13 @@ static SkMatrix read_sparse_matrix(SkReadBuffer& reader, SkMatrix::TypeMask tm)
* pad zeros : 8
*/
static SkPaint read_paint(SkReadBuffer& reader) {
+ SkPaint paint;
+
uint32_t packedFlags = reader.read32();
uint32_t extra = reader.read32();
unsigned nondef = extra >> 16;
- SkXfermode::Mode mode = (SkXfermode::Mode)((extra >> 8) & 0xFF);
- SkASSERT((extra & 0xFF) == 0);
-
- SkPaint paint;
+ paint.setBlendMode(SkBlendMode((extra >> 8) & 0xFF));
+ SkASSERT((extra & 0xFF) == 0); // zero pad byte
packedFlags >>= 2; // currently unused
paint.setTextEncoding((SkPaint::TextEncoding)(packedFlags & 3)); packedFlags >>= 2;
@@ -180,17 +180,12 @@ static SkPaint read_paint(SkReadBuffer& reader) {
CHECK_SET_FLATTENABLE(Typeface);
CHECK_SET_FLATTENABLE(PathEffect);
CHECK_SET_FLATTENABLE(Shader);
- CHECK_SET_FLATTENABLE(Xfermode);
CHECK_SET_FLATTENABLE(MaskFilter);
CHECK_SET_FLATTENABLE(ColorFilter);
CHECK_SET_FLATTENABLE(Rasterizer);
CHECK_SET_FLATTENABLE(ImageFilter);
CHECK_SET_FLATTENABLE(DrawLooper);
- if (!(nondef & kXfermode_NonDef)) {
- paint.setXfermodeMode(mode);
- }
-
return paint;
}
« no previous file with comments | « src/pipe/SkPipeFormat.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698