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

Unified Diff: src/codec/SkSwizzler.h

Issue 1055743003: Swizzler changes Index8 and 565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows errors Created 5 years, 8 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.cpp ('k') | src/codec/SkSwizzler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSwizzler.h
diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h
index 63afbf73bc3d75717f20dc8650f64e3f54d29425..6044c869d2362224960e3cad72e7a88f83f792a9 100644
--- a/src/codec/SkSwizzler.h
+++ b/src/codec/SkSwizzler.h
@@ -61,7 +61,7 @@ public:
static bool IsOpaque(ResultAlpha r) {
return kOpaque_ResultAlpha == r;
}
-
+
/*
*
* Constructs the proper result code based on accumulated alpha masks
@@ -128,6 +128,36 @@ public:
const SkImageInfo&, void* dst,
size_t dstRowBytes,
SkImageGenerator::ZeroInitialized);
+
+ /**
+ * Fill the remainder of the destination with a single color
+ *
+ * @param y
+ * The starting row for the fill.
+ *
+ * @param colorOrIndex
+ * @param colorTable
+ * If dstInfo.colorType() is kIndex8, colorOrIndex is assumed to be a uint8_t
+ * index, and colorTable is ignored. Each 8-bit pixel will be set to (uint8_t)
+ * index.
+ *
+ * If dstInfo.colorType() is kN32, colorOrIndex is treated differently depending on
+ * whether colorTable is NULL:
+ *
+ * A NULL colorTable means colorOrIndex is treated as an SkPMColor (premul or
+ * unpremul, depending on dstInfo.alphaType()). Each 4-byte pixel will be set to
+ * colorOrIndex.
+
+ * A non-NULL colorTable means colorOrIndex is treated as a uint8_t index into
+ * the colorTable. i.e. each 4-byte pixel will be set to
+ * colorTable[(uint8_t) colorOrIndex].
+ *
+ * Other SkColorTypes are not supported.
+ *
+ */
+ static void Fill(void* dst, const SkImageInfo& dstInfo, size_t dstRowBytes, uint32_t y,
+ uint32_t colorOrIndex, SkPMColor* colorTable);
+
/**
* Swizzle the next line. Call height times, once for each row of source.
* @param src The next row of the source data.
@@ -156,6 +186,7 @@ public:
* destination?
*/
void setDstRow(void* dst) { fDstRow = dst; }
+
private:
#ifdef SK_DEBUG
« no previous file with comments | « src/codec/SkMaskSwizzler.cpp ('k') | src/codec/SkSwizzler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698