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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(kImageWidth, kI
mageHeight); } | 57 SkISize onISize() SK_OVERRIDE { return SkISize::Make(kImageWidth, kImageHeig
ht); } |
58 | 58 |
59 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 59 uint32_t onGetFlags() const SK_OVERRIDE { |
60 if (kEffect_Type == fType) { | 60 if (kEffect_Type == fType) { |
61 return kGPUOnly_Flag | kSkipTiled_Flag; | 61 return kGPUOnly_Flag | kSkipTiled_Flag; |
62 } else { | 62 } else { |
63 return kSkipTiled_Flag; | 63 return kSkipTiled_Flag; |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 67 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
68 #if SK_SUPPORT_GPU | 68 #if SK_SUPPORT_GPU |
69 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); | 69 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
70 GrContext* context = rt ? rt->getContext() : NULL; | 70 GrContext* context = rt ? rt->getContext() : NULL; |
71 if (kEffect_Type == fType && NULL == context) { | 71 if (kEffect_Type == fType && NULL == context) { |
72 return; | 72 return; |
73 } | 73 } |
74 #endif | 74 #endif |
75 | 75 |
76 SkPaint paint; | 76 SkPaint paint; |
77 if (kAA_Draw_Type == fType) { | 77 if (kAA_Draw_Type == fType) { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 262 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
263 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 263 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
264 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 264 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
265 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 265 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
266 #if SK_SUPPORT_GPU | 266 #if SK_SUPPORT_GPU |
267 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 267 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
268 #endif | 268 #endif |
269 | 269 |
270 } | 270 } |
OLD | NEW |