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

Unified Diff: src/images/SkImageDecoder.cpp

Issue 483593002: eliminate code related to SkBitmap::Config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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') | no next file » | 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 0e2018c11768c9a646926f354aba0eb1ad7f3d1e..ed2ad164a11aea72d8b171b42c084fb813eeb1aa 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -24,9 +24,6 @@ SkImageDecoder::SkImageDecoder()
, fDefaultPref(kUnknown_SkColorType)
, fPreserveSrcDepth(false)
, fDitherImage(true)
-#ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG
- , fUsePrefTable(false)
-#endif
, fSkipWritingZeroes(false)
, fPreferQualityOverSpeed(false)
, fRequireUnpremultipliedColors(false) {
@@ -50,13 +47,6 @@ 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->setPreserveSrcDepth(fPreserveSrcDepth);
other->setDitherImage(fDitherImage);
other->setSkipWritingZeroes(fSkipWritingZeroes);
@@ -148,38 +138,8 @@ 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.
- SkBitmap::Config config = SkBitmap::kNo_Config;
- switch (srcDepth) {
- case kIndex_SrcDepth:
- config = srcHasAlpha ? fPrefTable.fPrefFor_8Index_YesAlpha_src
- : fPrefTable.fPrefFor_8Index_NoAlpha_src;
- break;
- case k8BitGray_SrcDepth:
- config = fPrefTable.fPrefFor_8Gray_src;
- break;
- case k32Bit_SrcDepth:
- config = srcHasAlpha ? fPrefTable.fPrefFor_8bpc_YesAlpha_src
- : fPrefTable.fPrefFor_8bpc_NoAlpha_src;
- break;
- }
- // now return to SkColorType land
- ct = SkBitmapConfigToColorType(config);
- }
-#endif
if (fPreserveSrcDepth) {
switch (srcDepth) {
case kIndex_SrcDepth:
« no previous file with comments | « src/image/SkImagePriv.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698