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

Side by Side Diff: bench/DashBench.cpp

Issue 216493005: Remove scaleToFit from DashPathEffect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dummy Read/writes Created 6 years, 8 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 | gm/dashing.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 /* 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 "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 SkAutoTUnref<SkPathEffect> fPathEffect; 256 SkAutoTUnref<SkPathEffect> fPathEffect;
257 257
258 public: 258 public:
259 DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA) 259 DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA)
260 { 260 {
261 fName.printf("drawpointsdash_%d_%d%s", dashLength, strokeWidth, doAA ? " _aa" : "_bw"); 261 fName.printf("drawpointsdash_%d_%d%s", dashLength, strokeWidth, doAA ? " _aa" : "_bw");
262 fStrokeWidth = strokeWidth; 262 fStrokeWidth = strokeWidth;
263 fDoAA = doAA; 263 fDoAA = doAA;
264 264
265 SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength) }; 265 SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength) };
266 fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1, false)); 266 fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1));
267 } 267 }
268 268
269 protected: 269 protected:
270 virtual const char* onGetName() SK_OVERRIDE { 270 virtual const char* onGetName() SK_OVERRIDE {
271 return fName.c_str(); 271 return fName.c_str();
272 } 272 }
273 273
274 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { 274 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
275 SkPaint p; 275 SkPaint p;
276 this->setupPaint(&p); 276 this->setupPaint(&p);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 0); ) 409 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 0); )
410 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 0); ) 410 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 0); )
411 411
412 // pass 2 to explicitly avoid any 1-is-the-same-as-hairline special casing 412 // pass 2 to explicitly avoid any 1-is-the-same-as-hairline special casing
413 413
414 // hori_2 is just too slow to enable at the moment 414 // hori_2 is just too slow to enable at the moment
415 DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); ) 415 DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); )
416 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); ) 416 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); )
417 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); ) 417 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); )
418 #endif 418 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/dashing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698