OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 /* | 26 /* |
27 * A Visual benchmarking tool for gpu benchmarking | 27 * A Visual benchmarking tool for gpu benchmarking |
28 */ | 28 */ |
29 class VisualBench : public SkOSWindow { | 29 class VisualBench : public SkOSWindow { |
30 public: | 30 public: |
31 VisualBench(void* hwnd, int argc, char** argv); | 31 VisualBench(void* hwnd, int argc, char** argv); |
32 ~VisualBench() override; | 32 ~VisualBench() override; |
33 | 33 |
34 void reset() { this->resetContext(); } | 34 void reset() { this->resetContext(); } |
35 | 35 |
| 36 void clear(SkCanvas* canvas, SkColor color, int frames); |
| 37 |
36 protected: | 38 protected: |
37 SkSurface* createSurface() override; | 39 SkSurface* createSurface() override; |
38 | 40 |
39 void draw(SkCanvas* canvas) override; | 41 void draw(SkCanvas* canvas) override; |
40 | 42 |
41 void onSizeChange() override; | 43 void onSizeChange() override; |
42 | 44 |
43 private: | 45 private: |
44 void setTitle(); | 46 void setTitle(); |
45 bool setupBackend(); | 47 bool setupBackend(); |
46 void resetContext(); | 48 void resetContext(); |
47 void setupRenderTarget(); | 49 void setupRenderTarget(); |
48 bool onHandleChar(SkUnichar unichar) override; | 50 bool onHandleChar(SkUnichar unichar) override; |
49 | 51 |
50 // support framework | 52 // support framework |
51 SkAutoTDelete<VisualModule> fModule; | 53 SkAutoTDelete<VisualModule> fModule; |
52 SkAutoTUnref<SkSurface> fSurface; | 54 SkAutoTUnref<SkSurface> fSurface; |
53 SkAutoTUnref<GrContext> fContext; | 55 SkAutoTUnref<GrContext> fContext; |
54 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 56 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
55 AttachmentInfo fAttachmentInfo; | 57 AttachmentInfo fAttachmentInfo; |
56 SkAutoTUnref<const GrGLInterface> fInterface; | 58 SkAutoTUnref<const GrGLInterface> fInterface; |
57 | 59 |
58 typedef SkOSWindow INHERITED; | 60 typedef SkOSWindow INHERITED; |
59 }; | 61 }; |
60 | 62 |
61 #endif | 63 #endif |
OLD | NEW |