KWin
Loading...
Searching...
No Matches
graphicsbuffer.cpp
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2023 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
9
10#include <drm_fourcc.h>
11
12namespace KWin
13{
14
16 : QObject(parent)
17{
18}
19
21{
22 return m_refCount > 0;
23}
24
26{
27 return m_dropped;
28}
29
31{
32 ++m_refCount;
33}
34
36{
37 Q_ASSERT(m_refCount > 0);
38 --m_refCount;
39 if (!m_refCount) {
40 if (m_dropped) {
41 delete this;
42 } else {
43 Q_EMIT released();
44 }
45 }
46}
47
49{
50 m_dropped = true;
51
52 if (!m_refCount) {
53 delete this;
54 }
55}
56
58{
59 return {};
60}
61
63{
64}
65
67{
68 return nullptr;
69}
70
72{
73 return nullptr;
74}
75
77{
78 const auto info = FormatInfo::get(format);
79 return info && info->alphaBits > 0;
80}
81
82} // namespace KWin
83
84#include "moc_graphicsbuffer.cpp"
virtual Map map(MapFlags flags)
static bool alphaChannelFromDrmFormat(uint32_t format)
virtual const DmaBufAttributes * dmabufAttributes() const
virtual const ShmAttributes * shmAttributes() const
GraphicsBuffer(QObject *parent=nullptr)
GLenum format
Definition gltexture.cpp:49
static std::optional< FormatInfo > get(uint32_t drmFormat)