src/openvg/qwindowsurface_vgegl.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 22 79de32ba3296
--- a/src/openvg/qwindowsurface_vgegl.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/src/openvg/qwindowsurface_vgegl.cpp	Mon May 03 13:17:34 2010 +0300
@@ -39,14 +39,12 @@
 **
 ****************************************************************************/
 
-#include "../src/gui/egl/qegl_p.h"
 #include "qwindowsurface_vgegl_p.h"
 #include "qpaintengine_vg_p.h"
 #include "qpixmapdata_vg_p.h"
 #include "qvgimagepool_p.h"
 #include "qvg_p.h"
 
-
 #if !defined(QT_NO_EGL)
 
 QT_BEGIN_NAMESPACE
@@ -179,9 +177,8 @@
         pd->prev->next = pd->next;
     } else {
         QVGSharedContext *shared = sharedContext();
-        if (shared) {
+        if (shared)
            shared->firstPixmap = pd->next;
-        }
     }
 }
 
@@ -233,9 +230,9 @@
     // Set the swap interval for the display.
     QByteArray interval = qgetenv("QT_VG_SWAP_INTERVAL");
     if (!interval.isEmpty())
-        eglSwapInterval(context->display(), interval.toInt());
+        eglSwapInterval(QEglContext::display(), interval.toInt());
     else
-        eglSwapInterval(context->display(), 1);
+        eglSwapInterval(QEglContext::display(), 1);
 
 #ifdef EGL_RENDERABLE_TYPE
     // Has the user specified an explicit EGL configuration to use?
@@ -249,16 +246,16 @@
         EGLint matching = 0;
         EGLConfig cfg;
         if (eglChooseConfig
-                    (context->display(), properties, &cfg, 1, &matching) &&
+                    (QEglContext::display(), properties, &cfg, 1, &matching) &&
                 matching > 0) {
             // Check that the selected configuration actually supports OpenVG
             // and then create the context with it.
             EGLint id = 0;
             EGLint type = 0;
             eglGetConfigAttrib
-                (context->display(), cfg, EGL_CONFIG_ID, &id);
+                (QEglContext::display(), cfg, EGL_CONFIG_ID, &id);
             eglGetConfigAttrib
-                (context->display(), cfg, EGL_RENDERABLE_TYPE, &type);
+                (QEglContext::display(), cfg, EGL_RENDERABLE_TYPE, &type);
             if (cfgId == id && (type & EGL_OPENVG_BIT) != 0) {
                 context->setConfig(cfg);
                 if (!context->createContext()) {
@@ -337,7 +334,7 @@
     shared->engine = 0;
     shared->context->doneCurrent();
     if (shared->surface != EGL_NO_SURFACE) {
-        eglDestroySurface(shared->context->display(), shared->surface);
+        eglDestroySurface(QEglContext::display(), shared->surface);
         shared->surface = EGL_NO_SURFACE;
     }
     delete shared->context;
@@ -415,7 +412,7 @@
             attribs[4] = EGL_NONE;
         }
         shared->surface = eglCreatePbufferSurface
-            (shared->context->display(), shared->context->config(), attribs);
+            (QEglContext::display(), shared->context->config(), attribs);
     }
     return shared->surface;
 }
@@ -558,7 +555,7 @@
             context->makeCurrent(mainSurface());
             recreateBackBuffer = false;
             if (backBufferSurface != EGL_NO_SURFACE) {
-                eglDestroySurface(context->display(), backBufferSurface);
+                eglDestroySurface(QEglContext::display(), backBufferSurface);
                 backBufferSurface = EGL_NO_SURFACE;
             }
             if (backBuffer != VG_INVALID_HANDLE) {
@@ -571,7 +568,7 @@
             if (backBuffer != VG_INVALID_HANDLE) {
                 // Create an EGL surface for rendering into the VGImage.
                 backBufferSurface = eglCreatePbufferFromClientBuffer
-                    (context->display(), EGL_OPENVG_IMAGE,
+                    (QEglContext::display(), EGL_OPENVG_IMAGE,
                      (EGLClientBuffer)(backBuffer),
                      context->config(), NULL);
                 if (backBufferSurface == EGL_NO_SURFACE) {
@@ -707,7 +704,7 @@
 #if defined(QVG_DIRECT_TO_WINDOW)
         // Did we get a direct to window rendering surface?
         EGLint buffer = 0;
-        if (eglQueryContext(context->display(), context->context(),
+        if (eglQueryContext(QEglContext::display(), context->context(),
                             EGL_RENDER_BUFFER, &buffer) &&
                 buffer == EGL_SINGLE_BUFFER) {
             needToSwap = false;
@@ -717,7 +714,7 @@
         // Try to force the surface back buffer to preserve its contents.
         if (needToSwap) {
             eglGetError();  // Clear error state first.
-            eglSurfaceAttrib(context->display(), surface,
+            eglSurfaceAttrib(QEglContext::display(), surface,
                              EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
             if (eglGetError() != EGL_SUCCESS) {
                 qWarning("QVG: could not enable preserved swap");