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

Side by Side Diff: tools/VisualBench/TimingStateMachine.cpp

Issue 1387823004: Fix for visualbench loops forever (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "TimingStateMachine.h" 8 #include "TimingStateMachine.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 30 matching lines...) Expand all
41 if (1 << 30 == fLoops) { 41 if (1 << 30 == fLoops) {
42 // We're about to wrap. Something's wrong with the benc h. 42 // We're about to wrap. Something's wrong with the benc h.
43 SkDebugf("InnerLoops wrapped\n"); 43 SkDebugf("InnerLoops wrapped\n");
44 fLoops = 1; 44 fLoops = 1;
45 } else { 45 } else {
46 double elapsedMs = this->elapsed(); 46 double elapsedMs = this->elapsed();
47 if (elapsedMs < FLAGS_loopMs) { 47 if (elapsedMs < FLAGS_loopMs) {
48 fLoops *= 2; 48 fLoops *= 2;
49 } else { 49 } else {
50 fInnerState = kTiming_InnerState; 50 fInnerState = kTiming_InnerState;
51 fState = kPreWarm_State;
52 } 51 }
52 fState = kPreWarm_State;
53 this->resetTimingState(); 53 this->resetTimingState();
54 parentEvent = kReset_ParentEvents; 54 parentEvent = kReset_ParentEvents;
55 } 55 }
56 break; 56 break;
57 } 57 }
58 case kTiming_InnerState: { 58 case kTiming_InnerState: {
59 if (fCurrentFrame >= FLAGS_frames) { 59 if (fCurrentFrame >= FLAGS_frames) {
60 this->recordMeasurement(); 60 this->recordMeasurement();
61 this->resetTimingState(); 61 this->resetTimingState();
62 parentEvent = kTimingFinished_ParentEvents; 62 parentEvent = kTimingFinished_ParentEvents;
(...skipping 28 matching lines...) Expand all
91 fLastMeasurement = this->elapsed() / (FLAGS_frames * fLoops); 91 fLastMeasurement = this->elapsed() / (FLAGS_frames * fLoops);
92 } 92 }
93 93
94 void TimingStateMachine::nextBenchmark(SkCanvas* canvas, Benchmark* benchmark) { 94 void TimingStateMachine::nextBenchmark(SkCanvas* canvas, Benchmark* benchmark) {
95 benchmark->postDraw(canvas); 95 benchmark->postDraw(canvas);
96 benchmark->perCanvasPostDraw(canvas); 96 benchmark->perCanvasPostDraw(canvas);
97 fLoops = 1; 97 fLoops = 1;
98 fInnerState = kTuning_InnerState; 98 fInnerState = kTuning_InnerState;
99 fState = kPreWarm_State; 99 fState = kPreWarm_State;
100 } 100 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698