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

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

Issue 1999213002: Add Xlib support to viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix line lengths Created 4 years, 6 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
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698