summaryrefslogtreecommitdiffstats
path: root/src/compositor/hardware_integration
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2013-12-17 15:27:59 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-27 22:37:38 +0100
commiteb40ab5af6e85767b4dbff9fa1bf21f6ad20ad37 (patch)
tree7f32434a460ba0bd6cf21d8639a716bf42d37186 /src/compositor/hardware_integration
parent62568606a22ab9a6742a196956577356c0e10656 (diff)
update server buffer interfaces
Change-Id: Ifc10b17deedc800167f3d03b2e4437e6b702ffa5 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/compositor/hardware_integration')
-rw-r--r--src/compositor/hardware_integration/qwaylandserverbufferintegration.cpp29
-rw-r--r--src/compositor/hardware_integration/qwaylandserverbufferintegration.h21
2 files changed, 30 insertions, 20 deletions
diff --git a/src/compositor/hardware_integration/qwaylandserverbufferintegration.cpp b/src/compositor/hardware_integration/qwaylandserverbufferintegration.cpp
index df5644163..8c742a847 100644
--- a/src/compositor/hardware_integration/qwaylandserverbufferintegration.cpp
+++ b/src/compositor/hardware_integration/qwaylandserverbufferintegration.cpp
@@ -40,28 +40,26 @@
#include "qwaylandserverbufferintegration.h"
-QWaylandServerBuffer::QWaylandServerBuffer()
+QT_BEGIN_NAMESPACE
+
+QWaylandServerBuffer::QWaylandServerBuffer(const QSize &size, QWaylandServerBuffer::Format format)
+ : m_size(size)
+ , m_format(format)
{ }
QWaylandServerBuffer::~QWaylandServerBuffer()
{ }
-void QWaylandServerBuffer::sendToClient(struct ::wl_client *)
-{ }
-GLuint QWaylandServerBuffer::createTexture(QOpenGLContext *)
+bool QWaylandServerBuffer::isYInverted() const
{
- return 0;
-}
-
-bool QWaylandServerBuffer::isYInverted(struct ::wl_resource *) const
-{
- return true;
+ return false;
}
QSize QWaylandServerBuffer::size() const
-{
- return QSize();
-}
+{ return m_size; }
+
+QWaylandServerBuffer::Format QWaylandServerBuffer::format() const
+{ return m_format; }
QWaylandServerBufferIntegration::QWaylandServerBufferIntegration()
{ }
@@ -74,8 +72,11 @@ void QWaylandServerBufferIntegration::initializeHardware(QWaylandCompositor *com
Q_UNUSED(compositor);
}
-QWaylandServerBuffer *QWaylandServerBufferIntegration::createServerBuffer()
+QWaylandServerBuffer *QWaylandServerBufferIntegration::createServerBuffer(const QSize &size, QWaylandServerBuffer::Format format)
{
+ Q_UNUSED(size);
+ Q_UNUSED(format);
return 0;
}
+QT_END_NAMESPACE
diff --git a/src/compositor/hardware_integration/qwaylandserverbufferintegration.h b/src/compositor/hardware_integration/qwaylandserverbufferintegration.h
index 8de519816..35614d513 100644
--- a/src/compositor/hardware_integration/qwaylandserverbufferintegration.h
+++ b/src/compositor/hardware_integration/qwaylandserverbufferintegration.h
@@ -61,15 +61,24 @@ namespace QtWayland {
class Q_COMPOSITOR_EXPORT QWaylandServerBuffer
{
public:
- QWaylandServerBuffer();
+ enum Format {
+ RGBA32,
+ A8
+ };
+
+ QWaylandServerBuffer(const QSize &size, QWaylandServerBuffer::Format format);
virtual ~QWaylandServerBuffer();
- virtual void sendToClient(struct ::wl_client *);
+ virtual struct ::wl_resource *resourceForClient(struct ::wl_client *) = 0;
- virtual GLuint createTexture(QOpenGLContext *);
- virtual bool isYInverted(struct ::wl_resource *) const;
+ virtual GLuint createTexture() = 0;
+ virtual bool isYInverted() const;
- virtual QSize size() const;
+ QSize size() const;
+ Format format() const;
+protected:
+ QSize m_size;
+ Format m_format;
};
class Q_COMPOSITOR_EXPORT QWaylandServerBufferIntegration
@@ -80,7 +89,7 @@ public:
virtual void initializeHardware(QWaylandCompositor *);
- virtual QWaylandServerBuffer *createServerBuffer();
+ virtual QWaylandServerBuffer *createServerBuffer(const QSize &size, QWaylandServerBuffer::Format format);
};
QT_END_NAMESPACE