diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-07 15:15:38 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2014-08-08 15:56:55 +0300 |
commit | da54d17352dfc4070eb6fa105ce853e3d35490ef (patch) | |
tree | 1076956f67cb0355c3b525e271c17a24f36906a5 /softwarecontext/renderloop.h | |
parent | 78a6d2d7340fbfdc5b5dbfd9974435714bb786fb (diff) |
First implementation of images and rectangles
Change-Id: Ia905d6dfe3d9922ef820085fedc5195be8ace1da
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
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 |