Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: tools/viewer/Viewer.cpp

Issue 2001153002: Move inval dedup to Window for wider usages. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/viewer/sk_app/CommandSet.cpp » ('j') | tools/viewer/sk_app/Window.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tools/viewer/sk_app/CommandSet.cpp » ('j') | tools/viewer/sk_app/Window.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698