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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1254943002: Fix Ganesh drawAtlas bug with quad colors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: expand GM to cover AA vs. non-AA Created 5 years, 5 months 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 | « gm/drawatlascolor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « gm/drawatlascolor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698