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" |
(...skipping 14 matching lines...) Expand all Loading... |
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(0xFFDDDDDD); | 30 this->setBGColor(0xFFDDDDDD); |
31 this->setUpRRects(); | 31 this->setUpRRects(); |
32 } | 32 } |
33 | 33 |
34 protected: | 34 protected: |
35 SkString onShortName() SK_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; |
41 case kAA_Draw_Type: | 41 case kAA_Draw_Type: |
42 name.append("_draw_aa"); | 42 name.append("_draw_aa"); |
43 break; | 43 break; |
44 case kBW_Clip_Type: | 44 case kBW_Clip_Type: |
45 name.append("_clip_bw"); | 45 name.append("_clip_bw"); |
46 break; | 46 break; |
47 case kAA_Clip_Type: | 47 case kAA_Clip_Type: |
48 name.append("_clip_aa"); | 48 name.append("_clip_aa"); |
49 break; | 49 break; |
50 case kEffect_Type: | 50 case kEffect_Type: |
51 name.append("_effect"); | 51 name.append("_effect"); |
52 break; | 52 break; |
53 } | 53 } |
54 return name; | 54 return name; |
55 } | 55 } |
56 | 56 |
57 SkISize onISize() SK_OVERRIDE { return SkISize::Make(kImageWidth, kImageHeig
ht); } | 57 SkISize onISize() override { return SkISize::Make(kImageWidth, kImageHeight)
; } |
58 | 58 |
59 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 59 void onDraw(SkCanvas* canvas) override { |
60 GrContext* context = NULL; | 60 GrContext* context = NULL; |
61 #if SK_SUPPORT_GPU | 61 #if SK_SUPPORT_GPU |
62 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 62 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
63 context = rt ? rt->getContext() : NULL; | 63 context = rt ? rt->getContext() : NULL; |
64 #endif | 64 #endif |
65 if (kEffect_Type == fType && NULL == context) { | 65 if (kEffect_Type == fType && NULL == context) { |
66 this->drawGpuOnlyMessage(canvas); | 66 this->drawGpuOnlyMessage(canvas); |
67 return; | 67 return; |
68 } | 68 } |
69 | 69 |
(...skipping 187 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 |