diff options
author | 2016-09-12 12:07:25 -0700 | |
---|---|---|
committer | 2016-09-12 12:07:25 -0700 | |
commit | 5a7ae7e337a68dc42723fce80752c93b7d26d469 (patch) | |
tree | 24ebe49dc9e9dc4f7e9e032f2106aaa622596a0f /include/gpu | |
parent | 6ade6dd9910be25c15e25c90d76f8471ff23f62c (diff) |
Gamut transformation of the paint color in Ganesh
Conversion from sRGB to destination gamut is going to be very common,
so I'm caching that xform (if there is one) on the draw context.
Results verified in the gamut GM (two more boxes correct).
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2330553003
Review-Url: https://codereview.chromium.org/2330553003
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrColorSpaceXform.h | 3 | ||||
-rw-r--r-- | include/gpu/GrDrawContext.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/gpu/GrColorSpaceXform.h b/include/gpu/GrColorSpaceXform.h index 38b5ccfc08..2d2cc867a5 100644 --- a/include/gpu/GrColorSpaceXform.h +++ b/include/gpu/GrColorSpaceXform.h @@ -8,6 +8,7 @@ #ifndef GrColorSpaceXform_DEFINED #define GrColorSpaceXform_DEFINED +#include "GrColor.h" #include "SkMatrix44.h" #include "SkRefCnt.h" @@ -33,6 +34,8 @@ public: return SkToBool(xform) ? 1 : 0; } + GrColor4f apply(const GrColor4f& srcColor); + private: SkMatrix44 fSrcToDst; }; diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h index cad2b827e4..29a70f9b14 100644 --- a/include/gpu/GrDrawContext.h +++ b/include/gpu/GrDrawContext.h @@ -335,6 +335,7 @@ public: } const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } SkColorSpace* getColorSpace() const { return fColorSpace.get(); } + GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRGB.get(); } GrSurfaceOrigin origin() const { return fRenderTarget->origin(); } bool wasAbandoned() const; @@ -425,6 +426,7 @@ private: GrInstancedPipelineInfo fInstancedPipelineInfo; sk_sp<SkColorSpace> fColorSpace; + sk_sp<GrColorSpaceXform> fColorXformFromSRGB; SkSurfaceProps fSurfaceProps; GrAuditTrail* fAuditTrail; |