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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 fPrims.push_back(new Path); | 219 fPrims.push_back(new Path); |
220 fPrims.push_back(new Points(SkCanvas::kPoints_PointMode)); | 220 fPrims.push_back(new Points(SkCanvas::kPoints_PointMode)); |
221 fPrims.push_back(new Points(SkCanvas::kLines_PointMode)); | 221 fPrims.push_back(new Points(SkCanvas::kLines_PointMode)); |
222 fPrims.push_back(new Points(SkCanvas::kPolygon_PointMode)); | 222 fPrims.push_back(new Points(SkCanvas::kPolygon_PointMode)); |
223 fPrims.push_back(new Text); | 223 fPrims.push_back(new Text); |
224 } | 224 } |
225 | 225 |
226 void onDraw(SkCanvas* canvas) override { | 226 void onDraw(SkCanvas* canvas) override { |
227 // This GM exists to test a specific feature of the GPU backend. It does
not work with the | 227 // This GM exists to test a specific feature of the GPU backend. It does
not work with the |
228 // sw rasterizer, tile modes, etc. | 228 // sw rasterizer, tile modes, etc. |
229 if (NULL == canvas->getGrContext()) { | 229 if (nullptr == canvas->getGrContext()) { |
230 this->drawGpuOnlyMessage(canvas); | 230 this->drawGpuOnlyMessage(canvas); |
231 return; | 231 return; |
232 } | 232 } |
233 SkPaint paint; | 233 SkPaint paint; |
234 SkTArray<SkMatrix> devMats; | 234 SkTArray<SkMatrix> devMats; |
235 devMats.push_back().reset(); | 235 devMats.push_back().reset(); |
236 devMats.push_back().setRotate(45, 500, 500); | 236 devMats.push_back().setRotate(45, 500, 500); |
237 devMats.push_back().setRotate(-30, 200, 200); | 237 devMats.push_back().setRotate(-30, 200, 200); |
238 devMats.back().setPerspX(-SK_Scalar1 / 2000); | 238 devMats.back().setPerspX(-SK_Scalar1 / 2000); |
239 devMats.back().setPerspY(SK_Scalar1 / 1000); | 239 devMats.back().setPerspY(SK_Scalar1 / 1000); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 }; | 287 }; |
288 | 288 |
289 SkTArray<Prim*> fPrims; | 289 SkTArray<Prim*> fPrims; |
290 | 290 |
291 typedef GM INHERITED; | 291 typedef GM INHERITED; |
292 }; | 292 }; |
293 | 293 |
294 DEF_GM(return new DCShaderGM;) | 294 DEF_GM(return new DCShaderGM;) |
295 } | 295 } |
296 #endif | 296 #endif |
OLD | NEW |