OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkData.h" | 8 #include "SkData.h" |
9 #include "SkMatrix.h" | 9 #include "SkMatrix.h" |
10 #include "SkValue.h" | 10 #include "SkToFromValue.h" |
11 #include "Test.h" | 11 #include "Test.h" |
12 | 12 |
13 static const SkValue::Type example_type = | 13 static const SkValue::Type example_type = |
14 SkValue::Type(SkValue::kMaxPublicObject + 1); | 14 SkValue::Type(SkValue::kMaxPublicObject + 1); |
15 | 15 |
16 enum { kExampleS32, kExampleF32, kExampleU32, kExampleObject, kExampleBytes, | 16 enum { kExampleS32, kExampleF32, kExampleU32, kExampleObject, kExampleBytes, |
17 kExampleF32s, kExampleU32s, kExampleU16s, kExampleArray }; | 17 kExampleF32s, kExampleU32s, kExampleU16s, kExampleArray }; |
18 | 18 |
19 static const uint16_t aU16[] = { 1, 2, 3, 4 }; | 19 static const uint16_t aU16[] = { 1, 2, 3, 4 }; |
20 static const uint32_t aU32[] = { 5, 6, 7, 8 }; | 20 static const uint32_t aU32[] = { 5, 6, 7, 8 }; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 val.foreach(fn); | 102 val.foreach(fn); |
103 } | 103 } |
104 | 104 |
105 DEF_TEST(Value_Matrix, r) { | 105 DEF_TEST(Value_Matrix, r) { |
106 auto m = SkMatrix::MakeTrans(900.0f, 1000.0f); | 106 auto m = SkMatrix::MakeTrans(900.0f, 1000.0f); |
107 auto val = SkToValue(m); | 107 auto val = SkToValue(m); |
108 SkMatrix dst; | 108 SkMatrix dst; |
109 REPORTER_ASSERT(r, SkFromValue(val, &dst)); | 109 REPORTER_ASSERT(r, SkFromValue(val, &dst)); |
110 REPORTER_ASSERT(r, dst == m); | 110 REPORTER_ASSERT(r, dst == m); |
111 } | 111 } |
OLD | NEW |