diff options
author | msarett <msarett@google.com> | 2016-05-18 06:23:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-18 06:23:57 -0700 |
commit | d1227a7417922ce26252d55815d0d1e98f0eb070 (patch) | |
tree | e6aa4536de96410f69247c4b3e72e8cab09429ff /src/android/SkBitmapRegionDecoder.cpp | |
parent | 4803f9715ff02b54a8ebae24167c490181d7cc3f (diff) |
Delete SkBitmapRegionCanvas
This was an approach we considered for implementing Android's
BitmapRegionDecoder.
It was useful for testing and comparison, but now is no longer worth
maintaining and testing.
The approach to subset/scaled decodes (clipped decode, then scale)
may be worth reconsidering at some point.
BUG=skia:5307
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1990543002
Review-Url: https://codereview.chromium.org/1990543002
Diffstat (limited to 'src/android/SkBitmapRegionDecoder.cpp')
-rw-r--r-- | src/android/SkBitmapRegionDecoder.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/android/SkBitmapRegionDecoder.cpp b/src/android/SkBitmapRegionDecoder.cpp index 101efbda45..324d1be4a4 100644 --- a/src/android/SkBitmapRegionDecoder.cpp +++ b/src/android/SkBitmapRegionDecoder.cpp @@ -5,7 +5,6 @@ * found in the LICENSE file. */ -#include "SkBitmapRegionCanvas.h" #include "SkBitmapRegionCodec.h" #include "SkBitmapRegionDecoder.h" #include "SkAndroidCodec.h" @@ -22,32 +21,6 @@ SkBitmapRegionDecoder* SkBitmapRegionDecoder::Create( SkStreamRewindable* stream, Strategy strategy) { SkAutoTDelete<SkStreamRewindable> streamDeleter(stream); switch (strategy) { - case kCanvas_Strategy: { - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(streamDeleter.release())); - if (nullptr == codec) { - SkCodecPrintf("Error: Failed to create decoder.\n"); - return nullptr; - } - - SkEncodedFormat format = codec->getEncodedFormat(); - switch (format) { - case SkEncodedFormat::kJPEG_SkEncodedFormat: - case SkEncodedFormat::kPNG_SkEncodedFormat: - break; - default: - // FIXME: Support webp using a special case. Webp does not support - // scanline decoding. - return nullptr; - } - - // If the image is a jpeg or a png, the scanline ordering should always be - // kTopDown or kNone. It is relevant to check because this implementation - // only supports these two scanline orderings. - SkASSERT(SkCodec::kTopDown_SkScanlineOrder == codec->getScanlineOrder() || - SkCodec::kNone_SkScanlineOrder == codec->getScanlineOrder()); - - return new SkBitmapRegionCanvas(codec.release()); - } case kAndroidCodec_Strategy: { SkAutoTDelete<SkAndroidCodec> codec = SkAndroidCodec::NewFromStream(streamDeleter.release()); |