From 29acfb3095a9e484443ffc149d43908ecb17f42f Mon Sep 17 00:00:00 2001 From: "glen@chromium.org" Date: Sat, 25 Jul 2009 01:28:50 +0000 Subject: 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 --- skia/ext/image_operations.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'skia/ext/image_operations.cc') 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), -- cgit v1.1