48 #include <private/qglwindowsurface_qws_p.h> 50 #include <private/qbackingstore_p.h> 51 #include <private/qfont_p.h> 52 #include <private/qfontengine_p.h> 53 #include <private/qgl_p.h> 54 #include <private/qpaintengine_opengl_p.h> 71 screenNumber =
qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
81 return static_cast<QGLScreen *>(screen);
100 d->widget->makeCurrent();
129 return EGL_NO_SURFACE;
132 return EGL_NO_SURFACE;
135 int devType = device->
devType();
147 qWarning(
"QEglContext::createSurface(): Cannot create the native EGL drawable");
148 return EGL_NO_SURFACE;
159 surf = eglCreateWindowSurface
160 (context->
display(), context->
config(), windowDrawable, props);
162 surf = eglCreatePixmapSurface
163 (context->
display(), context->
config(), pixmapDrawable, props);
165 if (surf == EGL_NO_SURFACE)
166 qWarning(
"QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
177 int devType = device()->
devType();
179 qWarning(
"QGLContext::chooseContext(): Cannot create QGLContext's for paint device type %d", devType);
185 d->ownsEglContext =
true;
197 if (!
d->eglContext->chooseConfig(configProps)) {
198 delete d->eglContext;
207 if (!
d->eglContext->createContext
208 (shareContext ? shareContext->d_func()->eglContext : 0)) {
209 delete d->eglContext;
213 d->sharing =
d->eglContext->isSharing();
214 if (
d->sharing && shareContext)
215 const_cast<QGLContext *
>(shareContext)->d_func()->sharing =
true;
217 #if defined(EGL_VERSION_1_1) 219 eglSwapInterval(
d->eglContext->display(),
d->glFormat.swapInterval());
226 if (
d->eglSurface == EGL_NO_SURFACE) {
227 delete d->eglContext;
248 if (!
d->glcx->initialized())
250 resizeGL(width(), height());
273 qWarning(
"QGLWidget::setContext: Cannot set null context");
278 d->glcx->doneCurrent();
281 if(!
d->glcx->isValid())
282 d->glcx->create(shareContext ? shareContext : oldcx);
294 q->setWindowSurface(wsurf);
297 initContext(context, shareWidget);
299 if(q->isValid() && glcx->format().hasOverlay()) {
301 qWarning(
"QtOpenGL ES doesn't currently support overlays");
311 return d_func()->cmap;
Q_GUI_EXPORT QScreen * qt_screen
void qt_glformat_from_eglconfig(QGLFormat &format, const EGLConfig config)
virtual bool createNativeImage(QImage *image, EGLNativePixmapType *native)
Creates a native OpenGLES drawable for directly rendering into image and returns it in native...
static EGLSurface qt_egl_create_surface(QEglContext *context, QPaintDevice *device, const QEglProperties *properties=0)
The QProxyScreen class provides a generic interface to QScreen implementations.
#define QT_END_NAMESPACE
This macro expands to.
NativePixmapType EGLNativePixmapType
static QGLScreen * glScreenForDevice(QPaintDevice *device)
NativeWindowType EGLNativeWindowType
virtual int devType() const
QPlatformGLContext * context
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setRenderableType(QEgl::API api)
The QGLContext class encapsulates an OpenGL rendering context.
virtual bool createNativeWindow(QWidget *widget, EGLNativeWindowType *native)
Creates a native OpenGLES drawable for the surface of widget and returns it in native.
The QResizeEvent class contains event parameters for resize events.
Q_CORE_EXPORT void qWarning(const char *,...)
virtual bool createNativePixmap(QPixmap *pixmap, EGLNativePixmapType *native)
Creates a native OpenGLES drawable for directly rendering into pixmap and returns it in native...
The QGLColormap class is used for installing custom colormaps into a QGLWidget.
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.
QGLScreenSurfaceFunctions * surfaceFunctions() const
Returns the surface functions object for this QGLScreen.
virtual bool chooseContext(const QGLContext *shareContext=0)
This semi-internal function is called by create().
QGLScreen::Options options() const
Returns the options associated with this QGLScreen.
virtual QList< QScreen * > subScreens() const
The QGLScreenSurfaceFunctions class encapsulates the functions for creating native windows and pixmap...
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
QGLTemporaryContext(bool directRendering=true, QWidget *parent=0)
void setPaintDeviceFormat(QPaintDevice *dev)
static const QCssKnownValue properties[NumProperties - 1]
ClassId classId() const
Returns the class identifier for the screen object.
This class encapsulates an OpenGL screen driver.
The QEvent class is the base class of all event classes.
void setDeviceType(int devType)
void qt_eglproperties_set_glformat(QEglProperties &eglProperties, const QGLFormat &glFormat)
The QWSGLWindowSurface class provides the drawing area for top-level windows with Qt for Embedded Lin...