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