aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2016-01-13 22:42:31 +0100
committerAndy Nichols <andy.nichols@theqtcompany.com>2016-01-14 09:07:22 +0000
commit416d79c3e6c62d6e82e5cf8cb2abfe4aaf93b273 (patch)
tree4b4b67dc3b7c319eb0528e28be93fdebc769f05c
parentcd52bbc7941c45f4e41b88b5cd89a84f6523625b (diff)
RenderLoop: Remove the exhaust delay timer.
This was replaced by a proper requestUpdate mechanism at the QWindow level, so it isn't needed anymore. See also: 72e889d12f9df162a22c39204c8333c5f4808da8 in qtdeclarative. Change-Id: Ie293c50321b13d06a2dd96a74be4edf31373bd51 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
-rw-r--r--src/plugins/scenegraph/softwarecontext/renderloop.cpp24
-rw-r--r--src/plugins/scenegraph/softwarecontext/renderloop.h7
2 files changed, 4 insertions, 27 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/renderloop.cpp b/src/plugins/scenegraph/softwarecontext/renderloop.cpp
index eb90474263..0a10ffa339 100644
--- a/src/plugins/scenegraph/softwarecontext/renderloop.cpp
+++ b/src/plugins/scenegraph/softwarecontext/renderloop.cpp
@@ -38,7 +38,6 @@
#include <private/qquickprofiler_p.h>
RenderLoop::RenderLoop()
- : eventPending(false)
{
sg = QSGContext::createDefaultContext();
rc = sg->createRenderContext();
@@ -193,12 +192,7 @@ void RenderLoop::maybeUpdate(QQuickWindow *window)
return;
m_windows[window].updatePending = true;
-
- if (!eventPending) {
- const int exhaust_delay = 5;
- m_update_timer = startTimer(exhaust_delay, Qt::PreciseTimer);
- eventPending = true;
- }
+ window->requestUpdate();
}
QSurface::SurfaceType RenderLoop::windowSurfaceType() const
@@ -214,19 +208,7 @@ QSGContext *RenderLoop::sceneGraphContext() const
}
-bool RenderLoop::event(QEvent *e)
+void RenderLoop::handleUpdateRequest(QQuickWindow *window)
{
- if (e->type() == QEvent::Timer) {
- eventPending = false;
- killTimer(m_update_timer);
- m_update_timer = 0;
- for (QHash<QQuickWindow *, WindowData>::const_iterator it = m_windows.constBegin();
- it != m_windows.constEnd(); ++it) {
- const WindowData &data = it.value();
- if (data.updatePending)
- renderWindow(it.key());
- }
- return true;
- }
- return QObject::event(e);
+ renderWindow(window);
}
diff --git a/src/plugins/scenegraph/softwarecontext/renderloop.h b/src/plugins/scenegraph/softwarecontext/renderloop.h
index 7d416ef8c9..6cdf7dab6f 100644
--- a/src/plugins/scenegraph/softwarecontext/renderloop.h
+++ b/src/plugins/scenegraph/softwarecontext/renderloop.h
@@ -50,6 +50,7 @@ public:
void maybeUpdate(QQuickWindow *window);
void update(QQuickWindow *window) { maybeUpdate(window); } // identical for this implementation.
+ void handleUpdateRequest(QQuickWindow *);
void releaseResources(QQuickWindow *) { }
@@ -60,8 +61,6 @@ public:
QSGContext *sceneGraphContext() const;
QSGRenderContext *createRenderContext(QSGContext *) const { return rc; }
- bool event(QEvent *);
-
struct WindowData {
bool updatePending : 1;
bool grabOnly : 1;
@@ -73,10 +72,6 @@ public:
QSGRenderContext *rc;
QImage grabContent;
- int m_update_timer;
-
- bool eventPending;
-
};
#endif // RENDERLOOP_H