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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 292943002: fix the visual diff of raster vs gpu -- vertices_80 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update ignored-tests.txt Created 6 years, 7 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 | « expectations/gm/ignored-tests.txt ('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 ec471ecc681188041ee0fc13d69efaa256020b23..431238b9db27f2350334fb879e1be650e849ac92 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1649,8 +1649,13 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
if (NULL != colors) {
// need to convert byte order and from non-PM to PM
convertedColors.reset(vertexCount);
+ SkColor color;
for (int i = 0; i < vertexCount; ++i) {
- convertedColors[i] = SkColor2GrColor(colors[i]);
+ color = colors[i];
+ if (paint.getAlpha() != 255) {
+ color = SkColorSetA(color, SkMulDiv255Round(SkColorGetA(color), paint.getAlpha()));
+ }
+ convertedColors[i] = SkColor2GrColor(color);
}
colors = convertedColors.get();
}
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698