Qt 4.8
qegl_stub.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
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 
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 
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 
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".
101 {
102  Q_UNUSED(properties)
103  Q_UNUSED(match)
104  NOEGL
105  return QEGL_NO_CONFIG;
106 }
107 
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.
144 {
145  NOEGL
146 }
147 
148 bool QEglContext::makeCurrent(EGLSurface surface)
149 {
150  Q_UNUSED(surface)
151  NOEGL
152  return false;
153 }
154 
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.
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.
251 {
252  NOEGL
253 }
254 
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 
269 {
270  Q_UNUSED(api)
271  NOEGL
272  return false;
273 }
274 
276 {
277  Q_UNUSED(api)
278  Q_UNUSED(context)
279  NOEGL
280 }
281 
283 {
284  NOEGL
285  return 0;
286 }
287 
289 {
290  Q_UNUSED(widget)
291  NOEGL
292  return (EGLNativeWindowType)0;
293 }
294 
296 {
297  NOEGL
298  return (EGLNativePixmapType)0;
299 }
300 
QTextStream & endl(QTextStream &stream)
Writes &#39; &#39; to the stream and flushes the stream.
#define NOEGL
Definition: qegl_stub.cpp:58
EGLSurface createSurface(QPaintDevice *device, const QEglProperties *properties=0)
Definition: qegl.cpp:354
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
bool createContext(QEglContext *shareContext=0, const QEglProperties *properties=0)
Definition: qegl.cpp:361
QPointer< QWidget > widget
bool isValid() const
Definition: qegl.cpp:116
NativePixmapType EGLNativePixmapType
Definition: qegl_p.h:117
~QEglContext()
Definition: qegl.cpp:105
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static bool match(const uchar *found, const char *target, uint len)
bool chooseConfig(const QEglProperties &properties, QEgl::PixelFormatMatch match=QEgl::ExactPixelFormat)
Definition: qegl.cpp:348
Definition: qegl_p.h:189
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_GUI_EXPORT QString extensions()
Definition: qegl.cpp:785
bool swapBuffers(EGLSurface surface)
Definition: qegl.cpp:525
NativeWindowType EGLNativeWindowType
Definition: qegl_p.h:116
Q_GUI_EXPORT EGLNativePixmapType nativePixmap(QPixmap *)
Definition: qegl_qpa.cpp:65
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
Definition: qegl.cpp:743
EGLContext ctx
bool swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region)
Definition: qegl.cpp:543
EGLContext context() const
Definition: qeglcontext_p.h:91
EGLConfig cfg
bool doneCurrent()
Definition: qegl.cpp:485
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
QEglContext()
Definition: qegl.cpp:92
Q_GUI_EXPORT EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
Definition: qegl.cpp:638
const char * name
Q_CORE_EXPORT void qWarning(const char *,...)
void * EGLClientBuffer
Definition: qegl_p.h:70
QEgl::API api() const
Definition: qeglcontext_p.h:74
unsigned int EGLenum
Definition: qegl_p.h:69
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
void destroyContext()
Definition: qegl.cpp:425
bool isCurrent() const
Definition: qegl.cpp:121
Q_GUI_EXPORT bool hasExtension(const char *extensionName)
Definition: qegl.cpp:791
Q_GUI_EXPORT EGLConfig defaultConfig(int devType, API api, ConfigOptions options)
Definition: qegl.cpp:126
void * EGLImageKHR
Definition: qegl_p.h:165
int configAttrib(int name) const
Definition: qegl.cpp:568
#define QEGL_NO_CONFIG
Definition: qegl_p.h:129
bool lazyDoneCurrent()
Definition: qegl.cpp:519
static QEglContext * currentContext(QEgl::API api)
Definition: qegl.cpp:799
Q_GUI_EXPORT EGLSurface createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *surfaceAttribs=0)
Definition: qegl_x11.cpp:333
Q_GUI_EXPORT EGLNativeDisplayType nativeDisplay()
Definition: qegl_qpa.cpp:55
Q_GUI_EXPORT void dumpAllConfigs()
Definition: qegl.cpp:770
bool makeCurrent(EGLSurface surface)
Definition: qegl.cpp:433
PixelFormatMatch
Definition: qegl_p.h:196
#define ctx
Definition: qgl.cpp:6094
void destroySurface(EGLSurface surface)
Definition: qegl.cpp:415
Q_GUI_EXPORT EGLBoolean eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
Definition: qegl.cpp:651
static const QCssKnownValue properties[NumProperties - 1]
Definition: qcssparser.cpp:67
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
NativeDisplayType EGLNativeDisplayType
Definition: qegl_p.h:118
API
Definition: qegl_p.h:190
Q_GUI_EXPORT EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
Definition: qegl.cpp:625
static void noegl(const char *fn)
Definition: qegl_stub.cpp:53
Q_GUI_EXPORT EGLConfig chooseConfig(const QEglProperties *configAttribs, QEgl::PixelFormatMatch match=QEgl::ExactPixelFormat)
Definition: qegl.cpp:288
static void setCurrentContext(QEgl::API api, QEglContext *context)
Definition: qegl.cpp:807
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
Q_GUI_EXPORT EGLNativeWindowType nativeWindow(QWidget *)
Definition: qegl_qpa.cpp:60