summaryrefslogtreecommitdiffstats
path: root/skia/ext/image_operations.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-25 01:28:50 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-25 01:28:50 +0000
commit29acfb3095a9e484443ffc149d43908ecb17f42f (patch)
tree3580cea2099fc7bd286a97d31508a54749f5df89 /skia/ext/image_operations.cc
parent57abdc68e5759f837c36add4ca6bbeff6ba88198 (diff)
downloadchromium_src-29acfb3095a9e484443ffc149d43908ecb17f42f.zip
chromium_src-29acfb3095a9e484443ffc149d43908ecb17f42f.tar.gz
chromium_src-29acfb3095a9e484443ffc149d43908ecb17f42f.tar.bz2
Our masker didn't account for the source image also having alpha.
BUG=17568 TEST=none Review URL: http://codereview.chromium.org/160034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21606 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations.cc')
-rw-r--r--skia/ext/image_operations.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index ff16fe5..9b0beb1 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -395,9 +395,9 @@ SkBitmap ImageOperations::CreateMaskedBitmap(const SkBitmap& rgb,
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),