Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index a4394589bbafea1bebbaa6b6d3305695bd0f5175..e66d28f0dab34cc4706ef614cc5abfa82abc7eac 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -1714,10 +1714,23 @@ void SkGpuDevice::drawAtlas(const SkDraw& d, const SkImage* atlas, const SkRSXfo |
indices += 6; |
} |
+ SkAutoTMalloc<SkColor> colorStorage; |
+ SkColor* vertCols = NULL; |
+ if (colors) { |
+ colorStorage.reset(vertCount); |
+ vertCols = colorStorage.get(); |
+ |
+ for (int i = 0; i < count; ++i) { |
+ vertCols[0] = vertCols[1] = vertCols[2] = vertCols[3] = colors[i]; |
+ vertCols += 4; |
+ } |
+ } |
+ |
verts = vertStorage.get(); |
texs = verts + vertCount; |
+ vertCols = colorStorage.get(); |
indices = indexStorage.get(); |
- this->drawVertices(d, SkCanvas::kTriangles_VertexMode, vertCount, verts, texs, colors, xfer, |
+ this->drawVertices(d, SkCanvas::kTriangles_VertexMode, vertCount, verts, texs, vertCols, xfer, |
eseidel
2015/07/24 17:22:44
so vertCols is 4x the size of colors, right? Was
robertphillips
2015/07/24 17:55:50
Yep - that resulted in the flickering.
|
indices, indexCount, p); |
} |