diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-25 00:21:23 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-25 00:21:23 (GMT) |
commit | f3d15516572394b6bcd44a89dd66516fa4eba56e (patch) | |
tree | b97aa3bc1826d21e6fd8b39f657b1e1e63369270 /src/openvg/qwindowsurface_vgegl.cpp | |
parent | 7421f79f57f475b9e96e53e5cbd9861c428d4ae3 (diff) | |
download | Qt-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/openvg/qwindowsurface_vgegl.cpp')
-rw-r--r-- | src/openvg/qwindowsurface_vgegl.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index cb3f7fc..3ae911f 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -586,9 +586,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) surfaceProps.removeValue(EGL_VG_ALPHA_FORMAT); } #endif - context->createSurface(widget, &surfaceProps); - windowSurface = context->surface(); - context->setSurface(EGL_NO_SURFACE); + windowSurface = context->createSurface(widget, &surfaceProps); isPaintingActive = false; } #else @@ -625,7 +623,8 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) surfaceProps.removeValue(EGL_VG_ALPHA_FORMAT); } #endif - if (!context->createSurface(widget, &surfaceProps)) { + EGLSurface surface = context->createSurface(widget, &surfaceProps); + if (surface == EGL_NO_SURFACE) { qt_vg_destroy_context(context); context = 0; return 0; @@ -644,15 +643,14 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) // Try to force the surface back buffer to preserve its contents. if (needToSwap) { eglGetError(); // Clear error state first. - eglSurfaceAttrib(context->display(), context->surface(), + eglSurfaceAttrib(context->display(), surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); if (eglGetError() != EGL_SUCCESS) { qWarning("QVG: could not enable preserved swap"); } } #endif - windowSurface = context->surface(); - context->setSurface(EGL_NO_SURFACE); + windowSurface = surface; isPaintingActive = false; } return context; |