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

Side by Side Diff: bench/SkBenchmark.cpp

Issue 346453002: Refactor how we handle resources path in Tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rebase conflict Created 6 years, 6 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/SkBenchmark.h ('k') | bench/SkipZeroesBench.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 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9
8 #include "SkPaint.h" 10 #include "SkPaint.h"
9 #include "SkParse.h" 11 #include "SkParse.h"
10 12
11 const char* SkTriState::Name[] = { "default", "true", "false" }; 13 const char* SkTriState::Name[] = { "default", "true", "false" };
12 14
13 template BenchRegistry* BenchRegistry::gHead; 15 template BenchRegistry* BenchRegistry::gHead;
14 16
15 const char* SkBenchmark::gResourcePath;
16
17 SkBenchmark::SkBenchmark() { 17 SkBenchmark::SkBenchmark() {
18 fForceAlpha = 0xFF; 18 fForceAlpha = 0xFF;
19 fForceAA = true; 19 fForceAA = true;
20 fForceFilter = false; 20 fForceFilter = false;
21 fDither = SkTriState::kDefault; 21 fDither = SkTriState::kDefault;
22 fOrMask = fClearMask = 0; 22 fOrMask = fClearMask = 0;
23 } 23 }
24 24
25 const char* SkBenchmark::getName() { 25 const char* SkBenchmark::getName() {
26 return this->onGetName(); 26 return this->onGetName();
(...skipping 17 matching lines...) Expand all
44 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel 44 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel
45 : SkPaint::kNone_FilterLevel); 45 : SkPaint::kNone_FilterLevel);
46 46
47 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); 47 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask);
48 48
49 if (SkTriState::kDefault != fDither) { 49 if (SkTriState::kDefault != fDither) {
50 paint->setDither(SkTriState::kTrue == fDither); 50 paint->setDither(SkTriState::kTrue == fDither);
51 } 51 }
52 } 52 }
53 53
54 void SkBenchmark::SetResourcePath(const char* resourcePath) {
55 gResourcePath = resourcePath;
56 }
57
58 SkString SkBenchmark::GetResourcePath() {
59 return SkString(gResourcePath);
60 }
61
62 ///////////////////////////////////////////////////////////////////////////////
63
64 SkIPoint SkBenchmark::onGetSize() { 54 SkIPoint SkBenchmark::onGetSize() {
65 return SkIPoint::Make(640, 480); 55 return SkIPoint::Make(640, 480);
66 } 56 }
OLDNEW
« no previous file with comments | « bench/SkBenchmark.h ('k') | bench/SkipZeroesBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698