diff options
author | Brian Osman <brianosman@google.com> | 2017-11-14 11:13:54 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-14 16:33:34 +0000 |
commit | 0387d35f599dca39cb6a5073743c245b3f12ab7d (patch) | |
tree | 8c58a82137fe5318db76be7c1b457438d7959dc0 /dm | |
parent | ccafca0054670b02a02d6d256de490c45e787391 (diff) |
Add SkColorSpace_Base::makeColorSpin
This is a utility that creates a version of an existing XYZ color space
that performs our color spin operation. Assigning this to a source remaps
RGB to GBR. Assigning it to a destination does the opposite (RGB to BRG).
Bug: skia:
Change-Id: I3528698220bd32aa01dcd3db225e60f151a4b5bd
Reviewed-on: https://skia-review.googlesource.com/71280
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DM.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -919,19 +919,7 @@ static sk_sp<SkColorSpace> adobe_rgb() { } static sk_sp<SkColorSpace> rgb_to_gbr() { - float gbr[9]; - gbr[0] = gSRGB_toXYZD50[1]; - gbr[1] = gSRGB_toXYZD50[2]; - gbr[2] = gSRGB_toXYZD50[0]; - gbr[3] = gSRGB_toXYZD50[4]; - gbr[4] = gSRGB_toXYZD50[5]; - gbr[5] = gSRGB_toXYZD50[3]; - gbr[6] = gSRGB_toXYZD50[7]; - gbr[7] = gSRGB_toXYZD50[8]; - gbr[8] = gSRGB_toXYZD50[6]; - SkMatrix44 toXYZD50(SkMatrix44::kUninitialized_Constructor); - toXYZD50.set3x3RowMajorf(gbr); - return SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, toXYZD50); + return as_CSB(SkColorSpace::MakeSRGB())->makeColorSpin(); } static Sink* create_via(const SkString& tag, Sink* wrapped) { |