aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-24 06:31:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-24 06:31:47 -0700
commite074d1fa6ace83dd77971b971c07166bedeb28ef (patch)
treeffdbdc9ce69615ca7923b4816343d01fddad7bac /tests
parent7bde5659d354b4ef227c487a4e9fa8de12573c31 (diff)
Change SkColor4f to RGBA channel order
Diffstat (limited to 'tests')
-rw-r--r--tests/Float16Test.cpp2
-rw-r--r--tests/SkColor4fTest.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/Float16Test.cpp b/tests/Float16Test.cpp
index 6a7f9842f4..d80fe29439 100644
--- a/tests/Float16Test.cpp
+++ b/tests/Float16Test.cpp
@@ -43,7 +43,7 @@ DEF_TEST(color_half_float, reporter) {
pm.alloc(info);
REPORTER_ASSERT(reporter, pm.getSafeSize() == SkToSizeT(w * h * sizeof(uint64_t)));
- SkColor4f c4 { 0.5f, 1, 0.5f, 0.25f };
+ SkColor4f c4 { 1, 0.5f, 0.25f, 0.5f };
pm.erase(c4);
SkPM4f origpm4 = c4.premul();
diff --git a/tests/SkColor4fTest.cpp b/tests/SkColor4fTest.cpp
index 00cb3fed27..1dacfb2d95 100644
--- a/tests/SkColor4fTest.cpp
+++ b/tests/SkColor4fTest.cpp
@@ -37,13 +37,13 @@ DEF_TEST(SkColor4f_FromColor, reporter) {
SkColor fC;
SkColor4f fC4;
} recs[] = {
- { SK_ColorBLACK, { 1, 0, 0, 0 } },
+ { SK_ColorBLACK, { 0, 0, 0, 1 } },
{ SK_ColorWHITE, { 1, 1, 1, 1 } },
- { SK_ColorRED, { 1, 1, 0, 0 } },
- { SK_ColorGREEN, { 1, 0, 1, 0 } },
- { SK_ColorBLUE, { 1, 0, 0, 1 } },
+ { SK_ColorRED, { 1, 0, 0, 1 } },
+ { SK_ColorGREEN, { 0, 1, 0, 1 } },
+ { SK_ColorBLUE, { 0, 0, 1, 1 } },
{ 0, { 0, 0, 0, 0 } },
- { 0x55AAFF00, { 1/3.0f, 2/3.0f, 1, 0 } },
+ { 0x55AAFF00, { 2/3.0f, 1, 0, 1 / 3.0f } },
};
for (const auto& r : recs) {
@@ -58,7 +58,7 @@ DEF_TEST(Color4f_premul, reporter) {
for (int i = 0; i < 1000000; ++i) {
// First just test opaque colors, so that the premul should be exact
SkColor4f c4 {
- 1, rand.nextUScalar1(), rand.nextUScalar1(), rand.nextUScalar1()
+ rand.nextUScalar1(), rand.nextUScalar1(), rand.nextUScalar1(), 1
};
SkPM4f pm4 = c4.premul();
REPORTER_ASSERT(reporter, pm4.a() == c4.fA);