| Index: src/images/SkImageDecoder.cpp
|
| diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
|
| index 60cc44c5b4263f15fe58198cba6fc691608a9a19..d2ad553769b3100427b79325b54910d6786b79e3 100644
|
| --- a/src/images/SkImageDecoder.cpp
|
| +++ b/src/images/SkImageDecoder.cpp
|
| @@ -142,76 +142,6 @@ SkImageDecoder::Result SkImageDecoder::decode(SkStream* stream, SkBitmap* bm, Sk
|
| return result;
|
| }
|
|
|
| -bool SkImageDecoder::decodeSubset(SkBitmap* bm, const SkIRect& rect, SkColorType pref) {
|
| - // we reset this to false before calling onDecodeSubset
|
| - fShouldCancelDecode = false;
|
| - // assign this, for use by getPrefColorType(), in case fUsePrefTable is false
|
| - fDefaultPref = pref;
|
| -
|
| - return this->onDecodeSubset(bm, rect);
|
| -}
|
| -
|
| -bool SkImageDecoder::buildTileIndex(SkStreamRewindable* stream, int *width, int *height) {
|
| - // we reset this to false before calling onBuildTileIndex
|
| - fShouldCancelDecode = false;
|
| -
|
| - return this->onBuildTileIndex(stream, width, height);
|
| -}
|
| -
|
| -bool SkImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int* /*width*/,
|
| - int* /*height*/) {
|
| - delete stream;
|
| - return false;
|
| -}
|
| -
|
| -
|
| -bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize,
|
| - int dstX, int dstY, int width, int height,
|
| - int srcX, int srcY) {
|
| - int w = width / sampleSize;
|
| - int h = height / sampleSize;
|
| - if (src->colorType() == kIndex_8_SkColorType) {
|
| - // kIndex8 does not allow drawing via an SkCanvas, as is done below.
|
| - // Instead, use extractSubset. Note that this shares the SkPixelRef and
|
| - // SkColorTable.
|
| - // FIXME: Since src is discarded in practice, this holds on to more
|
| - // pixels than is strictly necessary. Switch to a copy if memory
|
| - // savings are more important than speed here. This also means
|
| - // that the pixels in dst can not be reused (though there is no
|
| - // allocation, which was already done on src).
|
| - int x = (dstX - srcX) / sampleSize;
|
| - int y = (dstY - srcY) / sampleSize;
|
| - SkIRect subset = SkIRect::MakeXYWH(x, y, w, h);
|
| - return src->extractSubset(dst, subset);
|
| - }
|
| - // if the destination has no pixels then we must allocate them.
|
| - if (dst->isNull()) {
|
| - dst->setInfo(src->info().makeWH(w, h));
|
| -
|
| - if (!this->allocPixelRef(dst, nullptr)) {
|
| - SkDEBUGF(("failed to allocate pixels needed to crop the bitmap"));
|
| - return false;
|
| - }
|
| - }
|
| - // check to see if the destination is large enough to decode the desired
|
| - // region. If this assert fails we will just draw as much of the source
|
| - // into the destination that we can.
|
| - if (dst->width() < w || dst->height() < h) {
|
| - SkDEBUGF(("SkImageDecoder::cropBitmap does not have a large enough bitmap.\n"));
|
| - }
|
| -
|
| - // Set the Src_Mode for the paint to prevent transparency issue in the
|
| - // dest in the event that the dest was being re-used.
|
| - SkPaint paint;
|
| - paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
| -
|
| - SkCanvas canvas(*dst);
|
| - canvas.drawBitmap(*src, SkIntToScalar((srcX - dstX) / sampleSize),
|
| - SkIntToScalar((srcY - dstY) / sampleSize),
|
| - &paint);
|
| - return true;
|
| -}
|
| -
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| bool SkImageDecoder::DecodeFile(const char file[], SkBitmap* bm, SkColorType pref, Mode mode,
|
|
|