diff options
author | 2016-09-12 12:07:25 -0700 | |
---|---|---|
committer | 2016-09-12 12:07:25 -0700 | |
commit | 5a7ae7e337a68dc42723fce80752c93b7d26d469 (patch) | |
tree | 24ebe49dc9e9dc4f7e9e032f2106aaa622596a0f /src/gpu/SkGr.cpp | |
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 'src/gpu/SkGr.cpp')
-rw-r--r-- | src/gpu/SkGr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 7c0d09b702..c8839f3f1a 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -537,6 +537,10 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context, origColor.fRGBA[0] = exact_srgb_to_linear(origColor.fRGBA[0]); origColor.fRGBA[1] = exact_srgb_to_linear(origColor.fRGBA[1]); origColor.fRGBA[2] = exact_srgb_to_linear(origColor.fRGBA[2]); + + if (dc->getColorXformFromSRGB()) { + origColor = dc->getColorXformFromSRGB()->apply(origColor); + } } // Setup the initial color considering the shader, the SkPaint color, and the presence or not |