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

Unified Diff: src/pipe/SkGPipeWrite.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/pipe/SkGPipeRead.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkGPipeWrite.cpp
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index 43240803256ca534e33fe31c8c1169eadeeee19c..0131ebb8764306520dabac25598078705b9dad1c 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -928,9 +928,9 @@ void SkGPipeCanvas::drawPicture(SkPicture& picture) {
this->INHERITED::drawPicture(picture);
}
-void SkGPipeCanvas::drawVertices(VertexMode mode, int vertexCount,
+void SkGPipeCanvas::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) {
if (0 == vertexCount) {
@@ -953,10 +953,14 @@ void SkGPipeCanvas::drawVertices(VertexMode mode, int vertexCount,
flags |= kDrawVertices_HasIndices_DrawOpFlag;
size += 4 + SkAlign4(indexCount * sizeof(uint16_t));
}
+ if (xfer && !SkXfermode::IsMode(xfer, SkXfermode::kModulate_Mode)) {
+ flags |= kDrawVertices_HasXfermode_DrawOpFlag;
+ size += sizeof(int32_t); // mode enum
+ }
if (this->needOpBytes(size)) {
this->writeOp(kDrawVertices_DrawOp, flags, 0);
- fWriter.write32(mode);
+ fWriter.write32(vmode);
fWriter.write32(vertexCount);
fWriter.write(vertices, vertexCount * sizeof(SkPoint));
if (texs) {
@@ -965,9 +969,11 @@ void SkGPipeCanvas::drawVertices(VertexMode mode, int vertexCount,
if (colors) {
fWriter.write(colors, vertexCount * sizeof(SkColor));
}
-
- // TODO: flatten xfermode
-
+ if (flags & kDrawVertices_HasXfermode_DrawOpFlag) {
+ SkXfermode::Mode mode = SkXfermode::kModulate_Mode;
+ (void)xfer->asMode(&mode);
+ fWriter.write32(mode);
+ }
if (indices && indexCount > 0) {
fWriter.write32(indexCount);
fWriter.writePad(indices, indexCount * sizeof(uint16_t));
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698