KWin
Loading...
Searching...
No Matches
src
scene
workspacescene_opengl.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: 2006 Lubos Lunak <l.lunak@kde.org>
6
SPDX-FileCopyrightText: 2009, 2010, 2011 Martin Gräßlin <mgraesslin@kde.org>
7
8
SPDX-License-Identifier: GPL-2.0-or-later
9
*/
10
11
#pragma once
12
13
#include "
platformsupport/scenes/opengl/openglbackend.h
"
14
15
#include "
scene/decorationitem.h
"
16
#include "
scene/shadowitem.h
"
17
#include "
scene/workspacescene.h
"
18
19
#include "
opengl/glutils.h
"
20
21
namespace
KWin
22
{
23
class
OpenGLBackend;
24
25
class
KWIN_EXPORT
WorkspaceSceneOpenGL
:
public
WorkspaceScene
26
{
27
Q_OBJECT
28
29
public
:
30
explicit
WorkspaceSceneOpenGL
(
OpenGLBackend
*backend);
31
~WorkspaceSceneOpenGL
()
override
;
32
33
bool
makeOpenGLContextCurrent()
override
;
34
void
doneOpenGLContextCurrent()
override
;
35
bool
supportsNativeFence()
const override
;
36
std::unique_ptr<DecorationRenderer> createDecorationRenderer(
Decoration::DecoratedClientImpl
*impl)
override
;
37
std::unique_ptr<ShadowTextureProvider> createShadowTextureProvider(
Shadow
*shadow)
override
;
38
bool
animationsSupported()
const override
;
39
40
OpenGLBackend
*
backend
()
const
41
{
42
return
m_backend;
43
}
44
45
std::pair<std::shared_ptr<GLTexture>,
ColorDescription
> textureForOutput(
Output
*output)
const override
;
46
47
private
:
48
OpenGLBackend
*m_backend;
49
GLuint vao = 0;
50
};
51
58
class
OpenGLShadowTextureProvider
:
public
ShadowTextureProvider
59
{
60
public
:
61
explicit
OpenGLShadowTextureProvider
(
Shadow
*
shadow
);
62
~OpenGLShadowTextureProvider
()
override
;
63
64
GLTexture
*
shadowTexture
()
65
{
66
return
m_texture.get();
67
}
68
69
void
update
()
override
;
70
71
private
:
72
std::shared_ptr<GLTexture> m_texture;
73
};
74
75
class
SceneOpenGLDecorationRenderer
:
public
DecorationRenderer
76
{
77
Q_OBJECT
78
public
:
79
enum class
DecorationPart
:
int
{
80
Left
,
81
Top
,
82
Right
,
83
Bottom
,
84
Count
85
};
86
explicit
SceneOpenGLDecorationRenderer
(
Decoration::DecoratedClientImpl
*
client
);
87
~SceneOpenGLDecorationRenderer
()
override
;
88
89
void
render
(
const
QRegion ®ion)
override
;
90
91
GLTexture
*
texture
()
92
{
93
return
m_texture.get();
94
}
95
GLTexture
*
texture
()
const
96
{
97
return
m_texture.get();
98
}
99
100
private
:
101
void
renderPart(
const
QRect &rect,
const
QRect &partRect,
const
QPoint &textureOffset, qreal
devicePixelRatio
,
bool
rotated =
false
);
102
static
const
QMargins texturePadForPart(
const
QRect &rect,
const
QRect &partRect);
103
void
resizeTexture();
104
int
toNativeSize(
int
size)
const
;
105
std::unique_ptr<GLTexture> m_texture;
106
};
107
108
}
// namespace
KWin::ColorDescription
Definition
colorspace.h:103
KWin::Decoration::DecoratedClientImpl
Definition
decoratedclient.h:27
KWin::DecorationRenderer
Definition
decorationitem.h:28
KWin::DecorationRenderer::client
Decoration::DecoratedClientImpl * client() const
Definition
decorationitem.cpp:38
KWin::DecorationRenderer::devicePixelRatio
qreal devicePixelRatio() const
Definition
decorationitem.cpp:73
KWin::GLTexture
Definition
gltexture.h:40
KWin::OpenGLBackend
The OpenGLBackend creates and holds the OpenGL context and is responsible for Texture from Pixmap.
Definition
openglbackend.h:38
KWin::OpenGLShadowTextureProvider
OpenGL implementation of Shadow.
Definition
workspacescene_opengl.h:59
KWin::OpenGLShadowTextureProvider::update
void update() override
Definition
workspacescene_opengl.cpp:184
KWin::OpenGLShadowTextureProvider::OpenGLShadowTextureProvider
OpenGLShadowTextureProvider(Shadow *shadow)
Definition
workspacescene_opengl.cpp:170
KWin::OpenGLShadowTextureProvider::~OpenGLShadowTextureProvider
~OpenGLShadowTextureProvider() override
Definition
workspacescene_opengl.cpp:175
KWin::OpenGLShadowTextureProvider::shadowTexture
GLTexture * shadowTexture()
Definition
workspacescene_opengl.h:64
KWin::Output
Definition
output.h:132
KWin::SceneOpenGLDecorationRenderer
Definition
workspacescene_opengl.h:76
KWin::SceneOpenGLDecorationRenderer::~SceneOpenGLDecorationRenderer
~SceneOpenGLDecorationRenderer() override
Definition
workspacescene_opengl.cpp:273
KWin::SceneOpenGLDecorationRenderer::DecorationPart
DecorationPart
Definition
workspacescene_opengl.h:79
KWin::SceneOpenGLDecorationRenderer::DecorationPart::Bottom
@ Bottom
KWin::SceneOpenGLDecorationRenderer::DecorationPart::Right
@ Right
KWin::SceneOpenGLDecorationRenderer::DecorationPart::Left
@ Left
KWin::SceneOpenGLDecorationRenderer::DecorationPart::Top
@ Top
KWin::SceneOpenGLDecorationRenderer::DecorationPart::Count
@ Count
KWin::SceneOpenGLDecorationRenderer::render
void render(const QRegion ®ion) override
Definition
workspacescene_opengl.cpp:330
KWin::SceneOpenGLDecorationRenderer::SceneOpenGLDecorationRenderer
SceneOpenGLDecorationRenderer(Decoration::DecoratedClientImpl *client)
Definition
workspacescene_opengl.cpp:267
KWin::SceneOpenGLDecorationRenderer::texture
GLTexture * texture()
Definition
workspacescene_opengl.h:91
KWin::SceneOpenGLDecorationRenderer::texture
GLTexture * texture() const
Definition
workspacescene_opengl.h:95
KWin::Shadow
Class representing a Window's Shadow to be rendered by the Compositor.
Definition
shadow.h:48
KWin::ShadowTextureProvider
Definition
shadowitem.h:18
KWin::ShadowTextureProvider::shadow
Shadow * shadow() const
Definition
shadowitem.h:23
KWin::WorkspaceScene
Definition
workspacescene.h:39
KWin::WorkspaceSceneOpenGL
Definition
workspacescene_opengl.h:26
KWin::WorkspaceSceneOpenGL::backend
OpenGLBackend * backend() const
Definition
workspacescene_opengl.h:40
decorationitem.h
glutils.h
KWin
Definition
activation_test.cpp:20
openglbackend.h
shadowitem.h
workspacescene.h
Generated on Sat Feb 17 2024 01:42:10 for KWin by
1.10.0