diff options
author | Jorgen Lind <jorgen.lind@digia.com> | 2014-01-03 17:14:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-03 17:38:53 +0100 |
commit | 76bb668aee8be5e8e1f022c4d09603d957e8e7e7 (patch) | |
tree | 65d61370b67fdafce74e92e19a18e6ec27ec3c5b /src/hardwareintegration | |
parent | 4df5d7613a035178bacbdd29569bb7a3453586f1 (diff) | |
download | qtwayland-76bb668aee8be5e8e1f022c4d09603d957e8e7e7.tar.gz |
Update the Compositor side ServerBufferIntegration
so its possible to ask for supported formats and make the
createServerBuffer function pure virtual
Change-Id: Idf07b993ea54927a51d43ef5e3a11fa1639dc1fe
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/hardwareintegration')
-rw-r--r-- | src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp | 16 | ||||
-rw-r--r-- | src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp index a38bf95f..3a7986ed 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp @@ -163,6 +163,22 @@ void DrmEglServerBufferIntegration::initializeHardware(QWaylandCompositor *compo QtWaylandServer::qt_drm_egl_server_buffer::init(compositor->waylandDisplay()); } +bool DrmEglServerBufferIntegration::supportsFormat(QWaylandServerBuffer::Format format) const +{ + switch (format) { + case QWaylandServerBuffer::RGBA32: + return true; + case QWaylandServerBuffer::A8: +#ifdef EGL_DRM_BUFFER_FORMAT_A8_MESA + return true; +#else + return false; +#endif + default: + return false; + } +} + QWaylandServerBuffer *DrmEglServerBufferIntegration::createServerBuffer(const QSize &size, QWaylandServerBuffer::Format format) { return new DrmEglServerBuffer(this, size, format); diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h index 0ccb7658..33c453a4 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h @@ -102,6 +102,7 @@ public: void initializeHardware(QWaylandCompositor *); + bool supportsFormat(QWaylandServerBuffer::Format format) const Q_DECL_OVERRIDE; QWaylandServerBuffer *createServerBuffer(const QSize &size, QWaylandServerBuffer::Format format) Q_DECL_OVERRIDE; EGLDisplay display() const { return m_egl_display; } |