KWin
Loading...
Searching...
No Matches
basiceglsurfacetexture_wayland.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
10
11namespace KWin
12{
13
14class AbstractEglBackend;
15class GraphicsBuffer;
16
18{
19public:
22
23 AbstractEglBackend *backend() const;
24
25 bool create() override;
26 void update(const QRegion &region) override;
27
28private:
29 bool loadShmTexture(GraphicsBuffer *buffer);
30 void updateShmTexture(GraphicsBuffer *buffer, const QRegion &region);
31 bool loadDmabufTexture(GraphicsBuffer *buffer);
32 void updateDmabufTexture(GraphicsBuffer *buffer);
33 void destroy();
34
35 enum class BufferType {
36 None,
37 Shm,
38 DmaBuf,
39 };
40
41 BufferType m_bufferType = BufferType::None;
42};
43
44} // namespace KWin
The OpenGLBackend creates and holds the OpenGL context and is responsible for Texture from Pixmap.