KWin
Loading...
Searching...
No Matches
src
opengl
eglswapchain.h
Go to the documentation of this file.
1
/*
2
KWin - the KDE window manager
3
This file is part of the KDE project.
4
5
SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
6
7
SPDX-License-Identifier: GPL-2.0-or-later
8
*/
9
#pragma once
10
11
#include "kwin_export.h"
12
13
#include <QList>
14
#include <QSize>
15
16
#include <cstdint>
17
#include <epoxy/egl.h>
18
#include <memory>
19
20
namespace
KWin
21
{
22
23
class
GraphicsBufferAllocator;
24
class
GraphicsBuffer;
25
class
GLFramebuffer;
26
class
GLTexture;
27
class
EglContext;
28
29
class
KWIN_EXPORT
EglSwapchainSlot
30
{
31
public
:
32
EglSwapchainSlot
(
GraphicsBuffer
*buffer, std::unique_ptr<GLFramebuffer> &&framebuffer,
const
std::shared_ptr<GLTexture> &texture);
33
~EglSwapchainSlot
();
34
35
GraphicsBuffer
*buffer()
const
;
36
std::shared_ptr<GLTexture> texture()
const
;
37
GLFramebuffer
*framebuffer()
const
;
38
int
age()
const
;
39
40
static
std::shared_ptr<EglSwapchainSlot> create(
EglContext
*context,
GraphicsBuffer
*buffer);
41
42
private
:
43
GraphicsBuffer
*m_buffer;
44
std::unique_ptr<GLFramebuffer> m_framebuffer;
45
std::shared_ptr<GLTexture> m_texture;
46
int
m_age = 0;
47
friend
class
EglSwapchain
;
48
};
49
50
class
KWIN_EXPORT
EglSwapchain
51
{
52
public
:
53
EglSwapchain
(
GraphicsBufferAllocator
*allocator,
EglContext
*context,
const
QSize &size, uint32_t
format
, uint64_t modifier,
const
std::shared_ptr<EglSwapchainSlot> &seed);
54
~EglSwapchain
();
55
56
QSize size()
const
;
57
uint32_t
format
()
const
;
58
uint64_t modifier()
const
;
59
60
std::shared_ptr<EglSwapchainSlot> acquire();
61
void
release(std::shared_ptr<EglSwapchainSlot> slot);
62
63
static
std::shared_ptr<EglSwapchain> create(
GraphicsBufferAllocator
*allocator,
EglContext
*context,
const
QSize &size, uint32_t
format
,
const
QList<uint64_t> &modifiers);
64
65
private
:
66
GraphicsBufferAllocator
*m_allocator;
67
EglContext
*m_context;
68
QSize m_size;
69
uint32_t m_format;
70
uint64_t m_modifier;
71
QList<std::shared_ptr<EglSwapchainSlot>> m_slots;
72
};
73
74
}
// namespace KWin
KWin::EglContext
Definition
eglcontext.h:26
KWin::EglSwapchain
Definition
eglswapchain.h:51
KWin::EglSwapchainSlot
Definition
eglswapchain.h:30
KWin::GLFramebuffer
OpenGL framebuffer object.
Definition
glframebuffer.h:37
KWin::GraphicsBufferAllocator
Definition
graphicsbufferallocator.h:38
KWin::GraphicsBuffer
Definition
graphicsbuffer.h:57
KWin
Definition
activation_test.cpp:20
KWin::format
GLenum format
Definition
gltexture.cpp:49
Generated on Sat Feb 17 2024 01:42:09 for KWin by
1.10.0