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 |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 void SkBenchmark::preDraw() { | 33 void SkBenchmark::preDraw() { |
34 this->onPreDraw(); | 34 this->onPreDraw(); |
35 } | 35 } |
36 | 36 |
37 void SkBenchmark::draw(const int loops, SkCanvas* canvas) { | 37 void SkBenchmark::draw(const int loops, SkCanvas* canvas) { |
38 this->onDraw(loops, canvas); | 38 this->onDraw(loops, canvas); |
39 } | 39 } |
40 | 40 |
41 void SkBenchmark::postDraw() { | |
42 this->onPostDraw(); | |
43 } | |
44 | |
45 void SkBenchmark::setupPaint(SkPaint* paint) { | 41 void SkBenchmark::setupPaint(SkPaint* paint) { |
46 paint->setAlpha(fForceAlpha); | 42 paint->setAlpha(fForceAlpha); |
47 paint->setAntiAlias(fForceAA); | 43 paint->setAntiAlias(fForceAA); |
48 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel | 44 paint->setFilterLevel(fForceFilter ? SkPaint::kLow_FilterLevel |
49 : SkPaint::kNone_FilterLevel); | 45 : SkPaint::kNone_FilterLevel); |
50 | 46 |
51 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); | 47 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); |
52 | 48 |
53 if (SkTriState::kDefault != fDither) { | 49 if (SkTriState::kDefault != fDither) { |
54 paint->setDither(SkTriState::kTrue == fDither); | 50 paint->setDither(SkTriState::kTrue == fDither); |
55 } | 51 } |
56 } | 52 } |
57 | 53 |
58 void SkBenchmark::SetResourcePath(const char* resourcePath) { | 54 void SkBenchmark::SetResourcePath(const char* resourcePath) { |
59 gResourcePath = resourcePath; | 55 gResourcePath = resourcePath; |
60 } | 56 } |
61 | 57 |
62 SkString SkBenchmark::GetResourcePath() { | 58 SkString SkBenchmark::GetResourcePath() { |
63 return SkString(gResourcePath); | 59 return SkString(gResourcePath); |
64 } | 60 } |
65 | 61 |
66 /////////////////////////////////////////////////////////////////////////////// | 62 /////////////////////////////////////////////////////////////////////////////// |
67 | 63 |
68 SkIPoint SkBenchmark::onGetSize() { | 64 SkIPoint SkBenchmark::onGetSize() { |
69 return SkIPoint::Make(640, 480); | 65 return SkIPoint::Make(640, 480); |
70 } | 66 } |
OLD | NEW |