diff options
author | 2014-06-09 19:52:07 -0700 | |
---|---|---|
committer | 2014-06-09 19:52:07 -0700 | |
commit | 6c22573edb234ad14df947278cfed010669a39a7 (patch) | |
tree | ede271bf82d823809c12d9b4ef3801dc7d6ddd73 /src/images/SkScaledBitmapSampler.cpp | |
parent | 7c5c9da436194c75d91797f114a87a6119ca255d (diff) |
hide SkBitmap::setConfig
patch from issue 325733002
TBR=scroggo
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/322963002
Diffstat (limited to 'src/images/SkScaledBitmapSampler.cpp')
-rw-r--r-- | src/images/SkScaledBitmapSampler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/images/SkScaledBitmapSampler.cpp b/src/images/SkScaledBitmapSampler.cpp index ba8ce4614f..7fd8718beb 100644 --- a/src/images/SkScaledBitmapSampler.cpp +++ b/src/images/SkScaledBitmapSampler.cpp @@ -842,17 +842,23 @@ protected: void test_row_proc_choice(); void test_row_proc_choice() { + const SkColorType colorTypes[] = { + kAlpha_8_SkColorType, kIndex_8_SkColorType, kRGB_565_SkColorType, kARGB_4444_SkColorType, + kN32_SkColorType + }; + SkBitmap dummyBitmap; DummyDecoder dummyDecoder; size_t procCounter = 0; for (int sc = SkScaledBitmapSampler::kGray; sc <= SkScaledBitmapSampler::kRGB_565; ++sc) { - for (int c = SkBitmap::kA8_Config; c <= SkBitmap::kARGB_8888_Config; ++c) { + for (size_t c = 0; c < SK_ARRAY_COUNT(colorTypes); ++c) { for (int unpremul = 0; unpremul <= 1; ++unpremul) { for (int dither = 0; dither <= 1; ++dither) { // Arbitrary width/height/sampleSize to allow SkScaledBitmapSampler to // be considered valid. SkScaledBitmapSampler sampler(10, 10, 1); - dummyBitmap.setConfig((SkBitmap::Config) c, 10, 10); + dummyBitmap.setInfo(SkImageInfo::Make(10, 10, + colorTypes[c], kPremul_SkAlphaType)); dummyDecoder.setDitherImage(SkToBool(dither)); dummyDecoder.setRequireUnpremultipliedColors(SkToBool(unpremul)); sampler.begin(&dummyBitmap, (SkScaledBitmapSampler::SrcConfig) sc, |