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 |
(...skipping 15 matching lines...) Expand all Loading... |
26 virtual ~Window() {}; | 26 virtual ~Window() {}; |
27 | 27 |
28 virtual void setTitle(const char*) = 0; | 28 virtual void setTitle(const char*) = 0; |
29 virtual void show() = 0; | 29 virtual void show() = 0; |
30 virtual void inval() = 0; | 30 virtual void inval() = 0; |
31 | 31 |
32 virtual bool scaleContentToFit() const { return false; } | 32 virtual bool scaleContentToFit() const { return false; } |
33 virtual bool supportsContentRect() const { return false; } | 33 virtual bool supportsContentRect() const { return false; } |
34 virtual SkRect getContentRect() { return SkRect::MakeEmpty(); } | 34 virtual SkRect getContentRect() { return SkRect::MakeEmpty(); } |
35 | 35 |
36 enum BackEndType { | 36 enum BackendType { |
37 kNativeGL_BackendType, | 37 kNativeGL_BackendType, |
38 kVulkan_BackendType | 38 kVulkan_BackendType, |
| 39 |
| 40 kLast_BackendType = kVulkan_BackendType |
| 41 }; |
| 42 enum { |
| 43 kBackendTypeCount = kLast_BackendType + 1 |
39 }; | 44 }; |
40 | 45 |
41 virtual bool attach(BackEndType attachType, const DisplayParams& params) =
0; | 46 virtual bool attach(BackendType attachType, const DisplayParams& params) =
0; |
42 void detach(); | 47 void detach(); |
43 | 48 |
44 // input handling | 49 // input handling |
45 enum class Key { | 50 enum class Key { |
46 kNONE, //corresponds to android's UNKNOWN | 51 kNONE, //corresponds to android's UNKNOWN |
47 | 52 |
48 kLeftSoftKey, | 53 kLeftSoftKey, |
49 kRightSoftKey, | 54 kRightSoftKey, |
50 | 55 |
51 kHome, //!< the home key - added to match android | 56 kHome, //!< the home key - added to match android |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 OnTouchFunc fTouchFunc; | 161 OnTouchFunc fTouchFunc; |
157 void* fTouchUserData; | 162 void* fTouchUserData; |
158 OnPaintFunc fPaintFunc; | 163 OnPaintFunc fPaintFunc; |
159 void* fPaintUserData; | 164 void* fPaintUserData; |
160 | 165 |
161 WindowContext* fWindowContext = nullptr; | 166 WindowContext* fWindowContext = nullptr; |
162 }; | 167 }; |
163 | 168 |
164 } // namespace sk_app | 169 } // namespace sk_app |
165 #endif | 170 #endif |
OLD | NEW |