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

Side by Side Diff: bench/Benchmark.cpp

Issue 375863006: Remove useless options from bench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed build. Dunno why it didn't show up with "make tools" Created 6 years, 5 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/Benchmark.h ('k') | bench/benchmain.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 2011 Google Inc. 2 * Copyright 2011 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 9
10 #include "SkPaint.h" 10 #include "SkPaint.h"
11 #include "SkParse.h" 11 #include "SkParse.h"
12 12
13 const char* SkTriState::Name[] = { "default", "true", "false" }; 13 const char* SkTriState::Name[] = { "default", "true", "false" };
14 14
15 template BenchRegistry* BenchRegistry::gHead; 15 template BenchRegistry* BenchRegistry::gHead;
16 16
17 Benchmark::Benchmark() { 17 Benchmark::Benchmark() {
18 fForceAlpha = 0xFF; 18 fForceAlpha = 0xFF;
19 fForceAA = true;
20 fForceFilter = false;
21 fDither = SkTriState::kDefault; 19 fDither = SkTriState::kDefault;
22 fOrMask = fClearMask = 0; 20 fOrMask = fClearMask = 0;
23 } 21 }
24 22
25 const char* Benchmark::getName() { 23 const char* Benchmark::getName() {
26 return this->onGetName(); 24 return this->onGetName();
27 } 25 }
28 26
29 SkIPoint Benchmark::getSize() { 27 SkIPoint Benchmark::getSize() {
30 return this->onGetSize(); 28 return this->onGetSize();
31 } 29 }
32 30
33 void Benchmark::preDraw() { 31 void Benchmark::preDraw() {
34 this->onPreDraw(); 32 this->onPreDraw();
35 } 33 }
36 34
37 void Benchmark::draw(const int loops, SkCanvas* canvas) { 35 void Benchmark::draw(const int loops, SkCanvas* canvas) {
38 this->onDraw(loops, canvas); 36 this->onDraw(loops, canvas);
39 } 37 }
40 38
41 void Benchmark::setupPaint(SkPaint* paint) { 39 void Benchmark::setupPaint(SkPaint* paint) {
42 paint->setAlpha(fForceAlpha); 40 paint->setAlpha(fForceAlpha);
43 paint->setAntiAlias(fForceAA); 41 paint->setAntiAlias(true);
44 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel 42 paint->setFilterLevel(SkPaint::kNone_FilterLevel);
45 : SkPaint::kNone_FilterLevel);
46 43
47 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); 44 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask);
48 45
49 if (SkTriState::kDefault != fDither) { 46 if (SkTriState::kDefault != fDither) {
50 paint->setDither(SkTriState::kTrue == fDither); 47 paint->setDither(SkTriState::kTrue == fDither);
51 } 48 }
52 } 49 }
53 50
54 SkIPoint Benchmark::onGetSize() { 51 SkIPoint Benchmark::onGetSize() {
55 return SkIPoint::Make(640, 480); 52 return SkIPoint::Make(640, 480);
56 } 53 }
OLDNEW
« no previous file with comments | « bench/Benchmark.h ('k') | bench/benchmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698