aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/create_flutter_test_images.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-11-14 11:13:54 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-14 16:33:34 +0000
commit0387d35f599dca39cb6a5073743c245b3f12ab7d (patch)
tree8c58a82137fe5318db76be7c1b457438d7959dc0 /tools/create_flutter_test_images.cpp
parentccafca0054670b02a02d6d256de490c45e787391 (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 'tools/create_flutter_test_images.cpp')
-rw-r--r--tools/create_flutter_test_images.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/tools/create_flutter_test_images.cpp b/tools/create_flutter_test_images.cpp
index 69a0d112a3..2fa39f6c75 100644
--- a/tools/create_flutter_test_images.cpp
+++ b/tools/create_flutter_test_images.cpp
@@ -15,19 +15,7 @@
* Create a color space that swaps the red, green, and blue channels.
*/
static sk_sp<SkColorSpace> gbr_color_space() {
- 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();
}
/**