diff options
author | Jorgen Lind <jorgen.lind@digia.com> | 2013-12-17 15:27:59 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-27 22:37:38 +0100 |
commit | eb40ab5af6e85767b4dbff9fa1bf21f6ad20ad37 (patch) | |
tree | 7f32434a460ba0bd6cf21d8639a716bf42d37186 /src/client/hardwareintegration | |
parent | 62568606a22ab9a6742a196956577356c0e10656 (diff) |
update server buffer interfaces
Change-Id: Ifc10b17deedc800167f3d03b2e4437e6b702ffa5
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/client/hardwareintegration')
-rw-r--r-- | src/client/hardwareintegration/qwaylandserverbufferintegration.cpp | 27 | ||||
-rw-r--r-- | src/client/hardwareintegration/qwaylandserverbufferintegration.h | 34 |
2 files changed, 54 insertions, 7 deletions
diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp index 66fec00ea..9b4174d31 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp @@ -1,5 +1,31 @@ #include "qwaylandserverbufferintegration.h" +QT_BEGIN_NAMESPACE + +QWaylandServerBuffer::QWaylandServerBuffer() + : m_user_data(0) +{ +} + +QWaylandServerBuffer::~QWaylandServerBuffer() +{ +} + +void QWaylandServerBuffer::setUserData(void *userData) +{ + m_user_data = userData; +} + +void *QWaylandServerBuffer::userData() const +{ + return m_user_data; +} + +QWaylandServerBuffer::Format QWaylandServerBuffer::format() const +{ + return m_format; +} + QWaylandServerBufferIntegration::QWaylandServerBufferIntegration() { } @@ -7,3 +33,4 @@ QWaylandServerBufferIntegration::~QWaylandServerBufferIntegration() { } +QT_END_NAMESPACE diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.h b/src/client/hardwareintegration/qwaylandserverbufferintegration.h index 0bb8a6ebc..fcb92aecd 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration.h @@ -51,6 +51,32 @@ QT_BEGIN_NAMESPACE class QWaylandDisplay; +class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBuffer +{ +public: + enum Format { + RGBA32, + A8 + }; + + QWaylandServerBuffer(); + virtual ~QWaylandServerBuffer(); + + //creates new texture for buffer + virtual GLuint createTexture() = 0; + + void setUserData(void *userData); + void *userData() const; + + Format format() const; + +protected: + Format m_format; + +private: + void *m_user_data; +}; + class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration { public: @@ -59,13 +85,7 @@ public: virtual void initialize(QWaylandDisplay *display) = 0; - //creates new texture for buffer - virtual GLuint createTextureFor(struct qt_server_buffer *buffer) = 0; - - //does not clean up textures. Just lets server know that it does - //not intend to use the buffer anymore. Textures should have been - //deleted prior to calling this function - virtual void release(struct qt_server_buffer *buffer) = 0; + virtual QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) = 0; }; QT_END_NAMESPACE |