Index: src/codec/SkSampler.h |
diff --git a/src/codec/SkSampler.h b/src/codec/SkSampler.h |
index d7b4c98f235ad1ccb15afa7ff77997aa6d621372..1e7659e9e8623aade960dc388baec4ce09ebb51e 100644 |
--- a/src/codec/SkSampler.h |
+++ b/src/codec/SkSampler.h |
@@ -19,8 +19,49 @@ public: |
return this->onSetSampleX(sampleX); |
} |
+ /** |
+ * Fill the remainder of the destination with a single color |
+ * |
+ * @param dst |
+ * The destination row to fill from. |
+ * |
+ * @param colorType |
+ * The color type of the rows to fill. |
+ * |
+ * @param numRows |
+ * The number of rows that we need to fill. |
+ * |
+ * @param rowBytes |
+ * Stride in bytes of the destination. |
+ * |
+ * @param colorOrIndex |
+ * If colorType is kN32, colorOrIndex is treated as a 32-bit color. |
+ * If colorType is k565, colorOrIndex is treated as a 16-bit color. |
+ * If colorType is kGray, colorOrIndex is treated as an 8-bit color. |
+ * If colorType is kIndex, colorOrIndex is treated as an 8-bit index. |
+ * Other SkColorTypes are not supported. |
+ * |
+ * @param zeroInit |
+ * Indicates whether memory is already zero initialized. |
+ * |
+ */ |
+ void fill(void* dst, SkColorType colorType, int numRows, size_t rowBytes, uint32_t colorOrIndex, |
+ SkCodec::ZeroInitialized zeroInit); |
+ |
virtual ~SkSampler() {} |
private: |
+ /** |
+ * Get the the scaled width of the image. |
+ * |
+ * SkSampler needs the scaled width to fill uninitialized memory in |
+ * incomplete images. |
+ */ |
+ int getScaledWidth() { |
+ return this->onGetScaledWidth(); |
+ } |
+ |
+ virtual int onGetScaledWidth() = 0; |
+ |
virtual int onSetSampleX(int) = 0; |
}; |