diff options
author | reed <reed@google.com> | 2014-06-17 08:38:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-17 08:38:31 -0700 |
commit | c3b3266b7db2f1a41d41ecac010c766b7ad8eebc (patch) | |
tree | c45d9892b2ac00bfe74f322eafb6e68d8121a9ea /src/images | |
parent | a272d6d0653620cb6b683a70d3e6993d380147d9 (diff) |
hide SkBitmap::Config entirely (behind a flag)
patch from issue 339463002
TBR=
I think the NoGPU failure is unrelated, so ignoring
NOTRY=True
Author: reed@google.com
Review URL: https://codereview.chromium.org/340533002
Diffstat (limited to 'src/images')
-rw-r--r-- | src/images/SkImageDecoder.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp index b124187505..fe61906357 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; } |