aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ARGBImageEncoderTest.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2014-06-09 19:52:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-09 19:52:07 -0700
commit6c22573edb234ad14df947278cfed010669a39a7 (patch)
treeede271bf82d823809c12d9b4ef3801dc7d6ddd73 /tests/ARGBImageEncoderTest.cpp
parent7c5c9da436194c75d91797f114a87a6119ca255d (diff)
hide SkBitmap::setConfig
patch from issue 325733002 TBR=scroggo Author: reed@chromium.org Review URL: https://codereview.chromium.org/322963002
Diffstat (limited to 'tests/ARGBImageEncoderTest.cpp')
-rw-r--r--tests/ARGBImageEncoderTest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/ARGBImageEncoderTest.cpp b/tests/ARGBImageEncoderTest.cpp
index 7101165547..18f315fca9 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);