Commit f522a1e5 authored by shouqun.liu@intel.com's avatar shouqun.liu@intel.com

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
parent 98df4beb
......@@ -27,7 +27,6 @@ FontTest.LoadArialBold
FontTest.Widths
ImageTest.CheckSkiaColor
L10nUtilTest.GetAppLocale
PNGCodec.EncodeBGRASkBitmapDiscardTransparency
SkBitmapOperationsTest.CreateHSLShiftedBitmapHueOnly
SkBitmapOperationsTest.UnPreMultiply
L10nUtilTest.GetDisplayNameForCountry
......
......@@ -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) << ")";
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment