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

Unified Diff: skia/ext/image_operations.cc

Issue 160034: Our masker didn't account for the source image also having alpha.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | skia/ext/image_operations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/image_operations.cc
===================================================================
--- skia/ext/image_operations.cc (revision 21515)
+++ skia/ext/image_operations.cc (working copy)
@@ -395,9 +395,9 @@
for (int x = 0; x < rgb.width(); x++) {
uint32 alpha_pixel = alpha_row[x];
- uint32 rgb_pixel = rgb_row[x];
+ SkColor rgb_pixel = SkUnPreMultiply::PMColorToColor(rgb_row[x]);
- int alpha = SkColorGetA(alpha_pixel);
+ int alpha = SkAlphaMul(SkColorGetA(rgb_pixel), SkColorGetA(alpha_pixel));
dst_row[x] = SkColorSetARGB(alpha,
SkAlphaMul(SkColorGetR(rgb_pixel), alpha),
SkAlphaMul(SkColorGetG(rgb_pixel), alpha),
« no previous file with comments | « no previous file | skia/ext/image_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698