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

Unified Diff: src/codec/SkSwizzler.h

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix sample function for 565 images Created 5 years, 5 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 76ca74877a391c9670ef8f71d68a8ed8ad131e52..8d9ea83cc2321b606ba63898496d3c9aa91ee9f1 100644
--- a/src/codec/SkSwizzler.h
+++ b/src/codec/SkSwizzler.h
@@ -115,16 +115,18 @@ public:
/**
* Create a new SkSwizzler.
* @param SrcConfig Description of the format of the source.
- * @param SkImageInfo dimensions() describe both the src and the dst.
- * Other fields describe the dst.
+ * @param dstInfo describes the destination.
* @param ZeroInitialized Whether dst is zero-initialized. The
implementation may choose to skip writing zeroes
* if set to kYes_ZeroInitialized.
+ * @param srcWidth is the width of the source. Used to calculate the width samplesize.
+ * Width sampling is supported by the swizzler, by skipping pixels when swizzling the row.
scroggo 2015/07/31 19:31:58 Maybe this should also explain why we chose to sup
emmaleer 2015/07/31 20:43:10 Acknowledged.
+ * Height sampling is not supported by the swizzler, but is implemented in SkScaledCodec.
* @return A new SkSwizzler or NULL on failure.
*/
static SkSwizzler* CreateSwizzler(SrcConfig, const SkPMColor* ctable,
- const SkImageInfo&, SkCodec::ZeroInitialized);
-
+ const SkImageInfo& dstInfo, SkCodec::ZeroInitialized,
+ int srcWidth);
/**
* Fill the remainder of the destination with a single color
*
@@ -197,9 +199,10 @@ private:
// deltaSrc is bitsPerPixel
const SkImageInfo fDstInfo;
int fCurrY;
+ const int fX0; // first X coord to sample
+ const int fSampleX; // step between X samples
- SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc,
- const SkImageInfo& info);
-
+ SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, const SkImageInfo& info,
+ int sampleX);
};
#endif // SkSwizzler_DEFINED

Powered by Google App Engine
This is Rietveld 408576698