OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |