Index: src/core/SkPicturePlayback.cpp |
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp |
index fd359fed8987593ec47401fc77b458e69591ef3e..7f3f9d75d05d2f6779f1f337836286dc7d26ac40 100644 |
--- a/src/core/SkPicturePlayback.cpp |
+++ b/src/core/SkPicturePlayback.cpp |
@@ -6,6 +6,7 @@ |
*/ |
#include "SkCanvas.h" |
+#include "SkPatchUtils.h" |
#include "SkPictureData.h" |
#include "SkPicturePlayback.h" |
#include "SkPictureRecord.h" |
@@ -308,9 +309,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); |