| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "gm.h" | 9 #include "gm.h" |
| 10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 this->setBGColor(0xFFAABBCC); | 106 this->setBGColor(0xFFAABBCC); |
| 107 } | 107 } |
| 108 | 108 |
| 109 ~DCShaderGM() SK_OVERRIDE { | 109 ~DCShaderGM() SK_OVERRIDE { |
| 110 for (int i = 0; i < fPrims.count(); ++i) { | 110 for (int i = 0; i < fPrims.count(); ++i) { |
| 111 SkDELETE(fPrims[i]); | 111 SkDELETE(fPrims[i]); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 uint32_t onGetFlags() const SK_OVERRIDE { | |
| 117 return kGPUOnly_Flag; | |
| 118 } | |
| 119 | 116 |
| 120 SkString onShortName() SK_OVERRIDE { | 117 SkString onShortName() SK_OVERRIDE { |
| 121 return SkString("dcshader"); | 118 return SkString("dcshader"); |
| 122 } | 119 } |
| 123 | 120 |
| 124 SkISize onISize() SK_OVERRIDE { return SkISize::Make(1000, 900); } | 121 SkISize onISize() SK_OVERRIDE { return SkISize::Make(1000, 900); } |
| 125 | 122 |
| 126 void onOnceBeforeDraw() SK_OVERRIDE { | 123 void onOnceBeforeDraw() SK_OVERRIDE { |
| 127 struct Rect : public Prim { | 124 struct Rect : public Prim { |
| 128 SkRect draw(SkCanvas* canvas, const SkPaint& paint) SK_OVERRIDE { | 125 SkRect draw(SkCanvas* canvas, const SkPaint& paint) SK_OVERRIDE { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 }; | 298 }; |
| 302 | 299 |
| 303 SkTArray<Prim*> fPrims; | 300 SkTArray<Prim*> fPrims; |
| 304 | 301 |
| 305 typedef GM INHERITED; | 302 typedef GM INHERITED; |
| 306 }; | 303 }; |
| 307 | 304 |
| 308 DEF_GM( return SkNEW(DCShaderGM); ) | 305 DEF_GM( return SkNEW(DCShaderGM); ) |
| 309 } | 306 } |
| 310 #endif | 307 #endif |
| OLD | NEW |