diff options
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 |