Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1397)

Unified Diff: tools/SkBitmapRegionCanvas.h

Issue 1418093006: Refactor SkBitmapRegionDecoderInterface for Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/SkBitmapRegionCanvas.h
diff --git a/tools/SkBitmapRegionCanvas.h b/tools/SkBitmapRegionCanvas.h
index f82e9fa77a941b01dee6d746d2a2fb02006ea40e..ba3fa4563d947d14e6bb098c942b4f1846ced230 100644
--- a/tools/SkBitmapRegionCanvas.h
+++ b/tools/SkBitmapRegionCanvas.h
@@ -24,22 +24,24 @@ public:
*/
SkBitmapRegionCanvas(SkCodec* decoder);
- /*
- * 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<SkCodec> fDecoder;
+ // Fields set by prepareRegion()
+ int fOutX; // Offset of decoded pixels in output bitmap
+ int fOutY; // Offset of decoded pixels in output bitmap
+ SkImageInfo fOutInfo; // Image properties for output bitmap
+ SkImageInfo fDecodeInfo; // Image properties for fDecoder
+ int fSampleSize; // Integer downscale factor
+ SkIRect fSubset; // Subset of the original image to decode
+ SubsetType fSubsetType;
+
typedef SkBitmapRegionDecoderInterface INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698