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

Side by Side Diff: bench/RotatedRectBench.cpp

Issue 1015013004: Get rid of excess cleverness in benchmark (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 | « no previous file | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 protected: 77 protected:
78 const char* onGetName() SK_OVERRIDE { return fName.c_str(); } 78 const char* onGetName() SK_OVERRIDE { return fName.c_str(); }
79 79
80 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { 80 void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
81 SkPaint paint; 81 SkPaint paint;
82 paint.setAntiAlias(fAA); 82 paint.setAntiAlias(fAA);
83 paint.setXfermodeMode(fMode); 83 paint.setXfermodeMode(fMode);
84 SkColor color = start_color(fColorType); 84 SkColor color = start_color(fColorType);
85 85
86 int w = canvas->getBaseLayerSize().width(); 86 int w = this->getSize().x();
87 int h = canvas->getBaseLayerSize().height(); 87 int h = this->getSize().y();
88 88
89 static const SkScalar kRectW = 25.1f; 89 static const SkScalar kRectW = 25.1f;
90 static const SkScalar kRectH = 25.9f; 90 static const SkScalar kRectH = 25.9f;
91 91
92 SkMatrix rotate; 92 SkMatrix rotate;
93 // This value was chosen so that we frequently hit the axis-aligned case . 93 // This value was chosen so that we frequently hit the axis-aligned case .
94 rotate.setRotate(30.f, kRectW / 2, kRectH / 2); 94 rotate.setRotate(30.f, kRectW / 2, kRectH / 2);
95 SkMatrix m = rotate; 95 SkMatrix m = rotate;
96 96
97 SkScalar tx = 0, ty = 0; 97 SkScalar tx = 0, ty = 0;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 DEF_BENCH(return new RotRectBench(true, kConstantTransparent_ColorType, SkXfermode::kDarken_Mode);) 185 DEF_BENCH(return new RotRectBench(true, kConstantTransparent_ColorType, SkXfermode::kDarken_Mode);)
186 DEF_BENCH(return new RotRectBench(true, kChangingOpaque_ColorType, SkXfermode::kDarken_Mode);) 186 DEF_BENCH(return new RotRectBench(true, kChangingOpaque_ColorType, SkXfermode::kDarken_Mode);)
187 DEF_BENCH(return new RotRectBench(true, kChangingTransparent_ColorType, SkXfermode::kDarken_Mode);) 187 DEF_BENCH(return new RotRectBench(true, kChangingTransparent_ColorType, SkXfermode::kDarken_Mode);)
188 DEF_BENCH(return new RotRectBench(true, kAlternatingOpaqueAndTransparent_ColorT ype, SkXfermode::kDarken_Mode);) 188 DEF_BENCH(return new RotRectBench(true, kAlternatingOpaqueAndTransparent_ColorT ype, SkXfermode::kDarken_Mode);)
189 189
190 DEF_BENCH(return new RotRectBench(false, kConstantOpaque_ColorType, SkXfermode::kDarken_Mode);) 190 DEF_BENCH(return new RotRectBench(false, kConstantOpaque_ColorType, SkXfermode::kDarken_Mode);)
191 DEF_BENCH(return new RotRectBench(false, kConstantTransparent_ColorType, SkXfermode::kDarken_Mode);) 191 DEF_BENCH(return new RotRectBench(false, kConstantTransparent_ColorType, SkXfermode::kDarken_Mode);)
192 DEF_BENCH(return new RotRectBench(false, kChangingOpaque_ColorType, SkXfermode::kDarken_Mode);) 192 DEF_BENCH(return new RotRectBench(false, kChangingOpaque_ColorType, SkXfermode::kDarken_Mode);)
193 DEF_BENCH(return new RotRectBench(false, kChangingTransparent_ColorType, SkXfermode::kDarken_Mode);) 193 DEF_BENCH(return new RotRectBench(false, kChangingTransparent_ColorType, SkXfermode::kDarken_Mode);)
194 DEF_BENCH(return new RotRectBench(false, kAlternatingOpaqueAndTransparent_ColorT ype, SkXfermode::kDarken_Mode);) 194 DEF_BENCH(return new RotRectBench(false, kAlternatingOpaqueAndTransparent_ColorT ype, SkXfermode::kDarken_Mode);)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698