1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| /*
| * Copyright 2016 Google Inc.
| *
| * Use of this source code is governed by a BSD-style license that can be
| * found in the LICENSE file.
| */
|
| #include "SkColor.h"
| #include "Test.h"
|
| DEF_TEST(SkColor4f_FromColor, reporter) {
| const struct {
| SkColor fC;
| SkColor4f fC4;
| } recs[] = {
| { SK_ColorBLACK, { 0, 0, 0, 1 } },
| { SK_ColorWHITE, { 1, 1, 1, 1 } },
| { SK_ColorRED, { 1, 0, 0, 1 } },
| { SK_ColorGREEN, { 0, 1, 0, 1 } },
| { SK_ColorBLUE, { 0, 0, 1, 1 } },
| { 0, { 0, 0, 0, 0 } },
| };
|
| for (const auto& r : recs) {
| SkColor4f c4 = SkColor4f::FromColor(r.fC);
| REPORTER_ASSERT(reporter, c4 == r.fC4);
| }
| }
|
|