| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 virtual bool scaleContentToFit() const { return false; } | 30 virtual bool scaleContentToFit() const { return false; } |
| 31 virtual bool supportsContentRect() const { return false; } | 31 virtual bool supportsContentRect() const { return false; } |
| 32 virtual SkRect getContentRect() { return SkRect::MakeEmpty(); } | 32 virtual SkRect getContentRect() { return SkRect::MakeEmpty(); } |
| 33 | 33 |
| 34 enum BackEndType { | 34 enum BackEndType { |
| 35 kNativeGL_BackendType, | 35 kNativeGL_BackendType, |
| 36 kVulkan_BackendType | 36 kVulkan_BackendType |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 virtual bool attach(BackEndType attachType, int msaaSampleCount) = 0; | 39 virtual bool attach(BackEndType attachType, int msaaSampleCount, bool srgb)
= 0; |
| 40 void detach(); | 40 void detach(); |
| 41 | 41 |
| 42 // input handling | 42 // input handling |
| 43 enum Key { | 43 enum Key { |
| 44 kNONE_Key, //corresponds to android's UNKNOWN | 44 kNONE_Key, //corresponds to android's UNKNOWN |
| 45 | 45 |
| 46 kLeftSoftKey_Key, | 46 kLeftSoftKey_Key, |
| 47 kRightSoftKey_Key, | 47 kRightSoftKey_Key, |
| 48 | 48 |
| 49 kHome_Key, //!< the home key - added to match android | 49 kHome_Key, //!< the home key - added to match android |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 bool onChar(SkUnichar c, uint32_t modifiers); | 123 bool onChar(SkUnichar c, uint32_t modifiers); |
| 124 bool onKey(Key key, InputState state, uint32_t modifiers); | 124 bool onKey(Key key, InputState state, uint32_t modifiers); |
| 125 bool onMouse(int x, int y, InputState state, uint32_t modifiers); | 125 bool onMouse(int x, int y, InputState state, uint32_t modifiers); |
| 126 void onPaint(); | 126 void onPaint(); |
| 127 void onResize(uint32_t width, uint32_t height); | 127 void onResize(uint32_t width, uint32_t height); |
| 128 | 128 |
| 129 uint32_t width() { return fWidth; } | 129 uint32_t width() { return fWidth; } |
| 130 uint32_t height() { return fHeight; } | 130 uint32_t height() { return fHeight; } |
| 131 | 131 |
| 132 bool getSRGB(); |
| 133 void setSRGB(bool srgb); |
| 134 |
| 132 protected: | 135 protected: |
| 133 Window(); | 136 Window(); |
| 134 | 137 |
| 135 uint32_t fWidth; | 138 uint32_t fWidth; |
| 136 uint32_t fHeight; | 139 uint32_t fHeight; |
| 137 | 140 |
| 138 OnCharFunc fCharFunc; | 141 OnCharFunc fCharFunc; |
| 139 void* fCharUserData; | 142 void* fCharUserData; |
| 140 OnKeyFunc fKeyFunc; | 143 OnKeyFunc fKeyFunc; |
| 141 void* fKeyUserData; | 144 void* fKeyUserData; |
| 142 OnMouseFunc fMouseFunc; | 145 OnMouseFunc fMouseFunc; |
| 143 void* fMouseUserData; | 146 void* fMouseUserData; |
| 144 OnPaintFunc fPaintFunc; | 147 OnPaintFunc fPaintFunc; |
| 145 void* fPaintUserData; | 148 void* fPaintUserData; |
| 146 | 149 |
| 147 WindowContext* fWindowContext; | 150 WindowContext* fWindowContext; |
| 148 }; | 151 }; |
| 149 | 152 |
| 150 } // namespace sk_app | 153 } // namespace sk_app |
| 151 #endif | 154 #endif |
| OLD | NEW |