Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: tests/SkColor4fTest.cpp

Issue 2093763003: Change SkColor4f to RGBA channel order (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reorder Pin arguments, too Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/Float16Test.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkColor4fTest.cpp
diff --git a/tests/SkColor4fTest.cpp b/tests/SkColor4fTest.cpp
index 00cb3fed27c2fdd16adbcea0645cf99dfd6c1541..1dacfb2d95f2ffdfbdaf05d1ca2b5cd6be53860e 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);
« no previous file with comments | « tests/Float16Test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698