summaryrefslogtreecommitdiffstats
path: root/src/openvg/qwindowsurface_vgegl.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-27 10:05:25 +0200
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-27 10:05:25 +0200
commit710aa7f8fbd72ee303c3348aa3aaf12d6984964d (patch)
tree5e8ec704b3a3e44aee0a64df99f28be70f50f2b0 /src/openvg/qwindowsurface_vgegl.cpp
parent507a819971cd0cb3d6acba96177ab3553dae9867 (diff)
Specify swap behavior preserved bit in openvg engine.
Unlike OpenGL, the EGL_SWAP_BEHAVIOR_PRESERVED_BIT was not set for the EGL configuration used with OpenVG. Yet the preserved swap was enabled still, which, according to the EGL spec, should fail. To make sure it still works with other EGL implementations, the bit is now set in the configuration. Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg/qwindowsurface_vgegl.cpp')
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 866453ff60..3205a1104b 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -269,19 +269,20 @@ static QEglContext *createContext(QPaintDevice *device)
configProps.setPixelFormat(QImage::Format_ARGB32); // XXX
configProps.setValue(EGL_ALPHA_MASK_SIZE, 1);
#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT |
- EGL_VG_ALPHA_FORMAT_PRE_BIT);
+ configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT
+ | EGL_SWAP_BEHAVIOR_PRESERVED_BIT
+ | EGL_VG_ALPHA_FORMAT_PRE_BIT);
configProps.setRenderableType(QEgl::OpenVG);
if (!context->chooseConfig(configProps)) {
// Try again without the "pre" bit.
- configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT);
+ configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT);
if (!context->chooseConfig(configProps)) {
delete context;
return 0;
}
}
#else
- configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT);
+ configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT);
configProps.setRenderableType(QEgl::OpenVG);
if (!context->chooseConfig(configProps)) {
delete context;