Changeset View
Changeset View
Standalone View
Standalone View
linux_dmabuf.cpp
Show All 24 Lines | |||||
25 | 25 | | |||
26 | namespace KWin | 26 | namespace KWin | ||
27 | { | 27 | { | ||
28 | 28 | | |||
29 | DmabufBuffer::DmabufBuffer(const QVector<Plane> &planes, | 29 | DmabufBuffer::DmabufBuffer(const QVector<Plane> &planes, | ||
30 | uint32_t format, | 30 | uint32_t format, | ||
31 | const QSize &size, | 31 | const QSize &size, | ||
32 | Flags flags) | 32 | Flags flags) | ||
33 | : KWayland::Server::LinuxDmabufUnstableV1Buffer(format, size) | 33 | : KWaylandServer::LinuxDmabufUnstableV1Buffer(format, size) | ||
34 | , m_planes(planes) | 34 | , m_planes(planes) | ||
35 | , m_format(format) | 35 | , m_format(format) | ||
36 | , m_size(size) | 36 | , m_size(size) | ||
37 | , m_flags(flags) | 37 | , m_flags(flags) | ||
38 | { | 38 | { | ||
39 | waylandServer()->addLinuxDmabufBuffer(this); | 39 | waylandServer()->addLinuxDmabufBuffer(this); | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | DmabufBuffer::~DmabufBuffer() | 42 | DmabufBuffer::~DmabufBuffer() | ||
43 | { | 43 | { | ||
44 | // Close all open file descriptors | 44 | // Close all open file descriptors | ||
45 | for (int i = 0; i < m_planes.count(); i++) { | 45 | for (int i = 0; i < m_planes.count(); i++) { | ||
46 | if (m_planes[i].fd != -1) | 46 | if (m_planes[i].fd != -1) | ||
47 | ::close(m_planes[i].fd); | 47 | ::close(m_planes[i].fd); | ||
48 | m_planes[i].fd = -1; | 48 | m_planes[i].fd = -1; | ||
49 | } | 49 | } | ||
50 | if (waylandServer()) { | 50 | if (waylandServer()) { | ||
51 | waylandServer()->removeLinuxDmabufBuffer(this); | 51 | waylandServer()->removeLinuxDmabufBuffer(this); | ||
52 | } | 52 | } | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | LinuxDmabuf::LinuxDmabuf() | 55 | LinuxDmabuf::LinuxDmabuf() | ||
56 | : KWayland::Server::LinuxDmabufUnstableV1Interface::Impl() | 56 | : KWaylandServer::LinuxDmabufUnstableV1Interface::Impl() | ||
57 | { | 57 | { | ||
58 | Q_ASSERT(waylandServer()); | 58 | Q_ASSERT(waylandServer()); | ||
59 | waylandServer()->linuxDmabuf()->setImpl(this); | 59 | waylandServer()->linuxDmabuf()->setImpl(this); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | LinuxDmabuf::~LinuxDmabuf() | 62 | LinuxDmabuf::~LinuxDmabuf() | ||
63 | { | 63 | { | ||
64 | waylandServer()->linuxDmabuf()->setImpl(nullptr); | 64 | waylandServer()->linuxDmabuf()->setImpl(nullptr); | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | using Plane = KWayland::Server::LinuxDmabufUnstableV1Interface::Plane; | 67 | using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; | ||
68 | using Flags = KWayland::Server::LinuxDmabufUnstableV1Interface::Flags; | 68 | using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; | ||
69 | 69 | | |||
70 | KWayland::Server::LinuxDmabufUnstableV1Buffer* LinuxDmabuf::importBuffer(const QVector<Plane> &planes, | 70 | KWaylandServer::LinuxDmabufUnstableV1Buffer* LinuxDmabuf::importBuffer(const QVector<Plane> &planes, | ||
71 | uint32_t format, | 71 | uint32_t format, | ||
72 | const QSize &size, | 72 | const QSize &size, | ||
73 | Flags flags) | 73 | Flags flags) | ||
74 | { | 74 | { | ||
75 | Q_UNUSED(planes) | 75 | Q_UNUSED(planes) | ||
76 | Q_UNUSED(format) | 76 | Q_UNUSED(format) | ||
77 | Q_UNUSED(size) | 77 | Q_UNUSED(size) | ||
78 | Q_UNUSED(flags) | 78 | Q_UNUSED(flags) | ||
Show All 10 Lines |