summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_qws.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgl_qws.cpp')
-rw-r--r--src/opengl/qgl_qws.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/opengl/qgl_qws.cpp b/src/opengl/qgl_qws.cpp
index fd17a27..38c3774 100644
--- a/src/opengl/qgl_qws.cpp
+++ b/src/opengl/qgl_qws.cpp
@@ -119,21 +119,6 @@ bool QGLFormat::hasOpenGLOverlays()
return false;
}
-void qt_egl_add_platform_config(QEglProperties& props, QPaintDevice *device)
-{
- // Find the QGLScreen for this paint device.
- QGLScreen *glScreen = glScreenForDevice(device);
- if (!glScreen) {
- qWarning("QGLContext::chooseContext(): The screen is not a QGLScreen");
- return;
- }
- int devType = device->devType();
- if (devType == QInternal::Image)
- props.setPixelFormat(static_cast<QImage *>(device)->format());
- else
- props.setPixelFormat(glScreen->pixelFormat());
-}
-
static EGLSurface qt_egl_create_surface
(QEglContext *context, QPaintDevice *device,
const QEglProperties *properties = 0)
@@ -197,12 +182,14 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
// Get the display and initialize it.
d->eglContext = new QEglContext();
+ d->ownsEglContext = true;
d->eglContext->setApi(QEgl::OpenGL);
// Construct the configuration we need for this surface.
QEglProperties configProps;
- qt_egl_add_platform_config(configProps, device());
- qt_egl_set_format(configProps, devType, d->glFormat);
+ qt_eglproperties_set_glformat(configProps, d->glFormat);
+ configProps.setDeviceType(devType);
+ configProps.setPaintDeviceFormat(device());
configProps.setRenderableType(QEgl::OpenGL);
// Search for a matching configuration, reducing the complexity
@@ -214,7 +201,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
}
// Inform the higher layers about the actual format properties.
- qt_egl_update_format(*(d->eglContext), d->glFormat);
+ qt_glformat_from_eglconfig(d->glFormat, d->eglContext->config());
// Create a new context for the configuration.
if (!d->eglContext->createContext