aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/codec
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-09-13 09:04:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-13 09:04:11 -0700
commitf7eb6fc71abd7649d65a877e7a10d1060afc0c88 (patch)
tree873bfaad147f112a8963a016c0cf640faeafde4c /include/codec
parentf06e5183004fb3c43b6cc4cb3b4140443d99b8e6 (diff)
Implement Fill() for incomplete decodes to RGBA_F16
Before this patch, we would hit an SkASSERT(false). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335203002 Review-Url: https://codereview.chromium.org/2335203002
Diffstat (limited to 'include/codec')
-rw-r--r--include/codec/SkCodec.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index bee4f3c910..b0647edc6f 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -601,30 +601,30 @@ protected:
* On an incomplete input, getPixels() and getScanlines() will fill any uninitialized
* scanlines. This allows the subclass to indicate what value to fill with.
*
- * @param colorType Destination color type.
+ * @param dstInfo Describes the destination.
* @return The value with which to fill uninitialized pixels.
*
- * Note that we can interpret the return value as an SkPMColor, a 16-bit 565 color,
- * an 8-bit gray color, or an 8-bit index into a color table, depending on the color
- * type.
+ * Note that we can interpret the return value as a 64-bit Float16 color, a SkPMColor,
+ * a 16-bit 565 color, an 8-bit gray color, or an 8-bit index into a color table,
+ * depending on the color type.
*/
- uint32_t getFillValue(SkColorType colorType) const {
- return this->onGetFillValue(colorType);
+ uint64_t getFillValue(const SkImageInfo& dstInfo) const {
+ return this->onGetFillValue(dstInfo);
}
/**
* Some subclasses will override this function, but this is a useful default for the color
- * types that we support. Note that for color types that do not use the full 32-bits,
+ * types that we support. Note that for color types that do not use the full 64-bits,
* we will simply take the low bits of the fill value.
*
+ * The defaults are:
+ * kRGBA_F16_SkColorType: Transparent or Black, depending on the src alpha type
* kN32_SkColorType: Transparent or Black, depending on the src alpha type
* kRGB_565_SkColorType: Black
* kGray_8_SkColorType: Black
* kIndex_8_SkColorType: First color in color table
*/
- virtual uint32_t onGetFillValue(SkColorType /*colorType*/) const {
- return kOpaque_SkAlphaType == fSrcInfo.alphaType() ? SK_ColorBLACK : SK_ColorTRANSPARENT;
- }
+ virtual uint64_t onGetFillValue(const SkImageInfo& dstInfo) const;
/**
* Get method for the input stream