| Index: tools/SkBitmapRegionCodec.h
|
| diff --git a/tools/SkBitmapRegionSampler.h b/tools/SkBitmapRegionCodec.h
|
| similarity index 62%
|
| copy from tools/SkBitmapRegionSampler.h
|
| copy to tools/SkBitmapRegionCodec.h
|
| index d2f738d3b5545d220c4d00cacf5f7ca855b30fd2..f51aeeb91497b914e0fec91e3f98ffc1f700c408 100644
|
| --- a/tools/SkBitmapRegionSampler.h
|
| +++ b/tools/SkBitmapRegionCodec.h
|
| @@ -7,23 +7,21 @@
|
|
|
| #include "SkBitmap.h"
|
| #include "SkBitmapRegionDecoderInterface.h"
|
| -#include "SkImageDecoder.h"
|
| -#include "SkTemplates.h"
|
| +#include "SkCodec.h"
|
|
|
| /*
|
| - * This class aims to duplicate the current implementation of
|
| - * SkBitmapRegionDecoder in Android.
|
| + * This class implements SkBitmapRegionDecoder using an SkScaledCodec.
|
| */
|
| -class SkBitmapRegionSampler : public SkBitmapRegionDecoderInterface {
|
| +class SkBitmapRegionCodec : public SkBitmapRegionDecoderInterface {
|
| public:
|
|
|
| /*
|
| - * Takes ownership of pointer to decoder
|
| + * Takes ownership of pointer to codec
|
| */
|
| - SkBitmapRegionSampler(SkImageDecoder* decoder, int width, int height);
|
| + SkBitmapRegionCodec(SkCodec* codec);
|
|
|
| /*
|
| - * Three differences from the Android version:
|
| + * Three key differences from the Android version:
|
| * Returns a Skia bitmap instead of an Android bitmap.
|
| * Android version attempts to reuse a recycled bitmap.
|
| * Removed the options object and used parameters for color type and
|
| @@ -32,9 +30,11 @@ public:
|
| SkBitmap* decodeRegion(int start_x, int start_y, int width, int height,
|
| int sampleSize, SkColorType prefColorType) override;
|
|
|
| + bool conversionSupported(SkColorType colorType) override;
|
| +
|
| private:
|
|
|
| - SkAutoTDelete<SkImageDecoder> fDecoder;
|
| + SkAutoTDelete<SkCodec> fCodec;
|
|
|
| typedef SkBitmapRegionDecoderInterface INHERITED;
|
|
|
|
|