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

Unified Diff: src/images/SkImageEncoder_argb.cpp

Issue 338493005: stop using SkBitmap::Config (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
Index: src/images/SkImageEncoder_argb.cpp
diff --git a/src/images/SkImageEncoder_argb.cpp b/src/images/SkImageEncoder_argb.cpp
index 97b741b8bf1d1717c31397f25e58ce6482a6ac59..296491eef81864ce0c7f48ec0af7b99c1f25f7be 100644
--- a/src/images/SkImageEncoder_argb.cpp
+++ b/src/images/SkImageEncoder_argb.cpp
@@ -71,15 +71,15 @@ static void Index8_To_ARGB(const uint8_t* in, uint8_t* argb, int width,
}
}
-static ScanlineImporter ChooseImporter(const SkBitmap::Config& config) {
- switch (config) {
- case SkBitmap::kARGB_8888_Config:
+static ScanlineImporter ChooseImporter(SkColorType ct) {
+ switch (ct) {
+ case kN32_SkColorType:
return ARGB_8888_To_ARGB;
- case SkBitmap::kRGB_565_Config:
+ case kRGB_565_SkColorType:
return RGB_565_To_ARGB;
- case SkBitmap::kARGB_4444_Config:
+ case kARGB_4444_SkColorType:
return ARGB_4444_To_ARGB;
- case SkBitmap::kIndex8_Config:
+ case kIndex_8_SkColorType:
return Index8_To_ARGB;
default:
return NULL;
@@ -87,8 +87,7 @@ static ScanlineImporter ChooseImporter(const SkBitmap::Config& config) {
}
bool SkARGBImageEncoder::onEncode(SkWStream* stream, const SkBitmap& bitmap, int) {
- const SkBitmap::Config config = bitmap.config();
- const ScanlineImporter scanline_import = ChooseImporter(config);
+ const ScanlineImporter scanline_import = ChooseImporter(bitmap.colorType());
if (NULL == scanline_import) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698