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

Unified Diff: src/core/SkColorSpaceXform.h

Issue 2339233003: Support Float32 output from SkColorSpaceXform (Closed)
Patch Set: Remove gpu changes 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/SkWebpCodec.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform.h
diff --git a/src/core/SkColorSpaceXform.h b/src/core/SkColorSpaceXform.h
index c80cd15dcae4f24e335a4e4d1e44f831cdb00a2e..6c996a9c09d30d51892a0dd79c705510ee6f3037 100644
--- a/src/core/SkColorSpaceXform.h
+++ b/src/core/SkColorSpaceXform.h
@@ -25,20 +25,27 @@ public:
static std::unique_ptr<SkColorSpaceXform> New(const sk_sp<SkColorSpace>& srcSpace,
const sk_sp<SkColorSpace>& dstSpace);
+ enum ColorFormat : uint8_t {
+ kRGBA_8888_ColorFormat,
+ kBGRA_8888_ColorFormat,
+ kRGBA_F16_ColorFormat,
+ kRGBA_F32_ColorFormat,
+ };
+
/**
* Apply the color conversion to a |src| buffer, storing the output in the |dst| buffer.
*
- * @param dst Stored in the format described by |dstColorType| and |dstAlphaType|
- * @param src Stored as RGBA_8888, kUnpremul (note kOpaque is a form of kUnpremul)
- * @param len Number of pixels in the buffers
- * @param dstColorType Describes color type of |dst|
- * @param dstAlphaType Describes alpha type of |dst|
- * kUnpremul preserves input alpha values
- * kPremul performs a premultiplication and also preserves alpha values
- * kOpaque optimization hint, |dst| alphas set to 1
+ * @param dst Stored in the format described by |dstColorType| and |dstAlphaType|
+ * @param src Stored as RGBA_8888, kUnpremul (note kOpaque is a form of kUnpremul)
+ * @param len Number of pixels in the buffers
+ * @param dstColorFormat Describes color format of |dst|
+ * @param dstAlphaType Describes alpha type of |dst|
+ * kUnpremul preserves input alpha values
+ * kPremul performs a premultiplication and also preserves alpha values
+ * kOpaque optimization hint, |dst| alphas set to 1
*
*/
- virtual void apply(void* dst, const uint32_t* src, int len, SkColorType dstColorType,
+ virtual void apply(void* dst, const uint32_t* src, int len, ColorFormat dstColorFormat,
SkAlphaType dstAlphaType) const = 0;
virtual ~SkColorSpaceXform() {}
@@ -66,7 +73,7 @@ template <SrcGamma kSrc, DstGamma kDst, ColorSpaceMatch kCSM>
class SkColorSpaceXform_Base : public SkColorSpaceXform {
public:
- void apply(void* dst, const uint32_t* src, int len, SkColorType dstColorType,
+ void apply(void* dst, const uint32_t* src, int len, ColorFormat dstColorFormat,
SkAlphaType dstAlphaType) const override;
static constexpr int kDstGammaTableSize = 1024;
« no previous file with comments | « src/codec/SkWebpCodec.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698