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

Side by Side Diff: bench/LineBench.cpp

Issue 1037793002: C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: git cl web Created 5 years, 9 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 | « bench/LightingBench.cpp ('k') | bench/MagnifierBench.cpp » ('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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 20 matching lines...) Expand all
31 fDoAA = doAA; 31 fDoAA = doAA;
32 fName.printf("lines_%g_%s", width, doAA ? "AA" : "BW"); 32 fName.printf("lines_%g_%s", width, doAA ? "AA" : "BW");
33 33
34 SkRandom rand; 34 SkRandom rand;
35 for (int i = 0; i < PTS; ++i) { 35 for (int i = 0; i < PTS; ++i) {
36 fPts[i].set(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480); 36 fPts[i].set(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480);
37 } 37 }
38 } 38 }
39 39
40 protected: 40 protected:
41 const char* onGetName() SK_OVERRIDE { 41 const char* onGetName() override {
42 return fName.c_str(); 42 return fName.c_str();
43 } 43 }
44 44
45 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { 45 void onDraw(const int loops, SkCanvas* canvas) override {
46 SkPaint paint; 46 SkPaint paint;
47 this->setupPaint(&paint); 47 this->setupPaint(&paint);
48 48
49 paint.setStyle(SkPaint::kStroke_Style); 49 paint.setStyle(SkPaint::kStroke_Style);
50 paint.setAntiAlias(fDoAA); 50 paint.setAntiAlias(fDoAA);
51 paint.setStrokeWidth(fStrokeWidth); 51 paint.setStrokeWidth(fStrokeWidth);
52 52
53 for (int i = 0; i < loops; i++) { 53 for (int i = 0; i < loops; i++) {
54 canvas->drawPoints(SkCanvas::kLines_PointMode, PTS, fPts, paint); 54 canvas->drawPoints(SkCanvas::kLines_PointMode, PTS, fPts, paint);
55 } 55 }
56 } 56 }
57 57
58 private: 58 private:
59 typedef Benchmark INHERITED; 59 typedef Benchmark INHERITED;
60 }; 60 };
61 61
62 DEF_BENCH(return new LineBench(0, false);) 62 DEF_BENCH(return new LineBench(0, false);)
63 DEF_BENCH(return new LineBench(SK_Scalar1, false);) 63 DEF_BENCH(return new LineBench(SK_Scalar1, false);)
64 DEF_BENCH(return new LineBench(0, true);) 64 DEF_BENCH(return new LineBench(0, true);)
65 DEF_BENCH(return new LineBench(SK_Scalar1/2, true);) 65 DEF_BENCH(return new LineBench(SK_Scalar1/2, true);)
66 DEF_BENCH(return new LineBench(SK_Scalar1, true);) 66 DEF_BENCH(return new LineBench(SK_Scalar1, true);)
OLDNEW
« no previous file with comments | « bench/LightingBench.cpp ('k') | bench/MagnifierBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698