summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_qws.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-25 00:21:23 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-25 00:21:23 (GMT)
commitf3d15516572394b6bcd44a89dd66516fa4eba56e (patch)
treeb97aa3bc1826d21e6fd8b39f657b1e1e63369270 /src/opengl/qgl_qws.cpp
parent7421f79f57f475b9e96e53e5cbd9861c428d4ae3 (diff)
downloadQt-f3d15516572394b6bcd44a89dd66516fa4eba56e.zip
Qt-f3d15516572394b6bcd44a89dd66516fa4eba56e.tar.gz
Qt-f3d15516572394b6bcd44a89dd66516fa4eba56e.tar.bz2
Remove the storage of the EGLSurface from QEglContext
Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qgl_qws.cpp')
-rw-r--r--src/opengl/qgl_qws.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/opengl/qgl_qws.cpp b/src/opengl/qgl_qws.cpp
index b8a8777..d158e44 100644
--- a/src/opengl/qgl_qws.cpp
+++ b/src/opengl/qgl_qws.cpp
@@ -117,17 +117,17 @@ void qt_egl_add_platform_config(QEglProperties& props, QPaintDevice *device)
props.setPixelFormat(glScreen->pixelFormat());
}
-static bool qt_egl_create_surface
+static EGLSurface qt_egl_create_surface
(QEglContext *context, QPaintDevice *device,
const QEglProperties *properties = 0)
{
// Get the screen surface functions, which are used to create native ids.
QGLScreen *glScreen = glScreenForDevice(device);
if (!glScreen)
- return false;
+ return EGL_NO_SURFACE;
QGLScreenSurfaceFunctions *funcs = glScreen->surfaceFunctions();
if (!funcs)
- return false;
+ return EGL_NO_SURFACE;
// Create the native drawable for the paint device.
int devType = device->devType();
@@ -143,7 +143,7 @@ static bool qt_egl_create_surface
}
if (!ok) {
qWarning("QEglContext::createSurface(): Cannot create the native EGL drawable");
- return false;
+ return EGL_NO_SURFACE;
}
// Create the EGL surface to draw into, based on the native drawable.
@@ -160,12 +160,9 @@ static bool qt_egl_create_surface
surf = eglCreatePixmapSurface
(context->display(), context->config(), pixmapDrawable, props);
}
- if (surf == EGL_NO_SURFACE) {
+ if (surf == EGL_NO_SURFACE)
qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
- return false;
- }
- context->setSurface(surf);
- return true;
+ return surf;
}
bool QGLContext::chooseContext(const QGLContext* shareContext)
@@ -223,12 +220,12 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
// Create the EGL surface to draw into. We cannot use
// QEglContext::createSurface() because it does not have
// access to the QGLScreen.
- if (!qt_egl_create_surface(d->eglContext, device())) {
+ d->eglSurface = qt_egl_create_surface(d->eglContext, device());
+ if (d->eglSurface == EGL_NO_SURFACE) {
delete d->eglContext;
d->eglContext = 0;
return false;
}
- d->eglSurface = d->eglContext->surface();
return true;
}