diff options
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/renderloop.cpp | 24 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/renderloop.h | 7 |
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 |