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

Unified Diff: tools/SkBitmapRegionCodec.h

Issue 1321433002: Add subsetting to SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@gif-scan
Patch Set: Rebase - it compiles but I'm sure everything is broken 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
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/SkBitmapRegionCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/SkBitmapRegionCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698