OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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_SDL_DEFINED | 8 #ifndef SkOSWindow_SDL_DEFINED |
9 #define SkOSWindow_SDL_DEFINED | 9 #define SkOSWindow_SDL_DEFINED |
10 | 10 |
11 #include "SDL.h" | 11 #include "SDL.h" |
12 #include "SDL_opengl.h" | 12 #include "SDL_opengl.h" |
13 #include "SkWindow.h" | 13 #include "SkWindow.h" |
14 | 14 |
15 class SkOSWindow : public SkWindow { | 15 class SkOSWindow : public SkWindow { |
16 public: | 16 public: |
17 SkOSWindow(void*); | 17 SkOSWindow(void*); |
18 virtual ~SkOSWindow(); | 18 virtual ~SkOSWindow(); |
19 | 19 |
20 enum SkBackEndTypes { | 20 enum SkBackEndTypes { |
21 kNone_BackEndType, // TODO: remove this, it's not a real option. | 21 kNone_BackEndType, // TODO: remove this, it's not a real option. |
22 kNativeGL_BackEndType, | 22 kNativeGL_BackEndType, |
23 #if SK_ANGLE | 23 #if SK_ANGLE |
24 kANGLE_BackEndType, | 24 kANGLE_BackEndType, |
25 #endif // SK_ANGLE | 25 #endif // SK_ANGLE |
26 #if SK_COMMAND_BUFFER | |
27 kCommandBuffer_BackEndType, | |
28 #endif // SK_COMMAND_BUFFER | |
29 }; | 26 }; |
30 | 27 |
31 void release(); | 28 void release(); |
32 bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
AttachmentInfo*); | 29 bool attach(SkBackEndTypes attachType, int msaaSampleCount, bool deepColor,
AttachmentInfo*); |
33 void present(); | 30 void present(); |
34 bool makeFullscreen(); | 31 bool makeFullscreen(); |
35 void setVsync(bool); | 32 void setVsync(bool); |
36 void closeWindow(); | 33 void closeWindow(); |
37 static void RunEventLoop(); | 34 static void RunEventLoop(); |
38 | 35 |
39 protected: | 36 protected: |
40 void onSetTitle(const char title[]) override; | 37 void onSetTitle(const char title[]) override; |
41 | 38 |
42 private: | 39 private: |
43 void createWindow(int msaaSampleCount); | 40 void createWindow(int msaaSampleCount); |
44 void destroyWindow(); | 41 void destroyWindow(); |
45 void updateWindowTitle(); | 42 void updateWindowTitle(); |
46 static SkOSWindow* GetInstanceForWindowID(Uint32 windowID); | 43 static SkOSWindow* GetInstanceForWindowID(Uint32 windowID); |
47 static bool HasDirtyWindows(); | 44 static bool HasDirtyWindows(); |
48 static void UpdateDirtyWindows(); | 45 static void UpdateDirtyWindows(); |
49 static void HandleEvent(const SDL_Event&); | 46 static void HandleEvent(const SDL_Event&); |
50 | 47 |
51 SDL_Window* fWindow; | 48 SDL_Window* fWindow; |
52 SDL_GLContext fGLContext; | 49 SDL_GLContext fGLContext; |
53 int fWindowMSAASampleCount; | 50 int fWindowMSAASampleCount; |
54 typedef SkWindow INHERITED; | 51 typedef SkWindow INHERITED; |
55 }; | 52 }; |
56 | 53 |
57 #endif | 54 #endif |
OLD | NEW |