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

Unified Diff: src/codec/SkSwizzler.h

Issue 1321433002: Add subsetting to SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@gif-scan
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: src/codec/SkSwizzler.h
diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h
index 9cd1d2092e15fb3dae89a21348bcbb5b2a1e4769..90da06549c2d1baa5eda9cb4d3bd41e29982255a 100644
--- a/src/codec/SkSwizzler.h
+++ b/src/codec/SkSwizzler.h
@@ -119,20 +119,22 @@ public:
* @param SrcConfig Description of the format of the source.
* @param dstInfo describes the destination.
* @param ZeroInitialized Whether dst is zero-initialized. The
- implementation may choose to skip writing zeroes
+ * implementation may choose to skip writing zeroes
* if set to kYes_ZeroInitialized.
* @param srcInfo is the info of the source. Used to calculate the width samplesize.
- * Width sampling is supported by the swizzler, by skipping pixels when
- swizzling the row. Height sampling is not supported by the swizzler,
- but is implemented in SkScaledCodec.
- Sampling in Y can be done by a client with a scanline decoder,
- but sampling in X allows the swizzler to skip swizzling pixels and
- reading from and writing to memory.
+ * Width sampling is supported by the swizzler, by skipping pixels when
+ * swizzling the row. Height sampling is not supported by the swizzler,
+ * but is implemented in SkScaledCodec.
+ * Sampling in Y can be done by a client with a scanline decoder,
+ * but sampling in X allows the swizzler to skip swizzling pixels and
+ * reading from and writing to memory.
+ * @param subsetLeft the left offset on the src for each row swizzle.
+ * @param subsetWidth the width of each swizzle in destination pixels.
* @return A new SkSwizzler or nullptr on failure.
*/
static SkSwizzler* CreateSwizzler(SrcConfig, const SkPMColor* ctable,
const SkImageInfo& dstInfo, SkCodec::ZeroInitialized,
- const SkImageInfo& srcInfo);
+ const SkImageInfo& srcInfo, int subsetLeft, int subsetWidth);
/**
* Fill the remainder of the destination with a single color
*
@@ -197,16 +199,14 @@ private:
const RowProc fRowProc;
const SkPMColor* fColorTable; // Unowned pointer
- const int fDeltaSrc; // if bitsPerPixel % 8 == 0
- // deltaSrc is bytesPerPixel
+ const int fLeft;
+ const int fWidth;
+ const int fBPP; // if bitsPerPixel % 8 == 0
+ // fBPP is bytesPerPixel
// else
- // deltaSrc is bitsPerPixel
- const SkImageInfo fDstInfo;
- int fCurrY;
- const int fX0; // first X coord to sample
- const int fSampleX; // step between X samples
+ // fBPP is bitsPerPixel
+ const int fDeltaSrc; // fBPP * sampleX
- SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, const SkImageInfo& info,
- int sampleX);
+ SkSwizzler(RowProc proc, const SkPMColor* ctable, int left, int width, int bpp, int deltaSrc);
};
#endif // SkSwizzler_DEFINED

Powered by Google App Engine
This is Rietveld 408576698