From 30bcf3718ace8f0ab46be60f318b476b658217b2 Mon Sep 17 00:00:00 2001 From: "glen@chromium.org" Date: Sat, 25 Jul 2009 02:07:00 +0000 Subject: Attempt to fix the ImageOperations::CreateMaskedBitmap UMR by bringing the unittest code in line with the other tests in image_operations_unittest. My half-educated suspicion is that alpha wasn't getting initted correctly, as a new UMR appeared in the "SkColor alpha_pixel = " line. (Can't verify as all my machines are in boxes). (This is TBR because the build is red). TBR=tony BUG=15762 TEST=Run valgrind/purify as in bug Review URL: http://codereview.chromium.org/159381 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21610 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 9b0beb1..a86f99e 100644 --- a/skia/ext/image_operations.cc +++ b/skia/ext/image_operations.cc @@ -388,12 +388,12 @@ SkBitmap ImageOperations::CreateMaskedBitmap(const SkBitmap& rgb, SkAutoLockPixels lock_alpha(alpha); SkAutoLockPixels lock_masked(masked); - for (int y = 0; y < rgb.height(); y++) { + for (int y = 0; y < masked.height(); y++) { uint32* rgb_row = rgb.getAddr32(0, y); uint32* alpha_row = alpha.getAddr32(0, y); uint32* dst_row = masked.getAddr32(0, y); - for (int x = 0; x < rgb.width(); x++) { + for (int x = 0; x < masked.width(); x++) { uint32 alpha_pixel = alpha_row[x]; SkColor rgb_pixel = SkUnPreMultiply::PMColorToColor(rgb_row[x]); -- cgit v1.1