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 17 matching lines...) Expand all Loading... |
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); | 36 void clear(SkCanvas* canvas, SkColor color, int frames); |
37 | 37 |
| 38 const Configs::Config& currentConfig() const { return fConfigs.current(); } |
| 39 bool nextConfig() { return fConfigs.next(); } |
| 40 |
38 protected: | 41 protected: |
39 SkSurface* createSurface() override; | 42 SkSurface* createSurface() override; |
40 | 43 |
41 void draw(SkCanvas* canvas) override; | 44 void draw(SkCanvas* canvas) override; |
42 | 45 |
43 void onSizeChange() override; | 46 void onSizeChange() override; |
44 | 47 |
45 private: | 48 private: |
46 void setTitle(); | 49 void setTitle(); |
47 bool setupBackend(); | 50 bool setupBackend(); |
48 void resetContext(); | 51 void resetContext(); |
49 void setupRenderTarget(); | 52 void setupRenderTarget(); |
50 bool onHandleChar(SkUnichar unichar) override; | 53 bool onHandleChar(SkUnichar unichar) override; |
51 void tearDownContext(); | 54 void tearDownContext(); |
52 void setupContext(); | 55 void setupContext(); |
53 | 56 |
54 // support framework | 57 Configs fConfigs; |
55 SkAutoTDelete<VisualModule> fModule; | 58 SkAutoTDelete<VisualModule> fModule; |
56 SkAutoTUnref<SkSurface> fSurface; | 59 SkAutoTUnref<SkSurface> fSurface; |
57 SkAutoTUnref<GrContext> fContext; | 60 SkAutoTUnref<GrContext> fContext; |
58 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 61 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
59 AttachmentInfo fAttachmentInfo; | 62 AttachmentInfo fAttachmentInfo; |
60 SkAutoTUnref<const GrGLInterface> fInterface; | 63 SkAutoTUnref<const GrGLInterface> fInterface; |
61 | 64 |
62 typedef SkOSWindow INHERITED; | 65 typedef SkOSWindow INHERITED; |
63 }; | 66 }; |
64 | 67 |
65 #endif | 68 #endif |
OLD | NEW |