OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "gm.h" | 8 #include "gm.h" |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "GrTest.h" | 10 #include "GrTest.h" |
11 #include "effects/GrRRectEffect.h" | 11 #include "effects/GrRRectEffect.h" |
12 #endif | 12 #endif |
13 #include "SkDevice.h" | 13 #include "SkDevice.h" |
14 #include "SkRRect.h" | 14 #include "SkRRect.h" |
15 | 15 |
16 namespace skiagm { | 16 namespace skiagm { |
17 | 17 |
18 /////////////////////////////////////////////////////////////////////////////// | 18 /////////////////////////////////////////////////////////////////////////////// |
19 | 19 |
20 class RRectGM : public GM { | 20 class RRectGM : public GM { |
21 public: | 21 public: |
22 enum Type { | 22 enum Type { |
23 kBW_Draw_Type, | 23 kBW_Draw_Type, |
24 kAA_Draw_Type, | 24 kAA_Draw_Type, |
25 kBW_Clip_Type, | 25 kBW_Clip_Type, |
26 kAA_Clip_Type, | 26 kAA_Clip_Type, |
27 kEffect_Type, | 27 kEffect_Type, |
28 }; | 28 }; |
29 RRectGM(Type type) : fType(type) { | 29 RRectGM(Type type) : fType(type) { |
30 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); | 30 this->setBGColor(0xFFDDDDDD); |
31 this->setUpRRects(); | 31 this->setUpRRects(); |
32 } | 32 } |
33 | 33 |
34 protected: | 34 protected: |
35 SkString onShortName() override { | 35 SkString onShortName() override { |
36 SkString name("rrect"); | 36 SkString name("rrect"); |
37 switch (fType) { | 37 switch (fType) { |
38 case kBW_Draw_Type: | 38 case kBW_Draw_Type: |
39 name.append("_draw_bw"); | 39 name.append("_draw_bw"); |
40 break; | 40 break; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 258 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
259 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 259 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
260 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 260 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
261 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 261 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
262 #if SK_SUPPORT_GPU | 262 #if SK_SUPPORT_GPU |
263 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 263 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
264 #endif | 264 #endif |
265 | 265 |
266 } | 266 } |
OLD | NEW |