Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1672)

Unified Diff: src/images/SkScaledBitmapSampler.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/images/SkImageDecoder_wbmp.cpp ('k') | src/ports/SkFontHost_FreeType_common.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkScaledBitmapSampler.cpp
diff --git a/src/images/SkScaledBitmapSampler.cpp b/src/images/SkScaledBitmapSampler.cpp
index ba8ce4614f8f8f226a1dc4dea70b66b150f283c8..7fd8718bebbc01705cbc800c938c4f16cfb68b38 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,
« no previous file with comments | « src/images/SkImageDecoder_wbmp.cpp ('k') | src/ports/SkFontHost_FreeType_common.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698