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

Side by Side Diff: bench/SkBenchmark.cpp

Issue 321723002: Reland "Clean up Test's resourcePath code." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ETCBitmapBench fix 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 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkParse.h" 9 #include "SkParse.h"
10 10
11 const char* SkTriState::Name[] = { "default", "true", "false" }; 11 const char* SkTriState::Name[] = { "default", "true", "false" };
12 12
13 template BenchRegistry* BenchRegistry::gHead; 13 template BenchRegistry* BenchRegistry::gHead;
14 14
15 SkString SkBenchmark::gResourcePath; 15 const char* SkBenchmark::gResourcePath;
16 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() {
(...skipping 22 matching lines...) Expand all
48 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel 48 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel
49 : SkPaint::kNone_FilterLevel); 49 : SkPaint::kNone_FilterLevel);
50 50
51 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); 51 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask);
52 52
53 if (SkTriState::kDefault != fDither) { 53 if (SkTriState::kDefault != fDither) {
54 paint->setDither(SkTriState::kTrue == fDither); 54 paint->setDither(SkTriState::kTrue == fDither);
55 } 55 }
56 } 56 }
57 57
58 void SkBenchmark::SetResourcePath(const char* resourcePath) {
59 gResourcePath = resourcePath;
60 }
61
62 SkString SkBenchmark::GetResourcePath() {
63 return SkString(gResourcePath);
64 }
58 65
59 /////////////////////////////////////////////////////////////////////////////// 66 ///////////////////////////////////////////////////////////////////////////////
60 67
61 SkIPoint SkBenchmark::onGetSize() { 68 SkIPoint SkBenchmark::onGetSize() {
62 return SkIPoint::Make(640, 480); 69 return SkIPoint::Make(640, 480);
63 } 70 }
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