summaryrefslogtreecommitdiff
path: root/tools/qmeegographicssystemhelper
diff options
context:
space:
mode:
authorMichael Dominic K <mdk@codethink.co.uk>2011-01-04 10:53:58 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2011-01-04 10:53:58 +0100
commit177f2a2f17251c22f57944e9dd100ec8515b891a (patch)
tree8e5d6a9eb2bd53f9a9e19ae7c7c664bd3d91ec6f /tools/qmeegographicssystemhelper
parentb5acfc61f3989ab8b72f784431fc5ab168ffb975 (diff)
downloadqt4-tools-177f2a2f17251c22f57944e9dd100ec8515b891a.tar.gz
QMeeGoGraphicsSystemHelper::setSwapBehavior implementation.
Merge-request: 993 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'tools/qmeegographicssystemhelper')
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp15
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h18
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro2
3 files changed, 34 insertions, 1 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
index b660eb37ea..37cc4171b1 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
@@ -45,6 +45,7 @@
#include <private/qapplication_p.h>
#include <private/qgraphicssystem_runtime_p.h>
#include <private/qpixmap_raster_p.h>
+#include <private/qwindowsurface_gl_p.h>
#include "qmeegoruntime.h"
#include "qmeegoswitchevent.h"
@@ -153,3 +154,17 @@ void QMeeGoGraphicsSystemHelper::setTranslucent(bool translucent)
ENSURE_RUNNING_MEEGO;
QMeeGoRuntime::setTranslucent(translucent);
}
+
+void QMeeGoGraphicsSystemHelper::setSwapBehavior(SwapMode mode)
+{
+ ENSURE_RUNNING_MEEGO;
+
+ if (mode == AutomaticSwap)
+ QGLWindowSurface::swapBehavior = QGLWindowSurface::AutomaticSwap;
+ else if (mode == AlwaysFullSwap)
+ QGLWindowSurface::swapBehavior = QGLWindowSurface::AlwaysFullSwap;
+ else if (mode == AlwaysPartialSwap)
+ QGLWindowSurface::swapBehavior = QGLWindowSurface::AlwaysPartialSwap;
+ else if (mode == KillSwap)
+ QGLWindowSurface::swapBehavior = QGLWindowSurface::KillSwap;
+}
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
index 6df3c22931..c8dccc24a4 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
@@ -186,6 +186,24 @@ public:
on the top-level widget *before* you show it instead.
*/
static void setTranslucent(bool translucent);
+
+ //! Used to specify the mode for swapping buffers in double-buffered GL rendering.
+ enum SwapMode {
+ AutomaticSwap, /**< Automatically choose netween full and partial updates (25% threshold) */
+ AlwaysFullSwap, /**< Always do a full swap even if partial updates support present */
+ AlwaysPartialSwap, /**< Always do a partial swap (if support present) no matter what threshold */
+ KillSwap /**< Do not perform buffer swapping at all (no picture) */
+ };
+
+ //! Sets the buffer swapping mode.
+ /*!
+ This can be only called when running with the meego graphics system.
+ The KillSwap mode can be specififed to effectively block painting.
+
+ This functionality should be used only by applications counting on a specific behavior.
+ Most applications should use the default automatic behavior.
+ */
+ static void setSwapBehavior(SwapMode mode);
};
#endif
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro
index 360847ee21..7639ad7b65 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro
@@ -3,7 +3,7 @@ TARGET = QtMeeGoGraphicsSystemHelper
include(../../src/qbase.pri)
-QT += gui
+QT += gui opengl
INCLUDEPATH += '../../src/plugins/graphicssystems/meego'
HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegoswitchevent.h