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

Unified Diff: src/images/SkImageDecoder_libbmp.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_ktx.cpp ('k') | src/images/SkImageDecoder_libgif.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libbmp.cpp
diff --git a/src/images/SkImageDecoder_libbmp.cpp b/src/images/SkImageDecoder_libbmp.cpp
index 34a88ac6b00c7a161b5fda7bcdf21ee1002f3779..f9dd2472a0b10b7a45db6e29ae12337f2ec84db4 100644
--- a/src/images/SkImageDecoder_libbmp.cpp
+++ b/src/images/SkImageDecoder_libbmp.cpp
@@ -123,18 +123,17 @@ bool SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
int width = callback.width();
int height = callback.height();
- SkBitmap::Config config = this->getPrefConfig(k32Bit_SrcDepth, false);
+ SkColorType colorType = this->getPrefColorType(k32Bit_SrcDepth, false);
// only accept prefConfig if it makes sense for us
- if (SkBitmap::kARGB_4444_Config != config &&
- SkBitmap::kRGB_565_Config != config) {
- config = SkBitmap::kARGB_8888_Config;
+ if (kARGB_4444_SkColorType != colorType && kRGB_565_SkColorType != colorType) {
+ colorType = kN32_SkColorType;
}
SkScaledBitmapSampler sampler(width, height, getSampleSize());
- bm->setConfig(config, sampler.scaledWidth(), sampler.scaledHeight(), 0,
- kOpaque_SkAlphaType);
+ bm->setInfo(SkImageInfo::Make(sampler.scaledWidth(), sampler.scaledHeight(),
+ colorType, kOpaque_SkAlphaType));
if (justBounds) {
return true;
« no previous file with comments | « src/images/SkImageDecoder_ktx.cpp ('k') | src/images/SkImageDecoder_libgif.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698