diff options
Diffstat (limited to 'softwarecontext/renderloop.h')
-rw-r--r-- | softwarecontext/renderloop.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/softwarecontext/renderloop.h b/softwarecontext/renderloop.h new file mode 100644 index 0000000000..8475a0b65b --- /dev/null +++ b/softwarecontext/renderloop.h @@ -0,0 +1,53 @@ +#ifndef RENDERLOOP_H +#define RENDERLOOP_H + +#include <private/qsgrenderloop_p.h> + +class RenderLoop : public QSGRenderLoop +{ + Q_OBJECT +public: + RenderLoop(); + ~RenderLoop(); + + void show(QQuickWindow *window); + void hide(QQuickWindow *window); + + void windowDestroyed(QQuickWindow *window); + + void renderWindow(QQuickWindow *window); + void exposureChanged(QQuickWindow *window); + QImage grab(QQuickWindow *window); + + void maybeUpdate(QQuickWindow *window); + void update(QQuickWindow *window) { maybeUpdate(window); } // identical for this implementation. + + void releaseResources(QQuickWindow *) { } + + virtual QSurface::SurfaceType windowSurfaceType() const; + + QAnimationDriver *animationDriver() const { return 0; } + + QSGContext *sceneGraphContext() const; + QSGRenderContext *createRenderContext(QSGContext *) const { return rc; } + + bool event(QEvent *); + + struct WindowData { + bool updatePending : 1; + bool grabOnly : 1; + }; + + QHash<QQuickWindow *, WindowData> m_windows; + + QSGContext *sg; + QSGRenderContext *rc; + + QImage grabContent; + int m_update_timer; + + bool eventPending; + +}; + +#endif // RENDERLOOP_H |