| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 | 47 |
| 48 void Benchmark::draw(const int loops, SkCanvas* canvas) { | 48 void Benchmark::draw(const int loops, SkCanvas* canvas) { |
| 49 SkAutoCanvasRestore ar(canvas, true/*save now*/); | 49 SkAutoCanvasRestore ar(canvas, true/*save now*/); |
| 50 this->onDraw(loops, canvas); | 50 this->onDraw(loops, canvas); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void Benchmark::setupPaint(SkPaint* paint) { | 53 void Benchmark::setupPaint(SkPaint* paint) { |
| 54 paint->setAlpha(fForceAlpha); | 54 paint->setAlpha(fForceAlpha); |
| 55 paint->setAntiAlias(true); | 55 paint->setAntiAlias(true); |
| 56 paint->setFilterLevel(SkPaint::kNone_FilterLevel); | 56 paint->setFilterQuality(kNone_SkFilterQuality); |
| 57 | 57 |
| 58 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); | 58 paint->setFlags((paint->getFlags() & ~fClearMask) | fOrMask); |
| 59 | 59 |
| 60 if (SkTriState::kDefault != fDither) { | 60 if (SkTriState::kDefault != fDither) { |
| 61 paint->setDither(SkTriState::kTrue == fDither); | 61 paint->setDither(SkTriState::kTrue == fDither); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 SkIPoint Benchmark::onGetSize() { | 65 SkIPoint Benchmark::onGetSize() { |
| 66 return SkIPoint::Make(640, 480); | 66 return SkIPoint::Make(640, 480); |
| 67 } | 67 } |
| OLD | NEW |