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 | 7 |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 const char* Benchmark::getUniqueName() { | 28 const char* Benchmark::getUniqueName() { |
29 return this->onGetUniqueName(); | 29 return this->onGetUniqueName(); |
30 } | 30 } |
31 | 31 |
32 SkIPoint Benchmark::getSize() { | 32 SkIPoint Benchmark::getSize() { |
33 return this->onGetSize(); | 33 return this->onGetSize(); |
34 } | 34 } |
35 | 35 |
36 void Benchmark::preDraw() { | 36 void Benchmark::delayedSetup() { |
37 this->onPreDraw(); | 37 this->onDelayedSetup(); |
38 } | 38 } |
39 | 39 |
40 void Benchmark::perCanvasPreDraw(SkCanvas* canvas) { | 40 void Benchmark::perCanvasPreDraw(SkCanvas* canvas) { |
41 this->onPerCanvasPreDraw(canvas); | 41 this->onPerCanvasPreDraw(canvas); |
42 } | 42 } |
43 | 43 |
| 44 void Benchmark::preDraw(SkCanvas* canvas) { |
| 45 this->onPreDraw(canvas); |
| 46 } |
| 47 |
| 48 void Benchmark::postDraw(SkCanvas* canvas) { |
| 49 this->onPostDraw(canvas); |
| 50 } |
| 51 |
44 void Benchmark::perCanvasPostDraw(SkCanvas* canvas) { | 52 void Benchmark::perCanvasPostDraw(SkCanvas* canvas) { |
45 this->onPerCanvasPostDraw(canvas); | 53 this->onPerCanvasPostDraw(canvas); |
46 } | 54 } |
47 | 55 |
48 void Benchmark::draw(const int loops, SkCanvas* canvas) { | 56 void Benchmark::draw(const int loops, SkCanvas* canvas) { |
49 SkAutoCanvasRestore ar(canvas, true/*save now*/); | 57 SkAutoCanvasRestore ar(canvas, true/*save now*/); |
50 this->onDraw(loops, canvas); | 58 this->onDraw(loops, canvas); |
51 } | 59 } |
52 | 60 |
53 void Benchmark::setupPaint(SkPaint* paint) { | 61 void Benchmark::setupPaint(SkPaint* paint) { |
54 paint->setAlpha(fForceAlpha); | 62 paint->setAlpha(fForceAlpha); |
55 paint->setAntiAlias(true); | 63 paint->setAntiAlias(true); |
56 paint->setFilterQuality(kNone_SkFilterQuality); | 64 paint->setFilterQuality(kNone_SkFilterQuality); |
57 | 65 |
58 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); | 66 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); |
59 | 67 |
60 if (SkTriState::kDefault != fDither) { | 68 if (SkTriState::kDefault != fDither) { |
61 paint->setDither(SkTriState::kTrue == fDither); | 69 paint->setDither(SkTriState::kTrue == fDither); |
62 } | 70 } |
63 } | 71 } |
64 | 72 |
65 SkIPoint Benchmark::onGetSize() { | 73 SkIPoint Benchmark::onGetSize() { |
66 return SkIPoint::Make(640, 480); | 74 return SkIPoint::Make(640, 480); |
67 } | 75 } |
OLD | NEW |