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

Unified Diff: src/images/SkImageDecoder.cpp

Issue 340533002: hide SkBitmap::Config entirely (behind a flag) (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/image/SkImagePriv.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder.cpp
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index b12418750525f6d6dd9704752fd90873899c3247..fe61906357d43bd88bb52299dbeb903a4d60f90e 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -23,7 +23,9 @@ SkImageDecoder::SkImageDecoder()
, fSampleSize(1)
, fDefaultPref(kUnknown_SkColorType)
, fDitherImage(true)
+#ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG
, fUsePrefTable(false)
+#endif
, fSkipWritingZeroes(false)
, fPreferQualityOverSpeed(false)
, fRequireUnpremultipliedColors(false) {
@@ -47,11 +49,13 @@ void SkImageDecoder::copyFieldsToOther(SkImageDecoder* other) {
#endif
other->setAllocator(fAllocator);
other->setSampleSize(fSampleSize);
+#ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG
if (fUsePrefTable) {
other->setPrefConfigTable(fPrefTable);
} else {
other->fDefaultPref = fDefaultPref;
}
+#endif
other->setDitherImage(fDitherImage);
other->setSkipWritingZeroes(fSkipWritingZeroes);
other->setPreferQualityOverSpeed(fPreferQualityOverSpeed);
@@ -140,15 +144,18 @@ bool SkImageDecoder::allocPixelRef(SkBitmap* bitmap,
///////////////////////////////////////////////////////////////////////////////
+#ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG
void SkImageDecoder::setPrefConfigTable(const PrefConfigTable& prefTable) {
fUsePrefTable = true;
fPrefTable = prefTable;
}
+#endif
// TODO: use colortype in fPrefTable, fDefaultPref so we can stop using SkBitmapConfigToColorType()
//
SkColorType SkImageDecoder::getPrefColorType(SrcDepth srcDepth, bool srcHasAlpha) const {
SkColorType ct = fDefaultPref;
+#ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG
if (fUsePrefTable) {
// Until we kill or change the PrefTable, we have to go into Config land for a moment.
@@ -169,6 +176,7 @@ SkColorType SkImageDecoder::getPrefColorType(SrcDepth srcDepth, bool srcHasAlpha
// now return to SkColorType land
ct = SkBitmapConfigToColorType(config);
}
+#endif
return ct;
}
« no previous file with comments | « src/image/SkImagePriv.cpp ('k') | tests/KtxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698