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

Unified Diff: include/codec/SkCodec.h

Issue 2335203002: Implement Fill() for incomplete decodes to RGBA_F16 (Closed)
Patch Set: Created 4 years, 3 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: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index bee4f3c9107ec7c749c6a6033766351a51171960..57a0d8879fcc9c0336ec8d08a891ba5a69bbd6a4 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -601,15 +601,15 @@ 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);
}
/**
@@ -617,14 +617,13 @@ protected:
* types that we support. Note that for color types that do not use the full 32-bits,
* we will simply take the low bits of the fill value.
*
+ * kRGBA_F16_SkColorType: Transparent or Black, depending on the src alpha type
reed1 2016/09/13 14:41:29 Is this list your "default" values? Not clear from
msarett 2016/09/13 14:47:24 Improving comments.
* 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
« no previous file with comments | « gyp/codec_android.gyp ('k') | src/codec/SkBmpStandardCodec.h » ('j') | src/codec/SkSampler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698