Flutter Engine
The Flutter Engine
Functions
SkColor4fTest.cpp File Reference
#include "include/core/SkColor.h"
#include "tests/Test.h"

Go to the source code of this file.

Functions

 DEF_TEST (SkColor4f_FromColor, reporter)
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( SkColor4f_FromColor  ,
reporter   
)

Definition at line 11 of file SkColor4fTest.cpp.

11 {
12 const struct {
13 SkColor fC;
14 SkColor4f fC4;
15 } recs[] = {
16 { SK_ColorBLACK, { 0, 0, 0, 1 } },
17 { SK_ColorWHITE, { 1, 1, 1, 1 } },
18 { SK_ColorRED, { 1, 0, 0, 1 } },
19 { SK_ColorGREEN, { 0, 1, 0, 1 } },
20 { SK_ColorBLUE, { 0, 0, 1, 1 } },
21 { 0, { 0, 0, 0, 0 } },
22 };
23
24 for (const auto& r : recs) {
25 SkColor4f c4 = SkColor4f::FromColor(r.fC);
26 REPORTER_ASSERT(reporter, c4 == r.fC4);
27 }
28}
reporter
Definition: FontMgrTest.cpp:39
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286