Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: src/core/SkPictureRecord.cpp

Issue 112913005: reenable vertices gm, adding picture support (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698