OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Skia | 2 * Copyright 2011 Skia |
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 SkOSWindow_Android_DEFINED | 8 #ifndef SkOSWindow_Android_DEFINED |
9 #define SkOSWindow_Android_DEFINED | 9 #define SkOSWindow_Android_DEFINED |
10 | 10 |
11 #include "SkWindow.h" | 11 #include "SkWindow.h" |
12 | 12 |
| 13 #include <EGL/egl.h> |
| 14 |
| 15 struct SkAndroidWindow { |
| 16 EGLDisplay fDisplay; |
| 17 EGLSurface fSurface; |
| 18 EGLContext fContext; |
| 19 }; |
| 20 |
13 class SkOSWindow : public SkWindow { | 21 class SkOSWindow : public SkWindow { |
14 public: | 22 public: |
15 SkOSWindow(void*) {} | 23 SkOSWindow(void*); |
16 ~SkOSWindow() {} | 24 ~SkOSWindow(); |
17 | 25 |
18 enum SkBackEndTypes { | 26 enum SkBackEndTypes { |
19 kNone_BackEndType, | 27 kNone_BackEndType, |
20 kNativeGL_BackEndType, | 28 kNativeGL_BackEndType, |
21 }; | 29 }; |
22 | 30 |
23 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*
info); | 31 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*
info); |
24 void detach() {} | 32 void detach(); |
25 void present() {} | 33 void present(); |
| 34 void closeWindow() override; |
| 35 void setVsync(bool) override; |
| 36 bool destroyRequested() { return fDestroyRequested; } |
26 | 37 |
27 virtual void onPDFSaved(const char title[], const char desc[], | 38 virtual void onPDFSaved(const char title[], const char desc[], const char pa
th[]); |
28 const char path[]); | |
29 | 39 |
30 protected: | 40 protected: |
31 // overrides from SkWindow | 41 // overrides from SkWindow |
32 virtual void onHandleInval(const SkIRect&); | 42 virtual void onHandleInval(const SkIRect&); |
33 virtual void onSetTitle(const char title[]); | 43 virtual void onSetTitle(const char title[]); |
34 | 44 |
35 private: | 45 private: |
| 46 SkAndroidWindow fWindow; |
| 47 ANativeWindow* fNativeWindow; |
| 48 bool fDestroyRequested; |
| 49 |
36 typedef SkWindow INHERITED; | 50 typedef SkWindow INHERITED; |
37 }; | 51 }; |
38 | 52 |
39 #endif | 53 #endif |
OLD | NEW |