Index: src/pipe/SkGPipeRead.cpp |
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp |
index 877d380d61444f667ddfe8331cd5960608fe13f7..fc5ab5a2aad0c15a5328c5b4e45621facd6e001a 100644 |
--- a/src/pipe/SkGPipeRead.cpp |
+++ b/src/pipe/SkGPipeRead.cpp |
@@ -409,7 +409,7 @@ static void drawVertices_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
SkGPipeState* state) { |
unsigned flags = DrawOp_unpackFlags(op32); |
- SkCanvas::VertexMode mode = (SkCanvas::VertexMode)reader->readU32(); |
+ SkCanvas::VertexMode vmode = (SkCanvas::VertexMode)reader->readU32(); |
int vertexCount = reader->readU32(); |
const SkPoint* verts = skip<SkPoint>(reader, vertexCount); |
@@ -423,8 +423,11 @@ static void drawVertices_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
colors = skip<SkColor>(reader, vertexCount); |
} |
- // TODO: flatten/unflatten xfermodes |
- SkXfermode* xfer = NULL; |
+ SkAutoTUnref<SkXfermode> xfer; |
+ if (flags & kDrawVertices_HasXfermode_DrawOpFlag) { |
+ SkXfermode::Mode mode = (SkXfermode::Mode)reader->readU32(); |
+ xfer.reset(SkXfermode::Create(mode)); |
+ } |
int indexCount = 0; |
const uint16_t* indices = NULL; |
@@ -433,7 +436,7 @@ static void drawVertices_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
indices = skipAlign<uint16_t>(reader, indexCount); |
} |
if (state->shouldDraw()) { |
- canvas->drawVertices(mode, vertexCount, verts, texs, colors, xfer, |
+ canvas->drawVertices(vmode, vertexCount, verts, texs, colors, xfer, |
indices, indexCount, state->paint()); |
} |
} |