aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pipe/SkPipeReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipe/SkPipeReader.cpp')
-rw-r--r--src/pipe/SkPipeReader.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pipe/SkPipeReader.cpp b/src/pipe/SkPipeReader.cpp
index 47d4072d06..8840da1c83 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;
- paint.setBlendMode(SkBlendMode((extra >> 8) & 0xFF));
- SkASSERT((extra & 0xFF) == 0); // zero pad byte
+ SkXfermode::Mode mode = (SkXfermode::Mode)((extra >> 8) & 0xFF);
+ SkASSERT((extra & 0xFF) == 0);
+
+ SkPaint paint;
packedFlags >>= 2; // currently unused
paint.setTextEncoding((SkPaint::TextEncoding)(packedFlags & 3)); packedFlags >>= 2;
@@ -180,12 +180,17 @@ 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;
}