Index: tests/BitmapHasherTest.cpp |
diff --git a/tests/BitmapHasherTest.cpp b/tests/BitmapHasherTest.cpp |
index 2c1f4a39dfc5d501173ae704dba8b5e473c2f4b3..e39439a11f468170cf711d4c32f8d1a1a0f3e945 100644 |
--- a/tests/BitmapHasherTest.cpp |
+++ b/tests/BitmapHasherTest.cpp |
@@ -15,12 +15,11 @@ |
typedef uint64_t checksum_result; |
// Fill in bitmap with test data. |
-static void CreateTestBitmap(SkBitmap &bitmap, SkBitmap::Config config, int width, int height, |
+static void CreateTestBitmap(SkBitmap* bitmap, int width, int height, |
SkColor color, skiatest::Reporter* reporter) { |
- bitmap.setConfig(config, width, height); |
- REPORTER_ASSERT(reporter, bitmap.allocPixels()); |
- bitmap.setAlphaType(kOpaque_SkAlphaType); |
- bitmap.eraseColor(color); |
+ SkImageInfo info = SkImageInfo::MakeN32(width, height, kOpaque_SkAlphaType); |
+ REPORTER_ASSERT(reporter, bitmap->allocPixels(info)); |
+ bitmap->eraseColor(color); |
} |
DEF_TEST(BitmapHasher, reporter) { |
@@ -28,15 +27,15 @@ DEF_TEST(BitmapHasher, reporter) { |
SkBitmap bitmap; |
uint64_t digest; |
// initial test case |
- CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 333, 555, SK_ColorBLUE, reporter); |
+ CreateTestBitmap(&bitmap, 333, 555, SK_ColorBLUE, reporter); |
REPORTER_ASSERT(reporter, SkBitmapHasher::ComputeDigest(bitmap, &digest)); |
REPORTER_ASSERT(reporter, digest == 0xfb2903562766ef87ULL); |
// same pixel data but different dimensions should yield a different checksum |
- CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 555, 333, SK_ColorBLUE, reporter); |
+ CreateTestBitmap(&bitmap, 555, 333, SK_ColorBLUE, reporter); |
REPORTER_ASSERT(reporter, SkBitmapHasher::ComputeDigest(bitmap, &digest)); |
REPORTER_ASSERT(reporter, digest == 0xfe04023fb97d0f61ULL); |
// same dimensions but different color should yield a different checksum |
- CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 555, 333, SK_ColorGREEN, reporter); |
+ CreateTestBitmap(&bitmap, 555, 333, SK_ColorGREEN, reporter); |
REPORTER_ASSERT(reporter, SkBitmapHasher::ComputeDigest(bitmap, &digest)); |
REPORTER_ASSERT(reporter, digest == 0x2423c51cad6d1edcULL); |
} |