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

Side by Side Diff: tools/VisualBench.h

Issue 1159213002: Expand VisualBench to a real benching tool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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 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 8
9 #ifndef VisualBench_DEFINED 9 #ifndef VisualBench_DEFINED
10 #define VisualBench_DEFINED 10 #define VisualBench_DEFINED
(...skipping 20 matching lines...) Expand all
31 protected: 31 protected:
32 SkSurface* createSurface() override; 32 SkSurface* createSurface() override;
33 33
34 void draw(SkCanvas* canvas) override; 34 void draw(SkCanvas* canvas) override;
35 35
36 void onSizeChange() override; 36 void onSizeChange() override;
37 37
38 private: 38 private:
39 void setTitle(); 39 void setTitle();
40 bool setupBackend(); 40 bool setupBackend();
41 void resetContext();
41 void setupRenderTarget(); 42 void setupRenderTarget();
42 bool onHandleChar(SkUnichar unichar) override; 43 bool onHandleChar(SkUnichar unichar) override;
44 void timeFrame(SkCanvas*);
45 void printStats();
43 46
44 int fCurrentLoops; 47 struct Timing {
48 SkString fName;
49 SkTArray<double> fMeasurements;
50 };
51
45 int fCurrentPicture; 52 int fCurrentPicture;
46 int fCurrentFrame; 53 int fCurrentFrame;
54 SkTArray<Timing> fTimings;
47 SkTArray<SkPicture*> fPictures; 55 SkTArray<SkPicture*> fPictures;
48 56
49 // support framework 57 // support framework
50 SkAutoTUnref<SkSurface> fSurface; 58 SkAutoTUnref<SkSurface> fSurface;
51 SkAutoTUnref<GrContext> fContext; 59 SkAutoTUnref<GrContext> fContext;
52 SkAutoTUnref<GrRenderTarget> fRenderTarget; 60 SkAutoTUnref<GrRenderTarget> fRenderTarget;
53 AttachmentInfo fAttachmentInfo; 61 AttachmentInfo fAttachmentInfo;
54 SkAutoTUnref<const GrGLInterface> fInterface; 62 SkAutoTUnref<const GrGLInterface> fInterface;
55 63
56 typedef SkOSWindow INHERITED; 64 typedef SkOSWindow INHERITED;
57 }; 65 };
58 66
59 #endif 67 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698