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

Side by Side Diff: gm/dashing.cpp

Issue 873753002: Spin off GM::runAsBench() from flags. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/convexpolyclip.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 * 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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 407 }
408 }; 408 };
409 409
410 ////////////////////////////////////////////////////////////////////////////// 410 //////////////////////////////////////////////////////////////////////////////
411 411
412 class Dashing5GM : public skiagm::GM { 412 class Dashing5GM : public skiagm::GM {
413 public: 413 public:
414 Dashing5GM(bool doAA) : fDoAA(doAA) {} 414 Dashing5GM(bool doAA) : fDoAA(doAA) {}
415 415
416 protected: 416 protected:
417 uint32_t onGetFlags() const SK_OVERRIDE { return kAsBench_Flag | kSkipTiled_ Flag; } 417 uint32_t onGetFlags() const SK_OVERRIDE { return kSkipTiled_Flag; }
418 418
419 SkString onShortName() SK_OVERRIDE { 419 bool runAsBench() const SK_OVERRIDE { return true; }
420
421 SkString onShortName() SK_OVERRIDE {
420 if (fDoAA) { 422 if (fDoAA) {
421 return SkString("dashing5_aa"); 423 return SkString("dashing5_aa");
422 } else { 424 } else {
423 return SkString("dashing5_bw"); 425 return SkString("dashing5_bw");
424 } 426 }
425 } 427 }
426 428
427 SkISize onISize() SK_OVERRIDE { return SkISize::Make(400, 200); } 429 SkISize onISize() SK_OVERRIDE { return SkISize::Make(400, 200); }
428 430
429 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 431 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 487
486 ////////////////////////////////////////////////////////////////////////////// 488 //////////////////////////////////////////////////////////////////////////////
487 489
488 DEF_GM(return SkNEW(DashingGM);) 490 DEF_GM(return SkNEW(DashingGM);)
489 DEF_GM(return SkNEW(Dashing2GM);) 491 DEF_GM(return SkNEW(Dashing2GM);)
490 DEF_GM(return SkNEW(Dashing3GM);) 492 DEF_GM(return SkNEW(Dashing3GM);)
491 DEF_GM(return SkNEW(Dashing4GM);) 493 DEF_GM(return SkNEW(Dashing4GM);)
492 DEF_GM(return SkNEW_ARGS(Dashing5GM, (true));) 494 DEF_GM(return SkNEW_ARGS(Dashing5GM, (true));)
493 DEF_GM(return SkNEW_ARGS(Dashing5GM, (false));) 495 DEF_GM(return SkNEW_ARGS(Dashing5GM, (false));)
494 496
OLDNEW
« no previous file with comments | « gm/convexpolyclip.cpp ('k') | gm/gm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698