From a9d9a392380952006303d83c35a63a32dffd0b36 Mon Sep 17 00:00:00 2001 From: kkinnunen Date: Fri, 6 Mar 2015 07:16:00 -0800 Subject: Read pixels in BGRA non-premul mode in few tests The tests assert on Sk_ColorGREEN, which is in BRGA non-premul. Read the pixels in same color format. Currently the tests pass on all platforms because GREEN is fully opaque and the component stays in the same place both on BGRA and RGBA. However, hypothetically somebody could copy-paste the assertion for further tests but use, say, RED. This creates latent error that is only visible on some platforms like mac. Review URL: https://codereview.chromium.org/989463002 --- tests/SkImageTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/SkImageTest.cpp') diff --git a/tests/SkImageTest.cpp b/tests/SkImageTest.cpp index 80ba776af1..3ba63b4258 100644 --- a/tests/SkImageTest.cpp +++ b/tests/SkImageTest.cpp @@ -38,7 +38,7 @@ DEF_TEST(SkImageFromBitmap_extractSubset, reporter) { canvas.drawImage(image, 0, 0, NULL); uint32_t pixel = 0; - SkImageInfo info = SkImageInfo::MakeN32Premul(1, 1); + SkImageInfo info = SkImageInfo::Make(1, 1, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType); canvas.readPixels(info, &pixel, 4, 0, 0); REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN); canvas.readPixels(info, &pixel, 4, gWidth - 6, gWidth - 6); -- cgit v1.2.3