OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2016 Google Inc. | 3 * Copyright 2016 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef GLWindowContext_android_DEFINED | 8 #ifndef GLWindowContext_android_DEFINED |
9 #define GLWindowContext_android_DEFINED | 9 #define GLWindowContext_android_DEFINED |
10 | 10 |
11 #include "../GLWindowContext.h" | 11 #include "../GLWindowContext.h" |
12 #include "Window_android.h" | 12 #include "Window_android.h" |
13 | 13 |
14 #include <EGL/egl.h> | 14 #include <EGL/egl.h> |
15 | 15 |
| 16 struct ANativeWindow; |
| 17 |
16 namespace sk_app { | 18 namespace sk_app { |
17 | 19 |
18 class GLWindowContext_android : public GLWindowContext { | 20 class GLWindowContext_android : public GLWindowContext { |
19 public: | 21 public: |
20 friend GLWindowContext* GLWindowContext::Create(void* platformData, const Di
splayParams&); | 22 friend GLWindowContext* GLWindowContext::Create(void* platformData, const Di
splayParams&); |
21 | 23 |
22 ~GLWindowContext_android() override; | 24 ~GLWindowContext_android() override; |
23 | 25 |
24 void onSwapBuffers() override; | 26 void onSwapBuffers() override; |
25 | 27 |
26 void onInitializeContext(void*, const DisplayParams&) override; | 28 void onInitializeContext(void*, const DisplayParams&) override; |
27 void onDestroyContext() override; | 29 void onDestroyContext() override; |
28 | 30 |
29 private: | 31 private: |
30 GLWindowContext_android(void*, const DisplayParams&); | 32 GLWindowContext_android(void*, const DisplayParams&); |
31 | 33 |
32 EGLDisplay fDisplay; | 34 EGLDisplay fDisplay; |
33 EGLContext fEGLContext; | 35 EGLContext fEGLContext; |
34 EGLSurface fSurface; | 36 EGLSurface fSurface; |
| 37 |
| 38 // For setDisplayParams and resize which call onInitializeContext with null
platformData |
| 39 ANativeWindow* fNativeWindow = nullptr; |
35 }; | 40 }; |
36 | 41 |
37 | 42 |
38 } | 43 } |
39 | 44 |
40 #endif | 45 #endif |
OLD | NEW |