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 "Test.h" | 8 #include "Test.h" |
9 #include "SkValue.h" | 9 #include "SkValueKeys.h" |
| 10 #include "SkXfermode.h" |
| 11 |
| 12 DEF_TEST(Value_Xfermode, r) { |
| 13 |
| 14 SkAutoTUnref<SkXfermode> xfermode( |
| 15 SkXfermode::Create(SkXfermode::kDstOver_Mode)); |
| 16 SkValue val = xfermode->represent(); |
| 17 REPORTER_ASSERT(r, SkValue::ProcCoeffXfermode == val.type()); |
| 18 SkValue valCopy = val; |
| 19 REPORTER_ASSERT(r, SkValue::ProcCoeffXfermode == valCopy.type()); |
| 20 |
| 21 const SkValue* mode = val.get(SkValueKeys::ProcCoeffXfermode_Mode); |
| 22 REPORTER_ASSERT(r, mode); |
| 23 if (mode) { |
| 24 REPORTER_ASSERT(r, (uint32_t)SkXfermode::kDstOver_Mode == mode->u32()); |
| 25 } |
| 26 } |
OLD | NEW |