zero a2b values of stock profiles
This makes more profiles bitwise identical with skcms_sRGB_profile(),
as shown in the new unit test, which failed before.
This showed up in ic_lockscreen_google_focused,
but moved the cost of skcms_Transform() from tiny to ~zero.
Bug: skia:8278
Change-Id: I2b6737d7a059eb228b1a8e92bf4adbea45afc411
Reviewed-on: https://skia-review.googlesource.com/150244
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/skcms.cc b/skcms.cc
index 941dae6..1599e4e 100644
--- a/skcms.cc
+++ b/skcms.cc
@@ -996,10 +996,10 @@
{
0,
{
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
},
{0,0,0,0},
nullptr,
@@ -1007,21 +1007,21 @@
0,
{
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
},
{{
- { 1,0,0,0 },
- { 0,1,0,0 },
- { 0,0,1,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
}},
0,
{
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
},
},
};
@@ -1056,10 +1056,10 @@
{
0,
{
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
},
{0,0,0,0},
nullptr,
@@ -1067,21 +1067,21 @@
0,
{
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
},
{{
- { 1,0,0,0 },
- { 0,1,0,0 },
- { 0,0,1,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
+ { 0,0,0,0 },
}},
0,
{
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
- {{0, {1,1, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
+ {{0, {0,0, 0,0,0,0,0}}},
},
},
};
diff --git a/tests.c b/tests.c
index 4706925..06b3aa1 100644
--- a/tests.c
+++ b/tests.c
@@ -1101,6 +1101,13 @@
expect(skcms_ApproximatelyEqualProfiles( srgb, ©));
expect(skcms_ApproximatelyEqualProfiles(©, srgb));
expect(skcms_ApproximatelyEqualProfiles(©, ©));
+
+ // This should make a bitwise exact copy of sRGB.
+ skcms_ICCProfile exact;
+ skcms_Init(&exact);
+ skcms_SetTransferFunction(&exact, &srgb->trc[0].parametric);
+ skcms_SetXYZD50(&exact, &srgb->toXYZD50);
+ expect(0 == memcmp(&exact, srgb, sizeof(skcms_ICCProfile)));
}
static void test_Clamp() {