diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/openvg/qwindowsurface_vgegl.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index f46d6c2..46a905f 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -659,6 +659,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) #endif windowSurface = context->createSurface(widget, &surfaceProps); isPaintingActive = false; + needToSwap = true; } #else if (context && size != newSize) { @@ -710,20 +711,21 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) needToSwap = false; } #endif -#if !defined(QVG_NO_PRESERVED_SWAP) - // Try to force the surface back buffer to preserve its contents. - if (needToSwap) { - eglGetError(); // Clear error state first. - eglSurfaceAttrib(QEglContext::display(), surface, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - if (eglGetError() != EGL_SUCCESS) { - qWarning("QVG: could not enable preserved swap"); - } - } -#endif windowSurface = surface; isPaintingActive = false; } + +#if !defined(QVG_NO_PRESERVED_SWAP) + // Try to force the surface back buffer to preserve its contents. + if (needToSwap) { + eglGetError(); // Clear error state first. + eglSurfaceAttrib(QEglContext::display(), windowSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); + if (eglGetError() != EGL_SUCCESS) { + qWarning("QVG: could not enable preserved swap"); + } + } +#endif return context; } |