summaryrefslogtreecommitdiff
path: root/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-10-22 11:05:17 +0200
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-10-22 11:05:17 +0200
commit26139fcacc05b4a74fce1ef4e0db819118765310 (patch)
tree75ce453868e95faa72b8f3b871c58969bbeb2a7e /src/plugins/graphicssystems/meego/qmeegoextensions.cpp
parent9a216c3f7abeacae8b9e9f78e50ddfcfbb5e2fa3 (diff)
parentb8238ec7e41d483a9166eb7aebbf911f36976cdc (diff)
downloadqt4-tools-26139fcacc05b4a74fce1ef4e0db819118765310.tar.gz
Merge remote branch 'qt/master' into lighthouse-master
Conflicts: src/gui/kernel/qapplication_win.cpp src/gui/kernel/qwidget.cpp src/gui/text/qfontengine_ft.cpp
Diffstat (limited to 'src/plugins/graphicssystems/meego/qmeegoextensions.cpp')
-rw-r--r--src/plugins/graphicssystems/meego/qmeegoextensions.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
index e7f643970b..611c962f38 100644
--- a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp
@@ -46,6 +46,7 @@
bool QMeeGoExtensions::initialized = false;
bool QMeeGoExtensions::hasImageShared = false;
bool QMeeGoExtensions::hasSurfaceScaling = false;
+bool QMeeGoExtensions::hasLockSurface = false;
/* Extension funcs */
@@ -53,11 +54,15 @@ typedef EGLBoolean (EGLAPIENTRY *eglQueryImageNOKFunc)(EGLDisplay, EGLImageKHR,
typedef EGLNativeSharedImageTypeNOK (EGLAPIENTRY *eglCreateSharedImageNOKFunc)(EGLDisplay, EGLImageKHR, EGLint*);
typedef EGLBoolean (EGLAPIENTRY *eglDestroySharedImageNOKFunc)(EGLDisplay, EGLNativeSharedImageTypeNOK);
typedef EGLBoolean (EGLAPIENTRY *eglSetSurfaceScalingNOKFunc)(EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint);
+typedef EGLBoolean (EGLAPIENTRY *eglLockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRY *eglUnlockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface);
static eglQueryImageNOKFunc _eglQueryImageNOK = 0;
static eglCreateSharedImageNOKFunc _eglCreateSharedImageNOK = 0;
static eglDestroySharedImageNOKFunc _eglDestroySharedImageNOK = 0;
static eglSetSurfaceScalingNOKFunc _eglSetSurfaceScalingNOK = 0;
+static eglLockSurfaceKHRFunc _eglLockSurfaceKHR = 0;
+static eglUnlockSurfaceKHRFunc _eglUnlockSurfaceKHR = 0;
/* Public */
@@ -101,6 +106,22 @@ bool QMeeGoExtensions::eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surfac
return _eglSetSurfaceScalingNOK(dpy, surface, x, y, width, height);
}
+bool QMeeGoExtensions::eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
+{
+ if (! hasLockSurface)
+ qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!");
+
+ return _eglLockSurfaceKHR(display, surface, attrib_list);
+}
+
+bool QMeeGoExtensions::eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
+{
+ if (! hasLockSurface)
+ qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!");
+
+ return _eglUnlockSurfaceKHR(display, surface);
+}
+
/* Private */
void QMeeGoExtensions::initialize()
@@ -113,6 +134,8 @@ void QMeeGoExtensions::initialize()
_eglQueryImageNOK = (eglQueryImageNOKFunc) eglGetProcAddress("eglQueryImageNOK");
_eglCreateSharedImageNOK = (eglCreateSharedImageNOKFunc) eglGetProcAddress("eglCreateSharedImageNOK");
_eglDestroySharedImageNOK = (eglDestroySharedImageNOKFunc) eglGetProcAddress("eglDestroySharedImageNOK");
+ _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR");
+ _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR");
Q_ASSERT(_eglQueryImageNOK && _eglCreateSharedImageNOK && _eglDestroySharedImageNOK);
hasImageShared = true;
@@ -125,5 +148,14 @@ void QMeeGoExtensions::initialize()
Q_ASSERT(_eglSetSurfaceScalingNOK);
hasSurfaceScaling = true;
}
+
+ if (QEgl::hasExtension("EGL_KHR_lock_surface2")) {
+ qDebug("MeegoGraphics: found EGL_KHR_lock_surface2");
+ _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR");
+ _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR");
+
+ Q_ASSERT(_eglLockSurfaceKHR && _eglUnlockSurfaceKHR);
+ hasLockSurface = true;
+ }
}