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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 fPrims.push_back(SkNEW(DRRect)); | 241 fPrims.push_back(SkNEW(DRRect)); |
242 fPrims.push_back(SkNEW(Path)); | 242 fPrims.push_back(SkNEW(Path)); |
243 fPrims.push_back(SkNEW(Points(SkCanvas::kPoints_PointMode))); | 243 fPrims.push_back(SkNEW(Points(SkCanvas::kPoints_PointMode))); |
244 fPrims.push_back(SkNEW(Points(SkCanvas::kLines_PointMode))); | 244 fPrims.push_back(SkNEW(Points(SkCanvas::kLines_PointMode))); |
245 fPrims.push_back(SkNEW(Points(SkCanvas::kPolygon_PointMode))); | 245 fPrims.push_back(SkNEW(Points(SkCanvas::kPolygon_PointMode))); |
246 fPrims.push_back(SkNEW(Text)); | 246 fPrims.push_back(SkNEW(Text)); |
247 fPrims.push_back(SkNEW(BmpText)); | 247 fPrims.push_back(SkNEW(BmpText)); |
248 } | 248 } |
249 | 249 |
250 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 250 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 251 // This GM exists to test a specific feature of the GPU backend. It does
not work with the |
| 252 // sw rasterizer, tile modes, etc. |
| 253 if (NULL == canvas->getGrContext()) { |
| 254 this->drawGpuOnlyMessage(canvas); |
| 255 return; |
| 256 } |
251 SkPaint paint; | 257 SkPaint paint; |
252 SkTArray<SkMatrix> devMats; | 258 SkTArray<SkMatrix> devMats; |
253 devMats.push_back().reset(); | 259 devMats.push_back().reset(); |
254 devMats.push_back().setRotate(45, 500, 500); | 260 devMats.push_back().setRotate(45, 500, 500); |
255 devMats.push_back().setRotate(-30, 200, 200); | 261 devMats.push_back().setRotate(-30, 200, 200); |
256 devMats.back().setPerspX(-SK_Scalar1 / 2000); | 262 devMats.back().setPerspX(-SK_Scalar1 / 2000); |
257 devMats.back().setPerspY(SK_Scalar1 / 1000); | 263 devMats.back().setPerspY(SK_Scalar1 / 1000); |
258 | 264 |
259 | 265 |
260 SkTArray<SkMatrix> viewMats; | 266 SkTArray<SkMatrix> viewMats; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 }; | 311 }; |
306 | 312 |
307 SkTArray<Prim*> fPrims; | 313 SkTArray<Prim*> fPrims; |
308 | 314 |
309 typedef GM INHERITED; | 315 typedef GM INHERITED; |
310 }; | 316 }; |
311 | 317 |
312 DEF_GM( return SkNEW(DCShaderGM); ) | 318 DEF_GM( return SkNEW(DCShaderGM); ) |
313 } | 319 } |
314 #endif | 320 #endif |
OLD | NEW |