Index: src/core/SkPictureRecord.cpp |
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp |
index 6b49620d4813c1f0362e688f76f41711f63383b2..b7508b3623fa20a2b43073009b38a48a61bee6cc 100644 |
--- a/src/core/SkPictureRecord.cpp |
+++ b/src/core/SkPictureRecord.cpp |
@@ -1189,7 +1189,7 @@ void SkPictureRecord::drawPicture(SkPicture& picture) { |
void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount, |
const SkPoint vertices[], const SkPoint texs[], |
- const SkColor colors[], SkXfermode*, |
+ const SkColor colors[], SkXfermode* xfer, |
const uint16_t indices[], int indexCount, |
const SkPaint& paint) { |
uint32_t flags = 0; |
@@ -1202,6 +1202,12 @@ void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount, |
if (indexCount > 0) { |
flags |= DRAW_VERTICES_HAS_INDICES; |
} |
+ if (NULL != xfer) { |
+ SkXfermode::Mode mode; |
+ if (xfer->asMode(&mode) && SkXfermode::kModulate_Mode != mode) { |
+ flags |= DRAW_VERTICES_HAS_XFER; |
+ } |
+ } |
// op + paint index + flags + vmode + vCount + vertices |
uint32_t size = 5 * kUInt32Size + vertexCount * sizeof(SkPoint); |
@@ -1215,6 +1221,9 @@ void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount, |
// + num indices + indices |
size += 1 * kUInt32Size + SkAlign4(indexCount * sizeof(uint16_t)); |
} |
+ if (flags & DRAW_VERTICES_HAS_XFER) { |
+ size += kUInt32Size; // mode enum |
+ } |
size_t initialOffset = this->addDraw(DRAW_VERTICES, &size); |
SkASSERT(initialOffset+getPaintOffset(DRAW_VERTICES, size) == fWriter.bytesWritten()); |
@@ -1233,6 +1242,11 @@ void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount, |
addInt(indexCount); |
fWriter.writePad(indices, indexCount * sizeof(uint16_t)); |
} |
+ if (flags & DRAW_VERTICES_HAS_XFER) { |
+ SkXfermode::Mode mode = SkXfermode::kModulate_Mode; |
+ (void)xfer->asMode(&mode); |
+ addInt(mode); |
+ } |
this->validate(initialOffset, size); |
} |