| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 312 } |
| 313 case Window::kDown_InputState: { | 313 case Window::kDown_InputState: { |
| 314 fGesture.touchBegin(castedOwner, touchPoint.fX, touchPoint.fY); | 314 fGesture.touchBegin(castedOwner, touchPoint.fX, touchPoint.fY); |
| 315 break; | 315 break; |
| 316 } | 316 } |
| 317 case Window::kMove_InputState: { | 317 case Window::kMove_InputState: { |
| 318 fGesture.touchMoved(castedOwner, touchPoint.fX, touchPoint.fY); | 318 fGesture.touchMoved(castedOwner, touchPoint.fX, touchPoint.fY); |
| 319 break; | 319 break; |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 fWindow->inval(); | 322 fWindow->checkAndInval(); |
| 323 return true; | 323 return true; |
| 324 } | 324 } |
| 325 | 325 |
| 326 void Viewer::drawStats(SkCanvas* canvas) { | 326 void Viewer::drawStats(SkCanvas* canvas) { |
| 327 static const float kPixelPerMS = 2.0f; | 327 static const float kPixelPerMS = 2.0f; |
| 328 static const int kDisplayWidth = 130; | 328 static const int kDisplayWidth = 130; |
| 329 static const int kDisplayHeight = 100; | 329 static const int kDisplayHeight = 100; |
| 330 static const int kDisplayPadding = 10; | 330 static const int kDisplayPadding = 10; |
| 331 static const int kGraphPadding = 3; | 331 static const int kGraphPadding = 3; |
| 332 static const SkScalar kBaseMS = 1000.f / 60.f; // ms/frame to hit 60 fps | 332 static const SkScalar kBaseMS = 1000.f / 60.f; // ms/frame to hit 60 fps |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // Record measurements | 375 // Record measurements |
| 376 fMeasurements[fCurrentMeasurement++] = ms; | 376 fMeasurements[fCurrentMeasurement++] = ms; |
| 377 fCurrentMeasurement &= (kMeasurementCount - 1); // fast mod | 377 fCurrentMeasurement &= (kMeasurementCount - 1); // fast mod |
| 378 SkASSERT(fCurrentMeasurement < kMeasurementCount); | 378 SkASSERT(fCurrentMeasurement < kMeasurementCount); |
| 379 | 379 |
| 380 fAnimTimer.updateTime(); | 380 fAnimTimer.updateTime(); |
| 381 if (fSlides[fCurrentSlide]->animate(fAnimTimer) || fDisplayStats) { | 381 if (fSlides[fCurrentSlide]->animate(fAnimTimer) || fDisplayStats) { |
| 382 fWindow->inval(); | 382 fWindow->inval(); |
| 383 } | 383 } |
| 384 } | 384 } |
| OLD | NEW |