Index: src/core/SkPicturePlayback.cpp |
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp |
index cb73689eeb98bffb9877fcd75f2829fff25e937f..195afc6526a6129a532ab5779635d5f55f886a7c 100644 |
--- a/src/core/SkPicturePlayback.cpp |
+++ b/src/core/SkPicturePlayback.cpp |
@@ -1025,6 +1025,7 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback) |
matrix, paint); |
} break; |
case DRAW_VERTICES: { |
+ SkAutoTUnref<SkXfermode> xfer; |
const SkPaint& paint = *getPaint(reader); |
DrawVertexFlags flags = (DrawVertexFlags)reader.readInt(); |
SkCanvas::VertexMode vmode = (SkCanvas::VertexMode)reader.readInt(); |
@@ -1048,7 +1049,14 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback) |
indices = (const uint16_t*)reader.skip( |
iCount * sizeof(uint16_t)); |
} |
- canvas.drawVertices(vmode, vCount, verts, texs, colors, NULL, |
+ if (flags & DRAW_VERTICES_HAS_XFER) { |
+ int mode = reader.readInt(); |
+ if (mode < 0 || mode > SkXfermode::kLastMode) { |
+ mode = SkXfermode::kModulate_Mode; |
+ } |
+ xfer.reset(SkXfermode::Create((SkXfermode::Mode)mode)); |
+ } |
+ canvas.drawVertices(vmode, vCount, verts, texs, colors, xfer, |
indices, iCount, paint); |
} break; |
case RESTORE: |