summaryrefslogtreecommitdiffstats
path: root/src/openvg/qwindowsurface_vgegl.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-12 17:39:28 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-12 17:39:28 +0200
commit3723f30a91eda1c1b247598913cfc02b001a02c9 (patch)
tree234241d0d6dbbf29857c4e66d2723f77239f31ee /src/openvg/qwindowsurface_vgegl.cpp
parent6f736694461edc25b6e757f40ab9cad6a9207ad4 (diff)
parent957f36cb498657f94f1b5b92f52713254ff8c051 (diff)
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: qmake/generators/symbian/symmake.cpp src/gui/image/qimage.cpp src/openvg/qwindowsurface_vgegl.cpp
Diffstat (limited to 'src/openvg/qwindowsurface_vgegl.cpp')
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 9b55fd2ca9..13ae807ba4 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(QEgl::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(QEgl::display(), windowSurface,
+ EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
+ if (eglGetError() != EGL_SUCCESS) {
+ qWarning("QVG: could not enable preserved swap");
+ }
+ }
+#endif
return context;
}