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

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

Issue 1421723004: Add visualbench option for device-independent fonts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « tools/VisualBench/VisualBenchmarkStream.cpp ('k') | tools/VisualBench/WrappedBenchmark.h » ('j') | 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 "VisualStreamTimingModule.h" 8 #include "VisualStreamTimingModule.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 11
12 VisualStreamTimingModule::VisualStreamTimingModule(VisualBench* owner, bool preW armBeforeSample) 12 VisualStreamTimingModule::VisualStreamTimingModule(VisualBench* owner, bool preW armBeforeSample)
13 : fInitState(kReset_InitState) 13 : fInitState(kReset_InitState)
14 , fPreWarmBeforeSample(preWarmBeforeSample) 14 , fPreWarmBeforeSample(preWarmBeforeSample)
15 , fOwner(owner) { 15 , fOwner(owner) {
16 fBenchmarkStream.reset(new VisualBenchmarkStream); 16 fBenchmarkStream.reset(new VisualBenchmarkStream(owner->getSurfaceProps()));
17 } 17 }
18 18
19 inline void VisualStreamTimingModule::handleInitState(SkCanvas* canvas) { 19 inline void VisualStreamTimingModule::handleInitState(SkCanvas* canvas) {
20 switch (fInitState) { 20 switch (fInitState) {
21 case kNewBenchmark_InitState: 21 case kNewBenchmark_InitState:
22 fBenchmarkStream->current()->delayedSetup(); 22 fBenchmarkStream->current()->delayedSetup();
23 // fallthrough 23 // fallthrough
24 case kReset_InitState: 24 case kReset_InitState:
25 // This will flicker unfortunately, but as we are reseting the GLCon text each bench, 25 // This will flicker unfortunately, but as we are reseting the GLCon text each bench,
26 // we unfortunately don't have a choice 26 // we unfortunately don't have a choice
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // TODO research why this does happen on mac 68 // TODO research why this does happen on mac
69 return; 69 return;
70 } 70 }
71 71
72 this->handleInitState(canvas); 72 this->handleInitState(canvas);
73 this->renderFrame(canvas, fBenchmarkStream->current(), fTSM.loops()); 73 this->renderFrame(canvas, fBenchmarkStream->current(), fTSM.loops());
74 fOwner->present(); 74 fOwner->present();
75 TimingStateMachine::ParentEvents event = fTSM.nextFrame(fPreWarmBeforeSample ); 75 TimingStateMachine::ParentEvents event = fTSM.nextFrame(fPreWarmBeforeSample );
76 this->handleTimingEvent(canvas, event); 76 this->handleTimingEvent(canvas, event);
77 } 77 }
OLDNEW
« no previous file with comments | « tools/VisualBench/VisualBenchmarkStream.cpp ('k') | tools/VisualBench/WrappedBenchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698