summaryrefslogtreecommitdiffstats
path: root/src/gui/egl/qegl.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-19 03:23:19 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-19 03:23:19 (GMT)
commitdf6549d1b95af017305744af04a7bb3b10025660 (patch)
tree0919c82a21e0b0056f0eb180ce139c8ab99eb633 /src/gui/egl/qegl.cpp
parent84f984b24400aed7cc72fdf432a076f98bc142a2 (diff)
parent63d0b54df365380107cea7017c7893c7d04df13e (diff)
downloadQt-df6549d1b95af017305744af04a7bb3b10025660.zip
Qt-df6549d1b95af017305744af04a7bb3b10025660.tar.gz
Qt-df6549d1b95af017305744af04a7bb3b10025660.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (351 commits) Fix compilation after merge fix for looping crash log on data abort Allow commenting of individual files in generated pkg files. Removed README.s60-mkspec. Fixed install docs for Qt for Symbian on Linux. Performance docs. Added symbian defs for e55781212532e2abcdd1cef8548b146fb14f0713 Check for binding having been deleted in more places Position GridView and ListView footer correctly when model cleared. Clean up particle motion documentation Finish QML for Qt Programmers section Distinguish Qt Quick, Qt Declarative and QML on the landing page Split responsibilities in QDeclarativeExpression more cleanly improvements to docs and examples Fix test for get() to check for undefined return values Enter key performs same action as Return key in QML demos. Revert "Making network reconnect happen after teardown." Revert "Adding some error checking for setdefaultif" Fixed a possible hanging bug in the Symbian networking. Fixed a network hanging bug on Symbian. ...
Diffstat (limited to 'src/gui/egl/qegl.cpp')
-rw-r--r--src/gui/egl/qegl.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index e6ea198..605b1e6 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -515,6 +515,31 @@ bool QEglContext::swapBuffers(EGLSurface surface)
return ok;
}
+bool QEglContext::swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region) {
+ QVector<QRect> qrects = region->rects();
+ EGLint *gl_rects;
+ uint count;
+ uint i;
+
+ count = qrects.size();
+ QVarLengthArray <EGLint> arr(4 * count);
+ gl_rects = arr.data();
+ for (i = 0; i < count; i++) {
+ QRect qrect = qrects[i];
+
+ gl_rects[4 * i + 0] = qrect.x();
+ gl_rects[4 * i + 1] = qrect.y();
+ gl_rects[4 * i + 2] = qrect.width();
+ gl_rects[4 * i + 3] = qrect.height();
+ }
+
+ bool ok = QEgl::eglSwapBuffersRegion2NOK(QEgl::display(), surface, count, gl_rects);
+
+ if (!ok)
+ qWarning() << "QEglContext::swapBuffersRegion2NOK():" << QEgl::errorString();
+ return ok;
+}
+
int QEglContext::configAttrib(int name) const
{
EGLint value;
@@ -532,6 +557,9 @@ typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR);
static _eglCreateImageKHR qt_eglCreateImageKHR = 0;
static _eglDestroyImageKHR qt_eglDestroyImageKHR = 0;
+typedef EGLBoolean (EGLAPIENTRY *_eglSwapBuffersRegion2NOK)(EGLDisplay, EGLSurface, EGLint, const EGLint*);
+
+static _eglSwapBuffersRegion2NOK qt_eglSwapBuffersRegion2NOK = 0;
EGLDisplay QEgl::display()
{
@@ -560,6 +588,10 @@ EGLDisplay QEgl::display()
qt_eglDestroyImageKHR = (_eglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
}
#endif
+
+ if (QEgl::hasExtension("EGL_NOK_swap_region2")) {
+ qt_eglSwapBuffersRegion2NOK = (_eglSwapBuffersRegion2NOK) eglGetProcAddress("eglSwapBuffersRegion2NOK");
+ }
}
return dpy;
@@ -591,6 +623,18 @@ EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
return 0;
}
+EGLBoolean QEgl::eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
+{
+ if (qt_eglSwapBuffersRegion2NOK)
+ return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
+
+ QEgl::display(); // Initialises function pointers
+ if (qt_eglSwapBuffersRegion2NOK)
+ return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
+
+ qWarning("QEgl::eglSwapBuffersRegion2NOK() called but EGL_NOK_swap_region2 extension not present");
+ return 0;
+}
#ifndef Q_WS_X11
EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties)