Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Side by Side Diff: gm/dcshader.cpp

Issue 869393007: Add standard way to indicate GM is GPU-only. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add include Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | gm/gm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | gm/gm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698