| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 8 |
| 9 #include "VisualLightweightBenchModule.h" | 9 #include "VisualLightweightBenchModule.h" |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 bool VisualLightweightBenchModule::advanceRecordIfNecessary(SkCanvas* canvas) { | 120 bool VisualLightweightBenchModule::advanceRecordIfNecessary(SkCanvas* canvas) { |
| 121 if (fBenchmark) { | 121 if (fBenchmark) { |
| 122 return true; | 122 return true; |
| 123 } | 123 } |
| 124 | 124 |
| 125 fBenchmark.reset(fBenchmarkStream->next()); | 125 fBenchmark.reset(fBenchmarkStream->next()); |
| 126 if (!fBenchmark) { | 126 if (!fBenchmark) { |
| 127 return false; | 127 return false; |
| 128 } | 128 } |
| 129 | 129 |
| 130 canvas->clear(0xffffffff); | 130 fOwner->clear(canvas, SK_ColorWHITE, 2); |
| 131 |
| 132 |
| 131 fBenchmark->preDraw(); | 133 fBenchmark->preDraw(); |
| 132 fRecords.push_back(); | 134 fRecords.push_back(); |
| 133 | 135 |
| 134 // Log bench name | 136 // Log bench name |
| 135 fResults->bench(fBenchmark->getUniqueName(), fBenchmark->getSize().fX, | 137 fResults->bench(fBenchmark->getUniqueName(), fBenchmark->getSize().fX, |
| 136 fBenchmark->getSize().fY); | 138 fBenchmark->getSize().fY); |
| 137 return true; | 139 return true; |
| 138 } | 140 } |
| 139 | 141 |
| 140 inline void VisualLightweightBenchModule::nextState(State nextState) { | 142 inline void VisualLightweightBenchModule::nextState(State nextState) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 this->postDraw(canvas); | 249 this->postDraw(canvas); |
| 248 this->nextState(kPreWarmLoopsPerCanvasPreDraw_State); | 250 this->nextState(kPreWarmLoopsPerCanvasPreDraw_State); |
| 249 } else { | 251 } else { |
| 250 this->nextState(kPreWarmTimingPerCanvasPreDraw_State); | 252 this->nextState(kPreWarmTimingPerCanvasPreDraw_State); |
| 251 } | 253 } |
| 252 this->resetTimingState(); | 254 this->resetTimingState(); |
| 253 } else { | 255 } else { |
| 254 fCurrentFrame++; | 256 fCurrentFrame++; |
| 255 } | 257 } |
| 256 } | 258 } |
| 259 |
| 260 bool VisualLightweightBenchModule::onHandleChar(SkUnichar c) { |
| 261 return true; |
| 262 } |
| OLD | NEW |