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

Unified Diff: src/codec/SkCodecPriv.h

Issue 2335203002: Implement Fill() for incomplete decodes to RGBA_F16 (Closed)
Patch Set: Fix win builds 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
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkGifCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodecPriv.h
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h
index 5845256457c10c8999879ae9c1641a62b90d3ea8..8876b72aa79bda11ca76b94d998ca671dbc4481c 100644
--- a/src/codec/SkCodecPriv.h
+++ b/src/codec/SkCodecPriv.h
@@ -9,6 +9,7 @@
#define SkCodecPriv_DEFINED
#include "SkColorPriv.h"
+#include "SkColorSpaceXform.h"
#include "SkColorTable.h"
#include "SkImageInfo.h"
#include "SkTypes.h"
@@ -146,8 +147,8 @@ static inline const SkPMColor* get_color_ptr(SkColorTable* colorTable) {
/*
* Given that the encoded image uses a color table, return the fill value
*/
-static inline uint32_t get_color_table_fill_value(SkColorType colorType, const SkPMColor* colorPtr,
- uint8_t fillIndex) {
+static inline uint64_t get_color_table_fill_value(SkColorType colorType, SkAlphaType alphaType,
+ const SkPMColor* colorPtr, uint8_t fillIndex, SkColorSpaceXform* colorXform) {
SkASSERT(nullptr != colorPtr);
switch (colorType) {
case kRGBA_8888_SkColorType:
@@ -157,6 +158,13 @@ static inline uint32_t get_color_table_fill_value(SkColorType colorType, const S
return SkPixel32ToPixel16(colorPtr[fillIndex]);
case kIndex_8_SkColorType:
return fillIndex;
+ case kRGBA_F16_SkColorType: {
+ SkASSERT(colorXform);
+ uint64_t dstColor;
+ uint32_t srcColor = colorPtr[fillIndex];
+ colorXform->apply(&dstColor, &srcColor, 1, colorType, alphaType);
+ return dstColor;
+ }
default:
SkASSERT(false);
return 0;
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkGifCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698