OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #ifndef Window_DEFINED | 8 #ifndef Window_DEFINED |
9 #define Window_DEFINED | 9 #define Window_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 class SkCanvas; | 13 class SkCanvas; |
14 class VulkanTestContext; | 14 class VulkanTestContext; |
15 | 15 |
16 class Window { | 16 class Window { |
17 public: | 17 public: |
18 static Window* CreateNativeWindow(void* platformData); | 18 static Window* CreateNativeWindow(void* platformData); |
19 | 19 |
20 virtual ~Window() {}; | 20 virtual ~Window() {}; |
21 | 21 |
22 virtual void setTitle(const char*) = 0; | 22 virtual void setTitle(const char*) = 0; |
23 virtual void show() = 0; | 23 virtual void show() = 0; |
24 | 24 |
25 struct AttachmentInfo { | 25 struct AttachmentInfo { |
26 int fSampleCount; | 26 int fSampleCount; |
27 int fStencilBits; | 27 int fStencilBits; |
28 }; | 28 }; |
29 | 29 |
30 enum BackEndTypes { | 30 enum BackEndType { |
31 kNativeGL_BackendType, | 31 kNativeGL_BackendType, |
32 kVulkan_BackendType | 32 kVulkan_BackendType |
33 }; | 33 }; |
34 | 34 |
35 virtual bool attach(BackEndTypes attachType, int msaaSampleCount, Attachment
Info*) = 0; | 35 virtual bool attach(BackEndType attachType, int msaaSampleCount, AttachmentI
nfo*) = 0; |
36 void detach(); | 36 void detach(); |
37 | 37 |
38 // input handling | 38 // input handling |
39 enum Key { | 39 enum Key { |
40 kNONE_Key, //corresponds to android's UNKNOWN | 40 kNONE_Key, //corresponds to android's UNKNOWN |
41 | 41 |
42 kLeftSoftKey_Key, | 42 kLeftSoftKey_Key, |
43 kRightSoftKey_Key, | 43 kRightSoftKey_Key, |
44 | 44 |
45 kHome_Key, //!< the home key - added to match android | 45 kHome_Key, //!< the home key - added to match android |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 OnMouseFunc fMouseFunc; | 132 OnMouseFunc fMouseFunc; |
133 void* fMouseUserData; | 133 void* fMouseUserData; |
134 OnPaintFunc fPaintFunc; | 134 OnPaintFunc fPaintFunc; |
135 void* fPaintUserData; | 135 void* fPaintUserData; |
136 | 136 |
137 VulkanTestContext* fTestContext; | 137 VulkanTestContext* fTestContext; |
138 }; | 138 }; |
139 | 139 |
140 | 140 |
141 #endif | 141 #endif |
OLD | NEW |