OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "Viewer.h" | 8 #include "Viewer.h" |
9 | 9 |
10 #include "GMSlide.h" | 10 #include "GMSlide.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 SkIntToScalar(x), SkIntToScalar(endY), paint); | 350 SkIntToScalar(x), SkIntToScalar(endY), paint); |
351 i++; | 351 i++; |
352 i &= (kMeasurementCount - 1); // fast mod | 352 i &= (kMeasurementCount - 1); // fast mod |
353 x += xStep; | 353 x += xStep; |
354 } while (i != fCurrentMeasurement); | 354 } while (i != fCurrentMeasurement); |
355 | 355 |
356 canvas->restore(); | 356 canvas->restore(); |
357 } | 357 } |
358 | 358 |
359 void Viewer::onIdle(double ms) { | 359 void Viewer::onIdle(double ms) { |
360 // Record measurements | 360 if (ms > 1.0) { |
361 fMeasurements[fCurrentMeasurement++] = ms; | 361 // Record measurements |
362 fCurrentMeasurement &= (kMeasurementCount - 1); // fast mod | 362 fMeasurements[fCurrentMeasurement++] = ms; |
363 SkASSERT(fCurrentMeasurement < kMeasurementCount); | 363 fCurrentMeasurement &= (kMeasurementCount - 1); // fast mod |
| 364 SkASSERT(fCurrentMeasurement < kMeasurementCount); |
| 365 } |
364 | 366 |
365 fAnimTimer.updateTime(); | 367 fAnimTimer.updateTime(); |
366 if (fSlides[fCurrentSlide]->animate(fAnimTimer) || fDisplayStats) { | 368 if (fSlides[fCurrentSlide]->animate(fAnimTimer) || fDisplayStats) { |
367 fWindow->inval(); | 369 fWindow->inval(); |
368 } | 370 } |
369 } | 371 } |
OLD | NEW |