OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 | 9 |
10 #ifndef SkOSWindow_Win_DEFINED | 10 #ifndef SkOSWindow_Win_DEFINED |
11 #define SkOSWindow_Win_DEFINED | 11 #define SkOSWindow_Win_DEFINED |
12 | 12 |
13 #include "../private/SkFunction.h" | 13 #include "../private/SkFunction.h" |
14 #include "../private/SkTHash.h" | 14 #include "../private/SkTHash.h" |
15 #include "SkWindow.h" | 15 #include "SkWindow.h" |
16 | 16 |
17 #if SK_ANGLE | 17 #if SK_ANGLE |
18 #include "EGL/egl.h" | 18 #include "EGL/egl.h" |
19 #endif | 19 #endif |
20 | 20 |
| 21 #if SK_COMMAND_BUFFER |
| 22 class SkCommandBufferGLContext; |
| 23 #endif |
| 24 |
21 class SkOSWindow : public SkWindow { | 25 class SkOSWindow : public SkWindow { |
22 public: | 26 public: |
23 struct WindowInit { | 27 struct WindowInit { |
24 const TCHAR* fClass; | 28 const TCHAR* fClass; |
25 HINSTANCE fInstance; | 29 HINSTANCE fInstance; |
26 }; | 30 }; |
27 | 31 |
28 SkOSWindow(const void* winInit); | 32 SkOSWindow(const void* winInit); |
29 virtual ~SkOSWindow(); | 33 virtual ~SkOSWindow(); |
30 | 34 |
31 static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); | 35 static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); |
32 | 36 |
33 enum SkBackEndTypes { | 37 enum SkBackEndTypes { |
34 kNone_BackEndType, | 38 kNone_BackEndType, |
35 #if SK_SUPPORT_GPU | 39 #if SK_SUPPORT_GPU |
36 kNativeGL_BackEndType, | 40 kNativeGL_BackEndType, |
37 #if SK_ANGLE | 41 #if SK_ANGLE |
38 kANGLE_BackEndType, | 42 kANGLE_BackEndType, |
39 #endif // SK_ANGLE | 43 #endif // SK_ANGLE |
| 44 #if SK_COMMAND_BUFFER |
| 45 kCommandBuffer_BackEndType, |
| 46 #endif // SK_COMMAND_BUFFER |
40 #endif // SK_SUPPORT_GPU | 47 #endif // SK_SUPPORT_GPU |
41 }; | 48 }; |
42 | 49 |
43 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*)
; | 50 bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*)
; |
44 void detach(); | 51 void detach(); |
45 void present(); | 52 void present(); |
46 | 53 |
47 bool wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); | 54 bool wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
48 static bool QuitOnDeactivate(HWND hWnd); | 55 static bool QuitOnDeactivate(HWND hWnd); |
49 | 56 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void doPaint(void* ctx); | 96 void doPaint(void* ctx); |
90 | 97 |
91 #if SK_SUPPORT_GPU | 98 #if SK_SUPPORT_GPU |
92 void* fHGLRC; | 99 void* fHGLRC; |
93 #if SK_ANGLE | 100 #if SK_ANGLE |
94 EGLDisplay fDisplay; | 101 EGLDisplay fDisplay; |
95 EGLContext fContext; | 102 EGLContext fContext; |
96 EGLSurface fSurface; | 103 EGLSurface fSurface; |
97 EGLConfig fConfig; | 104 EGLConfig fConfig; |
98 #endif // SK_ANGLE | 105 #endif // SK_ANGLE |
| 106 #if SK_COMMAND_BUFFER |
| 107 SkCommandBufferGLContext* fCommandBuffer; |
| 108 #endif // SK_COMMAND_BUFFER |
99 #endif // SK_SUPPORT_GPU | 109 #endif // SK_SUPPORT_GPU |
100 | 110 |
101 bool fFullscreen; | 111 bool fFullscreen; |
102 struct SavedWindowState { | 112 struct SavedWindowState { |
103 bool fZoomed; | 113 bool fZoomed; |
104 LONG fStyle; | 114 LONG fStyle; |
105 LONG fExStyle; | 115 LONG fExStyle; |
106 RECT fRect; | 116 RECT fRect; |
107 LONG fScreenWidth; | 117 LONG fScreenWidth; |
108 LONG fScreenHeight; | 118 LONG fScreenHeight; |
109 LONG fScreenBits; | 119 LONG fScreenBits; |
110 void* fHWND; | 120 void* fHWND; |
111 } fSavedWindowState; | 121 } fSavedWindowState; |
112 | 122 |
113 HMENU fMBar; | 123 HMENU fMBar; |
114 | 124 |
115 SkBackEndTypes fAttached; | 125 SkBackEndTypes fAttached; |
116 | 126 |
117 void updateSize(); | 127 void updateSize(); |
118 #if SK_SUPPORT_GPU | 128 #if SK_SUPPORT_GPU |
119 bool attachGL(int msaaSampleCount, AttachmentInfo* info); | 129 bool attachGL(int msaaSampleCount, AttachmentInfo* info); |
120 void detachGL(); | 130 void detachGL(); |
121 void presentGL(); | 131 void presentGL(); |
122 | 132 |
123 #if SK_ANGLE | 133 #if SK_ANGLE |
124 bool attachANGLE(int msaaSampleCount, AttachmentInfo* info); | 134 bool attachANGLE(int msaaSampleCount, AttachmentInfo* info); |
125 void detachANGLE(); | 135 void detachANGLE(); |
126 void presentANGLE(); | 136 void presentANGLE(); |
127 #endif // SK_ANGLE | 137 #endif // SK_ANGLE |
| 138 |
| 139 #if SK_COMMAND_BUFFER |
| 140 bool attachCommandBuffer(int msaaSampleCount, AttachmentInfo* info); |
| 141 void detachCommandBuffer(); |
| 142 void presentCommandBuffer(); |
| 143 #endif // SK_COMMAND_BUFFER |
128 #endif // SK_SUPPORT_GPU | 144 #endif // SK_SUPPORT_GPU |
129 | 145 |
130 typedef SkWindow INHERITED; | 146 typedef SkWindow INHERITED; |
131 }; | 147 }; |
132 | 148 |
133 #endif | 149 #endif |
OLD | NEW |