diff options
author | shouqun.liu@intel.com <shouqun.liu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 17:02:17 +0000 |
---|---|---|
committer | shouqun.liu@intel.com <shouqun.liu@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 17:02:17 +0000 |
commit | f522a1e58aa0573a1d7a6c82aa87720c32539878 (patch) | |
tree | 591f3669ee0c7cd5b97ca455879a130522213f64 /ui/gfx/codec | |
parent | 98df4beb506b39c1f405daf90837b67016eb307b (diff) | |
download | chromium_src-f522a1e58aa0573a1d7a6c82aa87720c32539878.zip chromium_src-f522a1e58aa0573a1d7a6c82aa87720c32539878.tar.gz chromium_src-f522a1e58aa0573a1d7a6c82aa87720c32539878.tar.bz2 |
Fix the PNCodec error on Android caused by different Skia color format.
Make sure the test case to compare SkPMColor between SkPMColor, rather than SkColor.
BUG=138933
TEST=ui_unittests --gtest_filter=PNGCodec.EncodeBGRASkBitmapDiscardTransparency
Review URL: https://chromiumcodereview.appspot.com/10831031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149208 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/codec')
-rw-r--r-- | ui/gfx/codec/png_codec_unittest.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/gfx/codec/png_codec_unittest.cc b/ui/gfx/codec/png_codec_unittest.cc index f73aa49..83f535e 100644 --- a/ui/gfx/codec/png_codec_unittest.cc +++ b/ui/gfx/codec/png_codec_unittest.cc @@ -1034,15 +1034,18 @@ TEST(PNGCodec, EncodeBGRASkBitmapDiscardTransparency) { uint32_t unpremultiplied = SkUnPreMultiply::PMColorToColor(original_pixel); uint32_t decoded_pixel = decoded_bitmap.getAddr32(0, y)[x]; - EXPECT_TRUE(NonAlphaColorsClose(unpremultiplied, decoded_pixel)) + uint32_t unpremultiplied_decoded = + SkUnPreMultiply::PMColorToColor(decoded_pixel); + + EXPECT_TRUE(NonAlphaColorsClose(unpremultiplied, unpremultiplied_decoded)) << "Original_pixel: (" << SkColorGetR(unpremultiplied) << ", " << SkColorGetG(unpremultiplied) << ", " << SkColorGetB(unpremultiplied) << "), " << "Decoded pixel: (" - << SkColorGetR(decoded_pixel) << ", " - << SkColorGetG(decoded_pixel) << ", " - << SkColorGetB(decoded_pixel) << ")"; + << SkColorGetR(unpremultiplied_decoded) << ", " + << SkColorGetG(unpremultiplied_decoded) << ", " + << SkColorGetB(unpremultiplied_decoded) << ")"; } } } |