Index: tools/SkBitmapRegionCodec.h |
diff --git a/tools/SkBitmapRegionCodec.h b/tools/SkBitmapRegionCodec.h |
index 14d024ea4542ed8d5c49ff237644109858c05410..5ad1e5b60b25afc2848a36f35a89a0b2e9d32095 100644 |
--- a/tools/SkBitmapRegionCodec.h |
+++ b/tools/SkBitmapRegionCodec.h |
@@ -20,22 +20,25 @@ public: |
*/ |
SkBitmapRegionCodec(SkAndroidCodec* codec); |
- /* |
- * Three 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 |
- * sample size. |
- */ |
- SkBitmap* decodeRegion(int start_x, int start_y, int width, int height, |
- int sampleSize, SkColorType prefColorType) override; |
+ bool prepareRegion(const SkIRect& desiredSubset, int sampleSize, |
+ SkColorType colorType, bool requireUnpremul, SkImageInfo* outSize) override; |
- bool conversionSupported(SkColorType colorType) override; |
+ bool decodeRegion(SkBitmap& bitmap) override; |
private: |
SkAutoTDelete<SkAndroidCodec> fCodec; |
+ |
+ // Fields set by prepareRegion() |
+ int fScaledOutX; // Offset of decoded pixels in output bitmap |
+ int fScaledOutY; // Offset of decoded pixels in output bitmap |
+ SkImageInfo fOutInfo; // Image properties for output bitmap |
+ SkImageInfo fDecodeInfo; // Image properties for fCodec |
+ int fSampleSize; // Integer downscale factor |
+ SkIRect fSubset; // Subset of the original image to decode |
+ SubsetType fSubsetType; |
+ |
typedef SkBitmapRegionDecoderInterface INHERITED; |
}; |