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

Unified Diff: src/core/SkColorSpaceXform.h

Issue 2060823003: Implement fast, correct gamma conversion for color xforms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Win test Created 4 years, 6 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 | « dm/DMSrcSink.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 34726435199ddf10905cb6dae3ad65fed114e870..1ea608094f252cd421b24b6530a28a1553c57ea8 100644
--- a/src/core/SkColorSpaceXform.h
+++ b/src/core/SkColorSpaceXform.h
@@ -26,23 +26,36 @@ public:
/**
* Apply the color conversion to a src buffer, storing the output in the dst buffer.
- * The src is stored in RGBA_8888 and the dst is stored in 8888 platform format.
- * The output is not premultiplied.
+ * The src is opaque and stored in RGBA_8888, and the dst is also opaque and stored
+ * in 8888 platform format.
*/
- virtual void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const = 0;
+ virtual void xform_RGB1_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const = 0;
virtual ~SkColorSpaceXform() {}
};
-class Sk2Dot2Xform : public SkColorSpaceXform {
+class SkSRGBTo2Dot2Xform : public SkColorSpaceXform {
public:
- void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
+ void xform_RGB1_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
private:
- Sk2Dot2Xform(const SkMatrix44& srcToDst);
+ SkSRGBTo2Dot2Xform(const SkMatrix44& srcToDst);
- float fSrcToDst[16];
+ float fSrcToDst[12];
+
+ friend class SkColorSpaceXform;
+};
+
+class Sk2Dot2To2Dot2Xform : public SkColorSpaceXform {
+public:
+
+ void xform_RGB1_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
+
+private:
+ Sk2Dot2To2Dot2Xform(const SkMatrix44& srcToDst);
+
+ float fSrcToDst[12];
friend class SkColorSpaceXform;
};
@@ -53,7 +66,7 @@ private:
class SkDefaultXform : public SkColorSpaceXform {
public:
- void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
+ void xform_RGB1_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
private:
SkDefaultXform(const sk_sp<SkGammas>& srcGammas, const SkMatrix44& srcToDst,
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698