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

Side by Side Diff: bench/RectBench.cpp

Issue 1358373003: Add warmup bench to visual bench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 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 | « no previous file | tools/VisualBench/VisualLightweightBenchModule.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 2011 Google Inc. 3 * Copyright 2011 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 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 21 matching lines...) Expand all
32 32
33 SkString fName; 33 SkString fName;
34 const char* computeName(const char root[]) { 34 const char* computeName(const char root[]) {
35 fName.printf("%s_%d", root, fShift); 35 fName.printf("%s_%d", root, fShift);
36 if (fStroke > 0) { 36 if (fStroke > 0) {
37 fName.appendf("_stroke_%d", fStroke); 37 fName.appendf("_stroke_%d", fStroke);
38 } 38 }
39 return fName.c_str(); 39 return fName.c_str();
40 } 40 }
41 41
42 bool isVisual() override { return true; }
43
42 protected: 44 protected:
43 virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) { 45 virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) {
44 c->drawRect(r, p); 46 c->drawRect(r, p);
45 } 47 }
46 48
47 virtual const char* onGetName() { return computeName("rects"); } 49 virtual const char* onGetName() { return computeName("rects"); }
48 50
49 virtual void onPreDraw() { 51 virtual void onPreDraw() {
50 SkRandom rand; 52 SkRandom rand;
51 const SkScalar offset = SK_Scalar1/3; 53 const SkScalar offset = SK_Scalar1/3;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 "maskopaque");) 276 "maskopaque");)
275 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 277 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
276 BlitMaskBench::kMaskBlack, 278 BlitMaskBench::kMaskBlack,
277 "maskblack");) 279 "maskblack");)
278 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 280 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
279 BlitMaskBench::kMaskColor, 281 BlitMaskBench::kMaskColor,
280 "maskcolor");) 282 "maskcolor");)
281 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 283 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
282 BlitMaskBench::KMaskShader, 284 BlitMaskBench::KMaskShader,
283 "maskshader");) 285 "maskshader");)
OLDNEW
« no previous file with comments | « no previous file | tools/VisualBench/VisualLightweightBenchModule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698