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

Unified Diff: src/codec/SkSampler.h

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use aligned memory in swizzler test 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 | « src/codec/SkMaskSwizzler.h ('k') | src/codec/SkSampler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSampler.h
diff --git a/src/codec/SkSampler.h b/src/codec/SkSampler.h
index d7b4c98f235ad1ccb15afa7ff77997aa6d621372..afabc1f9eb48be4676da33eb9eb60e0a837582af 100644
--- a/src/codec/SkSampler.h
+++ b/src/codec/SkSampler.h
@@ -19,8 +19,43 @@ public:
return this->onSetSampleX(sampleX);
}
+ /**
+ * Fill the remainder of the destination with a single color
+ *
+ * @param info
+ * Contains the color type of the rows to fill.
+ * Contains the width of the destination rows to fill
+ * Contains the number of rows that we need to fill.
+ *
+ * @param dst
+ * The destination row to fill from.
+ *
+ * @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.
+ *
+ */
+ static void Fill(const SkImageInfo& info, void* dst, size_t rowBytes,
+ uint32_t colorOrIndex, SkCodec::ZeroInitialized zeroInit);
+
+ /**
+ * Allow subclasses to implement unique versions of fill().
+ */
+ virtual void fill(const SkImageInfo& info, void* dst, size_t rowBytes,
+ uint32_t colorOrIndex, SkCodec::ZeroInitialized zeroInit) {}
+
virtual ~SkSampler() {}
private:
+
virtual int onSetSampleX(int) = 0;
};
« no previous file with comments | « src/codec/SkMaskSwizzler.h ('k') | src/codec/SkSampler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698