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

Side by Side Diff: tools/VisualBench/VisualInteractiveModule.h

Issue 1385073002: Create VisualStreamTimingModule (Closed) Base URL: https://skia.googlesource.com/skia.git@vb3a
Patch Set: feedback inc 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 | « tools/VisualBench/TimingStateMachine.h ('k') | tools/VisualBench/VisualInteractiveModule.cpp » ('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 *
7 */ 6 */
8 7
9 #ifndef VisualInteractiveModule_DEFINED 8 #ifndef VisualInteractiveModule_DEFINED
10 #define VisualInteractiveModule_DEFINED 9 #define VisualInteractiveModule_DEFINED
11 10
12 #include "VisualModule.h" 11 #include "VisualStreamTimingModule.h"
13
14 #include "ResultsWriter.h"
15 #include "SkPicture.h"
16 #include "Timer.h"
17 #include "TimingStateMachine.h"
18 #include "VisualBench.h"
19 #include "VisualBenchmarkStream.h"
20 12
21 class SkCanvas; 13 class SkCanvas;
22 14
23 /* 15 /*
24 * This module for VisualBench is designed to display stats data dynamically 16 * This module for VisualBench is designed to display stats data dynamically
25 */ 17 */
26 class VisualInteractiveModule : public VisualModule { 18 class VisualInteractiveModule : public VisualStreamTimingModule {
27 public: 19 public:
28 // TODO get rid of backpointer 20 // TODO get rid of backpointer
29 VisualInteractiveModule(VisualBench* owner); 21 VisualInteractiveModule(VisualBench* owner);
30 22
31 void draw(SkCanvas* canvas) override; 23 bool onHandleChar(SkUnichar c) override;
32 bool onHandleChar(SkUnichar unichar) override;
33 24
34 private: 25 private:
35 void setTitle();
36 bool setupBackend();
37 void setupRenderTarget();
38 void drawStats(SkCanvas*); 26 void drawStats(SkCanvas*);
39 bool advanceRecordIfNecessary(SkCanvas*); 27 void renderFrame(SkCanvas*, Benchmark*, int loops) override;
40 inline void renderFrame(SkCanvas*); 28 bool timingFinished(Benchmark*, int loops, double measurement) override;
41 29
42 static const int kMeasurementCount = 64; // should be power of 2 for fast m od 30 static const int kMeasurementCount = 64; // should be power of 2 for fast m od
43 double fMeasurements[kMeasurementCount]; 31 double fMeasurements[kMeasurementCount];
44 int fCurrentMeasurement; 32 int fCurrentMeasurement;
33 bool fAdvance;
45 34
46 SkAutoTDelete<VisualBenchmarkStream> fBenchmarkStream; 35 typedef VisualStreamTimingModule INHERITED;
47 SkAutoTUnref<Benchmark> fBenchmark;
48 TimingStateMachine fTSM;
49 bool fAdvance;
50 bool fHasBeenReset;
51
52 // support framework
53 SkAutoTUnref<VisualBench> fOwner;
54
55 typedef VisualModule INHERITED;
56 }; 36 };
57 37
58 #endif 38 #endif
OLDNEW
« no previous file with comments | « tools/VisualBench/TimingStateMachine.h ('k') | tools/VisualBench/VisualInteractiveModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698