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

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: Safe fill for unlikely values of row bytes and other minor fixes 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
Index: src/codec/SkSwizzler.h
diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h
index 63afbf73bc3d75717f20dc8650f64e3f54d29425..77d55075f4c1c902f0b573e00b6d12295704bed9 100644
--- a/src/codec/SkSwizzler.h
+++ b/src/codec/SkSwizzler.h
@@ -128,6 +128,27 @@ 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 input The value to fill with - may be a color or an index.
+ * It will be an index in the case where the encoded image was
+ * stored in an indexed format. If we are decoding to kIndex8
+ * we will fill with the index directly. If we are decoding to
+ * kN32, we will use the index to look up the color that we are
+ * to fill with. If the input is an index, it will be treated
+ * as a uint8_t.
+ * We recognize that the input is not an index if we are
+ * decoding to kN32 and the input color table is NULL. In this,
scroggo 2015/04/06 21:26:30 nit:comma not needed here.
msarett 2015/04/07 12:36:03 Done.
+ * case, we assume the input is an SkPMColor and fill with it
+ * directly.
+ * @param colorTable a non-NULL colorTable indicates that the input is an index
+ * even if the dst color type is not an index type
+ */
+ static void Fill(void* dst, const SkImageInfo& dstInfo, size_t dstRowBytes, uint32_t y,
+ uint32_t input, 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 +177,7 @@ public:
* destination?
*/
void setDstRow(void* dst) { fDstRow = dst; }
+
private:
#ifdef SK_DEBUG

Powered by Google App Engine
This is Rietveld 408576698