aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-09-09 10:36:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-09 10:36:17 -0700
commitde68d6c4616d86621373d88100002ddfdb9c08e3 (patch)
treec3020d0d2ab8a4157beeab02fc32efc1518bb1e6 /gm
parent81a478ca6c36aac3e53ce0373a281ac8940f4780 (diff)
Fix storage of gamut transform matrices in SkColorSpace
We were effectively storing the transpose, which made all of our operations on individual colors, and our concatenation of matrices awkward and backwards. I'm planning to push this further into Ganesh, where I had incorrectly adjusted to the previous layout, treating colors as row vectors in the shaders. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2324843003 Review-Url: https://codereview.chromium.org/2324843003
Diffstat (limited to 'gm')
-rw-r--r--gm/color4f.cpp2
-rw-r--r--gm/gamut.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/gm/color4f.cpp b/gm/color4f.cpp
index 2f8684293d..8414659db9 100644
--- a/gm/color4f.cpp
+++ b/gm/color4f.cpp
@@ -96,7 +96,7 @@ DEF_SIMPLE_GM(color4shader, canvas, 1024, 260) {
SkMatrix44 mat(SkMatrix44::kUninitialized_Constructor);
// red -> blue, green -> red, blue -> green
- mat.set3x3(0, 1, 0, 0, 0, 1, 1, 0, 0);
+ mat.set3x3(0, 0, 1, 1, 0, 0, 0, 1, 0);
const SkColor4f colors[] {
{ 1, 0, 0, 1 },
diff --git a/gm/gamut.cpp b/gm/gamut.cpp
index a1bea3c54f..595e36b7d2 100644
--- a/gm/gamut.cpp
+++ b/gm/gamut.cpp
@@ -106,9 +106,9 @@ static void draw_gamut_grid(SkCanvas* canvas, SkTArray<SkAutoTDelete<CellRendere
// We want our colors in our wide gamut to be obviously visibly distorted from sRGB, so we use
// Wide Gamut RGB (with sRGB gamma, for HW acceleration) as the working space for this test:
const float gWideGamutRGB_toXYZD50[]{
- 0.7161046f, 0.2581874f, 0.0000000f, // * R
- 0.1009296f, 0.7249378f, 0.0517813f, // * G
- 0.1471858f, 0.0168748f, 0.7734287f, // * B
+ 0.7161046f, 0.1009296f, 0.1471858f, // -> X
+ 0.2581874f, 0.7249378f, 0.0168748f, // -> Y
+ 0.0000000f, 0.0517813f, 0.7734287f, // -> Z
};
SkMatrix44 wideGamutRGB_toXYZD50(SkMatrix44::kUninitialized_Constructor);