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

Unified Diff: src/core/SkColorSpaceXform.h

Issue 2184543003: Perform color correction on png decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@colorjpegs
Patch Set: Created 4 years, 5 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: src/core/SkColorSpaceXform.h
diff --git a/src/core/SkColorSpaceXform.h b/src/core/SkColorSpaceXform.h
index a9d26a77f867d4a48933d31ec7239d84b154b246..05385649be0e3ae50949c17d1db5090f7de2f407 100644
--- a/src/core/SkColorSpaceXform.h
+++ b/src/core/SkColorSpaceXform.h
@@ -10,6 +10,7 @@
#include "SkColorSpace.h"
#include "SkColorSpace_Base.h"
+#include "SkImageInfo.h"
class SkColorSpaceXform : SkNoncopyable {
public:
@@ -30,12 +31,17 @@ 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). If Premul is requested, the output will be
+ * premultiplied by alpha.
*/
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 applyToRGBAPremul(RGBA32* dst, const RGBA32* src, int len) const = 0;
+ virtual void applyToBGRAPremul(BGRA32* dst, const RGBA32* src, int len) const = 0;
+ virtual void applyToF16Premul(RGBAF16* dst, const RGBA32* src, int len) const = 0;
+ virtual void apply(void* dst, const RGBA32* src, int len, SkColorType dstColorType,
+ bool premul) const = 0;
virtual ~SkColorSpaceXform() {}
};
@@ -47,6 +53,11 @@ 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 applyToRGBAPremul(RGBA32* dst, const RGBA32* src, int len) const override;
+ void applyToBGRAPremul(BGRA32* dst, const RGBA32* src, int len) const override;
+ void applyToF16Premul(RGBAF16* dst, const RGBA32* src, int len) const override;
+ void apply(void* dst, const RGBA32* src, int len, SkColorType dstColorType, bool premul)
+ const override;
static constexpr int kDstGammaTableSize = 1024;

Powered by Google App Engine
This is Rietveld 408576698