Index: src/core/SkColorSpaceXform.h |
diff --git a/src/core/SkColorSpaceXform.h b/src/core/SkColorSpaceXform.h |
index 2696b8582accdca6352fe7c5ef70d4b925e702ed..91dbf54295e63e28171ba092051beaf1b897fadf 100644 |
--- a/src/core/SkColorSpaceXform.h |
+++ b/src/core/SkColorSpaceXform.h |
@@ -10,14 +10,11 @@ |
#include "SkColorSpace.h" |
#include "SkColorSpace_Base.h" |
+#include "SkImageInfo.h" |
class SkColorSpaceXform : SkNoncopyable { |
public: |
- typedef uint32_t RGBA32; |
- typedef uint32_t BGRA32; |
- typedef uint64_t RGBAF16; |
- |
/** |
* Create an object to handle color space conversions. |
* |
@@ -30,23 +27,21 @@ public: |
/** |
* Apply the color conversion to a src buffer, storing the output in the dst buffer. |
- * The src is stored as RGBA (8888) and is treated as opaque. |
- * TODO (msarett): Support non-opaque srcs. |
+ * The src is stored as RGBA (8888). The dst is stored in the format indicated by |
+ * |dstColorType| and is premultiplied by alpha if |premul| is set. |
*/ |
- virtual void applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const = 0; |
- virtual void applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const = 0; |
- virtual void applyToF16(RGBAF16* dst, const RGBA32* src, int len) const = 0; |
+ virtual void apply(void* dst, const uint32_t* src, int len, SkColorType dstColorType, |
+ SkAlphaType dstAlphaType) const = 0; |
virtual ~SkColorSpaceXform() {} |
}; |
-template <SkColorSpace::GammaNamed Dst> |
+template <SkColorSpace::GammaNamed kDst> |
class SkColorSpaceXform_Base : public SkColorSpaceXform { |
public: |
- void applyToRGBA(RGBA32* dst, const RGBA32* src, int len) const override; |
- void applyToBGRA(BGRA32* dst, const RGBA32* src, int len) const override; |
- void applyToF16(RGBAF16* dst, const RGBA32* src, int len) const override; |
+ void apply(void* dst, const uint32_t* src, int len, SkColorType dstColorType, |
+ SkAlphaType dstAlphaType) const override; |
static constexpr int kDstGammaTableSize = 1024; |