diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2012-02-14 21:03:47 +0100 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2012-02-29 16:28:53 +0100 |
commit | cdb8ca28a820338ffc4e86f7d6adb17ea232f0c7 (patch) | |
tree | dd7cfe64a47ab004ff336e19cfb63d7ba406f91a /src/compositor/wayland_wrapper/wlsurface.h | |
parent | 10c2c96c58f7400d5affe600cb268403c64f2245 (diff) |
Refactor wlsurface,
Now we treat all buffers the same (shm or not).
We advance the queue when we send the frame signal
Change-Id: Id62b1037e03fbeae82048f5ab9078fa81ed8e45d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlsurface.h')
-rw-r--r-- | src/compositor/wayland_wrapper/wlsurface.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/compositor/wayland_wrapper/wlsurface.h b/src/compositor/wayland_wrapper/wlsurface.h index 99476c826..b79691662 100644 --- a/src/compositor/wayland_wrapper/wlsurface.h +++ b/src/compositor/wayland_wrapper/wlsurface.h @@ -85,14 +85,14 @@ public: uint id() const { return base()->resource.object.id; } - QImage image() const; - QPointF pos() const; void setPos(const QPointF &pos); QSize size() const; void setSize(const QSize &size); + QImage image() const; + #ifdef QT_COMPOSITOR_WAYLAND_GL GLuint textureId(QOpenGLContext *context) const; #endif @@ -124,9 +124,9 @@ private: Compositor *m_compositor; WaylandSurface *m_waylandSurface; - SurfaceBuffer *m_surfaceBuffer; - SurfaceBuffer *m_textureBuffer; - QList<SurfaceBuffer*> m_bufferQueue; + SurfaceBuffer *m_backBuffer; + SurfaceBuffer *m_frontBuffer; + QList<SurfaceBuffer *> m_bufferQueue; bool m_surfaceMapped; QPoint m_lastLocalMousePos; @@ -144,8 +144,9 @@ private: QPointF m_position; QSize m_size; - void doUpdate(const QRect &rect); - void newCurrentBuffer(); + inline SurfaceBuffer *currentSurfaceBuffer() const; + void advanceBufferQueue(); + void doUpdate(); SurfaceBuffer *createSurfaceBuffer(struct wl_buffer *buffer); void frameFinishedInternal(); bool postBuffer(); @@ -163,6 +164,10 @@ private: }; +inline SurfaceBuffer *Surface::currentSurfaceBuffer() const { + return m_backBuffer? m_backBuffer : m_frontBuffer; +} + } #endif //WL_SURFACE_H |