43 #include <QtGui/qpixmap.h> |
43 #include <QtGui/qpixmap.h> |
44 #include <QtGui/qwidget.h> |
44 #include <QtGui/qwidget.h> |
45 #include <QtCore/qdebug.h> |
45 #include <QtCore/qdebug.h> |
46 |
46 |
47 #include "qegl_p.h" |
47 #include "qegl_p.h" |
|
48 #include "qeglcontext_p.h" |
|
49 |
48 |
50 |
49 QT_BEGIN_NAMESPACE |
51 QT_BEGIN_NAMESPACE |
50 |
52 |
51 static void noegl(const char *fn) |
53 static void noegl(const char *fn) |
52 { |
54 { |
53 qWarning() << fn << " called, but Qt configured without EGL" << endl; |
55 qWarning() << fn << " called, but Qt configured without EGL" << endl; |
54 } |
56 } |
55 |
57 |
56 #define NOEGL noegl(__FUNCTION__); |
58 #define NOEGL noegl(__FUNCTION__); |
57 |
|
58 EGLDisplay QEglContext::dpy = 0; |
|
59 |
59 |
60 QEglContext::QEglContext() |
60 QEglContext::QEglContext() |
61 : apiType(QEgl::OpenGL) |
61 : apiType(QEgl::OpenGL) |
62 , ctx(0) |
62 , ctx(0) |
63 , cfg(0) |
63 , cfg(QEGL_NO_CONFIG) |
64 , currentSurface(0) |
64 , currentSurface(0) |
65 , current(false) |
65 , current(false) |
66 , ownsContext(true) |
66 , ownsContext(true) |
67 , sharing(false) |
67 , sharing(false) |
68 { |
68 { |
82 |
82 |
83 bool QEglContext::isCurrent() const |
83 bool QEglContext::isCurrent() const |
84 { |
84 { |
85 NOEGL |
85 NOEGL |
86 return false; |
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; |
87 } |
106 } |
88 |
107 |
89 bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match) |
108 bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match) |
90 { |
109 { |
91 Q_UNUSED(properties) |
110 Q_UNUSED(properties) |
155 Q_UNUSED(surface) |
174 Q_UNUSED(surface) |
156 NOEGL |
175 NOEGL |
157 return false; |
176 return false; |
158 } |
177 } |
159 |
178 |
160 bool QEglContext::configAttrib(int name, EGLint *value) const |
179 int QEglContext::configAttrib(int name) const |
161 { |
180 { |
162 Q_UNUSED(name) |
181 Q_UNUSED(name) |
163 Q_UNUSED(value) |
182 NOEGL |
164 NOEGL |
183 return 0; |
165 return false; |
184 } |
166 } |
185 |
167 |
186 EGLDisplay QEgl::display() |
168 void QEglContext::clearError() |
187 { |
169 { |
188 NOEGL |
170 NOEGL |
189 return 0; |
171 return; |
190 } |
172 } |
191 |
173 |
192 EGLImageKHR QEgl::eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) |
174 EGLint QEglContext::error() |
193 { |
175 { |
194 Q_UNUSED(dpy) |
176 NOEGL |
195 Q_UNUSED(ctx) |
177 return 0; |
196 Q_UNUSED(target) |
178 } |
197 Q_UNUSED(buffer) |
179 |
198 Q_UNUSED(attrib_list) |
180 EGLDisplay QEglContext::display() |
199 NOEGL |
181 { |
200 return 0; |
182 NOEGL |
201 } |
183 return 0; |
202 |
184 } |
203 EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) |
|
204 { |
|
205 Q_UNUSED(dpy) |
|
206 Q_UNUSED(img) |
|
207 NOEGL |
|
208 return 0; |
|
209 } |
|
210 |
|
211 |
|
212 #ifndef Q_WS_X11 |
|
213 EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties) |
|
214 { |
|
215 Q_UNUSED(device) |
|
216 Q_UNUSED(cfg) |
|
217 Q_UNUSED(properties) |
|
218 NOEGL |
|
219 return 0; |
|
220 } |
|
221 #endif |
|
222 |
185 |
223 |
186 // Return the error string associated with a specific code. |
224 // Return the error string associated with a specific code. |
187 QString QEglContext::errorString(EGLint code) |
225 QString QEgl::errorString(EGLint code) |
188 { |
226 { |
189 Q_UNUSED(code) |
227 Q_UNUSED(code) |
190 NOEGL |
228 NOEGL |
191 return QString(); |
229 return QString(); |
192 } |
230 } |
193 |
231 |
194 // Dump all of the EGL configurations supported by the system. |
232 // Dump all of the EGL configurations supported by the system. |
195 void QEglContext::dumpAllConfigs() |
233 void QEgl::dumpAllConfigs() |
196 { |
234 { |
197 NOEGL |
235 NOEGL |
198 } |
236 } |
199 |
237 |
200 QString QEglContext::extensions() |
238 QString QEgl::extensions() |
201 { |
239 { |
202 NOEGL |
240 NOEGL |
203 return QString(); |
241 return QString(); |
204 } |
242 } |
205 |
243 |
206 bool QEglContext::hasExtension(const char* extensionName) |
244 bool QEgl::hasExtension(const char* extensionName) |
207 { |
245 { |
208 Q_UNUSED(extensionName) |
246 Q_UNUSED(extensionName) |
209 NOEGL |
247 NOEGL |
210 return false; |
248 return false; |
211 } |
249 } |