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

Unified Diff: include/codec/SkScaledCodec.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 | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkScaledCodec.h
diff --git a/include/codec/SkScaledCodec.h b/include/codec/SkScaledCodec.h
index 028706bc9400bfb7028ba75699029d2454277484..5d0d8834c4e3df3e378a19abf07328357d55b1ca 100644
--- a/include/codec/SkScaledCodec.h
+++ b/include/codec/SkScaledCodec.h
@@ -22,7 +22,7 @@ public:
virtual ~SkScaledCodec();
- static void ComputeSampleSize(const SkISize& dstDim, const SkISize& srcDim,
+ static void ComputeSampleSize(const SkISize& dstSize, const SkISize& srcSize,
int* sampleSizeX, int* sampleSizeY);
protected:
@@ -34,6 +34,8 @@ protected:
SkISize onGetScaledDimensions(float desiredScale) const override;
bool onDimensionsSupported(const SkISize&) override;
+ bool onGetScaledSubsetDimensions(float desiredScale, Options* options) const override;
+
Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*, int*)
override;
SkEncodedFormat onGetEncodedFormat() const override {
@@ -50,6 +52,13 @@ protected:
private:
+ Result nativeDecode(const SkImageInfo& scaledInfo, void* dst, size_t rowBytes,
+ const SkIRect& scaledSubsetRect, ZeroInitialized zeroInit, int* rowsDecoded);
+
+ Result sampledDecode(const SkImageInfo& decodeInfo, void* dst, size_t rowBytes,
+ const SkIRect& subsetRect, const SkIRect& scaledSubsetRect, int sampleX, int sampleY,
+ ZeroInitialized zeroInit, int* rowsDecoded);
+
SkAutoTDelete<SkCodec> fCodec;
explicit SkScaledCodec(SkCodec*);
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698