1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation (qt-info@nokia.com)
|
---|
6 | **
|
---|
7 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at qt-info@nokia.com.
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #include <QtGui/qpaintdevice.h>
|
---|
43 | #include <QtGui/qpixmap.h>
|
---|
44 | #include <QtGui/qwidget.h>
|
---|
45 | #include <QtCore/qdebug.h>
|
---|
46 |
|
---|
47 | #include "qegl_p.h"
|
---|
48 | #include "qeglcontext_p.h"
|
---|
49 |
|
---|
50 |
|
---|
51 | QT_BEGIN_NAMESPACE
|
---|
52 |
|
---|
53 | static void noegl(const char *fn)
|
---|
54 | {
|
---|
55 | qWarning() << fn << " called, but Qt configured without EGL" << endl;
|
---|
56 | }
|
---|
57 |
|
---|
58 | #define NOEGL noegl(__FUNCTION__);
|
---|
59 |
|
---|
60 | QEglContext::QEglContext()
|
---|
61 | : apiType(QEgl::OpenGL)
|
---|
62 | , ctx(0)
|
---|
63 | , cfg(QEGL_NO_CONFIG)
|
---|
64 | , currentSurface(0)
|
---|
65 | , current(false)
|
---|
66 | , ownsContext(true)
|
---|
67 | , sharing(false)
|
---|
68 | {
|
---|
69 | NOEGL
|
---|
70 | }
|
---|
71 |
|
---|
72 | QEglContext::~QEglContext()
|
---|
73 | {
|
---|
74 | NOEGL
|
---|
75 | }
|
---|
76 |
|
---|
77 | bool QEglContext::isValid() const
|
---|
78 | {
|
---|
79 | NOEGL
|
---|
80 | return false;
|
---|
81 | }
|
---|
82 |
|
---|
83 | bool QEglContext::isCurrent() const
|
---|
84 | {
|
---|
85 | NOEGL
|
---|
86 | return false;
|
---|
87 | }
|
---|
88 |
|
---|
89 | EGLConfig QEgl::defaultConfig(int devType, API api, ConfigOptions options)
|
---|
90 | {
|
---|
91 | Q_UNUSED(devType)
|
---|
92 | Q_UNUSED(api)
|
---|
93 | Q_UNUSED(options)
|
---|
94 | NOEGL
|
---|
95 | return QEGL_NO_CONFIG;
|
---|
96 | }
|
---|
97 |
|
---|
98 |
|
---|
99 | // Choose a configuration that matches "properties".
|
---|
100 | EGLConfig QEgl::chooseConfig(const QEglProperties* properties, QEgl::PixelFormatMatch match)
|
---|
101 | {
|
---|
102 | Q_UNUSED(properties)
|
---|
103 | Q_UNUSED(match)
|
---|
104 | NOEGL
|
---|
105 | return QEGL_NO_CONFIG;
|
---|
106 | }
|
---|
107 |
|
---|
108 | bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match)
|
---|
109 | {
|
---|
110 | Q_UNUSED(properties)
|
---|
111 | Q_UNUSED(match)
|
---|
112 | NOEGL
|
---|
113 | return false;
|
---|
114 | }
|
---|
115 |
|
---|
116 | EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties *properties)
|
---|
117 | {
|
---|
118 | Q_UNUSED(device)
|
---|
119 | Q_UNUSED(properties)
|
---|
120 | NOEGL
|
---|
121 | return 0;
|
---|
122 | }
|
---|
123 |
|
---|
124 |
|
---|
125 | // Create the EGLContext.
|
---|
126 | bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties)
|
---|
127 | {
|
---|
128 | Q_UNUSED(shareContext)
|
---|
129 | Q_UNUSED(properties)
|
---|
130 | NOEGL
|
---|
131 | return false;
|
---|
132 | }
|
---|
133 |
|
---|
134 | // Destroy an EGL surface object. If it was current on this context
|
---|
135 | // then call doneCurrent() for it first.
|
---|
136 | void QEglContext::destroySurface(EGLSurface surface)
|
---|
137 | {
|
---|
138 | Q_UNUSED(surface)
|
---|
139 | NOEGL
|
---|
140 | }
|
---|
141 |
|
---|
142 | // Destroy the context. Note: this does not destroy the surface.
|
---|
143 | void QEglContext::destroyContext()
|
---|
144 | {
|
---|
145 | NOEGL
|
---|
146 | }
|
---|
147 |
|
---|
148 | bool QEglContext::makeCurrent(EGLSurface surface)
|
---|
149 | {
|
---|
150 | Q_UNUSED(surface)
|
---|
151 | NOEGL
|
---|
152 | return false;
|
---|
153 | }
|
---|
154 |
|
---|
155 | bool QEglContext::doneCurrent()
|
---|
156 | {
|
---|
157 | NOEGL
|
---|
158 | return false;
|
---|
159 | }
|
---|
160 |
|
---|
161 | // Act as though doneCurrent() was called, but keep the context
|
---|
162 | // and the surface active for the moment. This allows makeCurrent()
|
---|
163 | // to skip a call to eglMakeCurrent() if we are using the same
|
---|
164 | // surface as the last set of painting operations. We leave the
|
---|
165 | // currentContext() pointer as-is for now.
|
---|
166 | bool QEglContext::lazyDoneCurrent()
|
---|
167 | {
|
---|
168 | NOEGL
|
---|
169 | return false;
|
---|
170 | }
|
---|
171 |
|
---|
172 | bool QEglContext::swapBuffers(EGLSurface surface)
|
---|
173 | {
|
---|
174 | Q_UNUSED(surface)
|
---|
175 | NOEGL
|
---|
176 | return false;
|
---|
177 | }
|
---|
178 |
|
---|
179 | bool QEglContext::swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region)
|
---|
180 | {
|
---|
181 | Q_UNUSED(surface)
|
---|
182 | Q_UNUSED(region)
|
---|
183 | NOEGL
|
---|
184 | return false;
|
---|
185 | }
|
---|
186 |
|
---|
187 | int QEglContext::configAttrib(int name) const
|
---|
188 | {
|
---|
189 | Q_UNUSED(name)
|
---|
190 | NOEGL
|
---|
191 | return 0;
|
---|
192 | }
|
---|
193 |
|
---|
194 | EGLDisplay QEgl::display()
|
---|
195 | {
|
---|
196 | NOEGL
|
---|
197 | return 0;
|
---|
198 | }
|
---|
199 |
|
---|
200 | EGLImageKHR QEgl::eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
|
---|
201 | {
|
---|
202 | Q_UNUSED(dpy)
|
---|
203 | Q_UNUSED(ctx)
|
---|
204 | Q_UNUSED(target)
|
---|
205 | Q_UNUSED(buffer)
|
---|
206 | Q_UNUSED(attrib_list)
|
---|
207 | NOEGL
|
---|
208 | return 0;
|
---|
209 | }
|
---|
210 |
|
---|
211 | EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
|
---|
212 | {
|
---|
213 | Q_UNUSED(dpy)
|
---|
214 | Q_UNUSED(img)
|
---|
215 | NOEGL
|
---|
216 | return 0;
|
---|
217 | }
|
---|
218 |
|
---|
219 | EGLBoolean QEgl::eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
|
---|
220 | {
|
---|
221 | Q_UNUSED(dpy);
|
---|
222 | Q_UNUSED(surface);
|
---|
223 | Q_UNUSED(count);
|
---|
224 | Q_UNUSED(rects);
|
---|
225 | NOEGL
|
---|
226 | return 0;
|
---|
227 | }
|
---|
228 |
|
---|
229 | #ifndef Q_WS_X11
|
---|
230 | EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties)
|
---|
231 | {
|
---|
232 | Q_UNUSED(device)
|
---|
233 | Q_UNUSED(cfg)
|
---|
234 | Q_UNUSED(properties)
|
---|
235 | NOEGL
|
---|
236 | return 0;
|
---|
237 | }
|
---|
238 | #endif
|
---|
239 |
|
---|
240 |
|
---|
241 | // Return the error string associated with a specific code.
|
---|
242 | QString QEgl::errorString(EGLint code)
|
---|
243 | {
|
---|
244 | Q_UNUSED(code)
|
---|
245 | NOEGL
|
---|
246 | return QString();
|
---|
247 | }
|
---|
248 |
|
---|
249 | // Dump all of the EGL configurations supported by the system.
|
---|
250 | void QEgl::dumpAllConfigs()
|
---|
251 | {
|
---|
252 | NOEGL
|
---|
253 | }
|
---|
254 |
|
---|
255 | QString QEgl::extensions()
|
---|
256 | {
|
---|
257 | NOEGL
|
---|
258 | return QString();
|
---|
259 | }
|
---|
260 |
|
---|
261 | bool QEgl::hasExtension(const char* extensionName)
|
---|
262 | {
|
---|
263 | Q_UNUSED(extensionName)
|
---|
264 | NOEGL
|
---|
265 | return false;
|
---|
266 | }
|
---|
267 |
|
---|
268 | QEglContext *QEglContext::currentContext(QEgl::API api)
|
---|
269 | {
|
---|
270 | Q_UNUSED(api)
|
---|
271 | NOEGL
|
---|
272 | return false;
|
---|
273 | }
|
---|
274 |
|
---|
275 | void QEglContext::setCurrentContext(QEgl::API api, QEglContext *context)
|
---|
276 | {
|
---|
277 | Q_UNUSED(api)
|
---|
278 | Q_UNUSED(context)
|
---|
279 | NOEGL
|
---|
280 | }
|
---|
281 |
|
---|
282 | EGLNativeDisplayType QEgl::nativeDisplay()
|
---|
283 | {
|
---|
284 | NOEGL
|
---|
285 | return 0;
|
---|
286 | }
|
---|
287 |
|
---|
288 | EGLNativeWindowType QEgl::nativeWindow(QWidget* widget)
|
---|
289 | {
|
---|
290 | Q_UNUSED(widget)
|
---|
291 | NOEGL
|
---|
292 | return (EGLNativeWindowType)0;
|
---|
293 | }
|
---|
294 |
|
---|
295 | EGLNativePixmapType QEgl::nativePixmap(QPixmap*)
|
---|
296 | {
|
---|
297 | NOEGL
|
---|
298 | return (EGLNativePixmapType)0;
|
---|
299 | }
|
---|
300 |
|
---|
301 | QT_END_NAMESPACE
|
---|