File indexing completed on 2024-05-19 16:35:18
0001 /* 0002 SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #pragma once 0008 0009 #include "clientbuffer.h" 0010 #include "clientbufferintegration.h" 0011 0012 namespace KWaylandServer 0013 { 0014 class DrmClientBufferPrivate; 0015 0016 /** 0017 * The DrmClientBufferIntegration class provides support for wl_drm client buffers. 0018 */ 0019 class KWIN_EXPORT DrmClientBufferIntegration : public ClientBufferIntegration 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 explicit DrmClientBufferIntegration(Display *display); 0025 0026 ClientBuffer *createBuffer(::wl_resource *resource) override; 0027 }; 0028 0029 /** 0030 * The DrmClientBuffer class represents a wl_drm client buffer. 0031 * 0032 * Nowadays, the wl_drm protocol is de-facto deprecated with the introduction of the 0033 * linux-dmabuf-v1 protocol. Note that Vulkan WSI in Mesa still prefers wl_drm, but 0034 * that's about to change, https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4942/ 0035 */ 0036 class KWIN_EXPORT DrmClientBuffer : public ClientBuffer 0037 { 0038 Q_OBJECT 0039 Q_DECLARE_PRIVATE(DrmClientBuffer) 0040 0041 public: 0042 explicit DrmClientBuffer(wl_resource *resource, DrmClientBufferIntegration *integration); 0043 0044 int textureFormat() const; 0045 0046 QSize size() const override; 0047 bool hasAlphaChannel() const override; 0048 Origin origin() const override; 0049 }; 0050 0051 } // namespace KWaylandServer