Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: ui/gfx/codec/png_codec_unittest.cc

Issue 10831031: Fix the PNCodec error on Android caused by different Skia color format. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix the test case Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gtest_filter/ui_unittests_disabled ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/codec/png_codec_unittest.cc
diff --git a/ui/gfx/codec/png_codec_unittest.cc b/ui/gfx/codec/png_codec_unittest.cc
index f73aa49eb3f9e529504a1fab8ab10af771390db8..83f535e6ae3e4d7a0180b516ca5cbda7516d34b1 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) << ")";
}
}
}
« no previous file with comments | « build/android/gtest_filter/ui_unittests_disabled ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698