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

Side by Side Diff: bench/HairlinePathBench.cpp

Issue 1034273002: Add matrix constructing helpers to SkMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/DashBench.cpp ('k') | bench/PathBench.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 2013 Google Inc. 2 * Copyright 2013 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 void onDraw(const int loops, SkCanvas* canvas) override { 53 void onDraw(const int loops, SkCanvas* canvas) override {
54 SkPaint paint(fPaint); 54 SkPaint paint(fPaint);
55 this->setupPaint(&paint); 55 this->setupPaint(&paint);
56 56
57 paint.setAntiAlias(fFlags & kAA_Flag ? true : false); 57 paint.setAntiAlias(fFlags & kAA_Flag ? true : false);
58 58
59 SkPath path; 59 SkPath path;
60 this->makePath(&path); 60 this->makePath(&path);
61 if (fFlags & kBig_Flag) { 61 if (fFlags & kBig_Flag) {
62 SkMatrix m; 62 const SkMatrix m = SkMatrix::MakeScale(SkIntToScalar(3), SkIntToScal ar(3));
63 m.setScale(SkIntToScalar(3), SkIntToScalar(3));
64 path.transform(m); 63 path.transform(m);
65 } 64 }
66 65
67 for (int i = 0; i < loops; i++) { 66 for (int i = 0; i < loops; i++) {
68 canvas->drawPath(path, paint); 67 canvas->drawPath(path, paint);
69 } 68 }
70 } 69 }
71 70
72 private: 71 private:
73 SkPaint fPaint; 72 SkPaint fPaint;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Don't have default path renderer for conics yet on GPU, so must use AA 228 // Don't have default path renderer for conics yet on GPU, so must use AA
230 // DEF_BENCH( return new ConicPathBench(FLAGS00); ) 229 // DEF_BENCH( return new ConicPathBench(FLAGS00); )
231 // DEF_BENCH( return new ConicPathBench(FLAGS01); ) 230 // DEF_BENCH( return new ConicPathBench(FLAGS01); )
232 DEF_BENCH( return new ConicPathBench(FLAGS10); ) 231 DEF_BENCH( return new ConicPathBench(FLAGS10); )
233 DEF_BENCH( return new ConicPathBench(FLAGS11); ) 232 DEF_BENCH( return new ConicPathBench(FLAGS11); )
234 233
235 DEF_BENCH( return new CubicPathBench(FLAGS00); ) 234 DEF_BENCH( return new CubicPathBench(FLAGS00); )
236 DEF_BENCH( return new CubicPathBench(FLAGS01); ) 235 DEF_BENCH( return new CubicPathBench(FLAGS01); )
237 DEF_BENCH( return new CubicPathBench(FLAGS10); ) 236 DEF_BENCH( return new CubicPathBench(FLAGS10); )
238 DEF_BENCH( return new CubicPathBench(FLAGS11); ) 237 DEF_BENCH( return new CubicPathBench(FLAGS11); )
OLDNEW
« no previous file with comments | « bench/DashBench.cpp ('k') | bench/PathBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698