Index: tests/ARGBImageEncoderTest.cpp |
diff --git a/tests/ARGBImageEncoderTest.cpp b/tests/ARGBImageEncoderTest.cpp |
index 710116554721de8acbad8e5ea1d483e5c8c0af64..18f315fca9bf05a782120ecd8f151ccad784c61e 100644 |
--- a/tests/ARGBImageEncoderTest.cpp |
+++ b/tests/ARGBImageEncoderTest.cpp |
@@ -12,9 +12,9 @@ |
#include "SkStream.h" |
#include "Test.h" |
-static SkBitmap::Config configs[] = { |
- SkBitmap::kRGB_565_Config, |
- SkBitmap::kARGB_8888_Config, |
+static SkColorType gColorTypes[] = { |
+ kRGB_565_SkColorType, |
+ kN32_SkColorType, |
}; |
DEF_TEST(ARGBImageEncoder, reporter) { |
@@ -31,13 +31,13 @@ DEF_TEST(ARGBImageEncoder, reporter) { |
}; |
SkAutoTDelete<SkImageEncoder> enc(CreateARGBImageEncoder()); |
- for (size_t configIndex = 0; configIndex < SK_ARRAY_COUNT(configs); ++configIndex) { |
+ for (size_t ctIndex = 0; ctIndex < SK_ARRAY_COUNT(gColorTypes); ++ctIndex) { |
// A bitmap that should generate the above bytes: |
SkBitmap bitmap; |
{ |
- bitmap.setConfig(configs[configIndex], kWidth, kHeight); |
- REPORTER_ASSERT(reporter, bitmap.allocPixels()); |
- bitmap.setAlphaType(kOpaque_SkAlphaType); |
+ bool success = bitmap.allocPixels(SkImageInfo::Make(kWidth, kHeight, |
+ gColorTypes[ctIndex], kOpaque_SkAlphaType)); |
+ REPORTER_ASSERT(reporter, success); |
bitmap.eraseColor(SK_ColorBLUE); |
// Change rows [0,1] from blue to [red,green]. |
SkCanvas canvas(bitmap); |