Index: src/core/SkPicturePlayback.cpp |
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp |
index fd359fed8987593ec47401fc77b458e69591ef3e..4617039974be92cb5b4f922d5771f38190340988 100644 |
--- a/src/core/SkPicturePlayback.cpp |
+++ b/src/core/SkPicturePlayback.cpp |
@@ -308,9 +308,28 @@ void SkPicturePlayback::handleOp(SkReader32* reader, |
break; |
case DRAW_PATCH: { |
const SkPaint& paint = *fPictureData->getPaint(reader); |
- SkPatch patch; |
- reader->readPatch(&patch); |
- canvas->drawPatch(patch, paint); |
+ |
+ const SkPoint* cubics = (const SkPoint*)reader->skip(SkPatchUtils::kNumCtrlPts * |
+ sizeof(SkPoint)); |
+ uint32_t flag = reader->readInt(); |
+ const SkColor* colors = NULL; |
+ if (flag & DRAW_VERTICES_HAS_COLORS) { |
+ colors = (const SkColor*)reader->skip(SkPatchUtils::kNumCorners * sizeof(SkColor)); |
+ } |
+ const SkPoint* texCoords = NULL; |
+ if (flag & DRAW_VERTICES_HAS_TEXS) { |
+ texCoords = (const SkPoint*)reader->skip(SkPatchUtils::kNumCorners * |
+ sizeof(SkPoint)); |
+ } |
+ SkAutoTUnref<SkXfermode> xfer; |
+ if (flag & 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->drawPatch(cubics, colors, texCoords, xfer, paint); |
} break; |
case DRAW_PATH: { |
const SkPaint& paint = *fPictureData->getPaint(reader); |