KWin
Loading...
Searching...
No Matches
src
plugins
showfps
showfpseffect.h
Go to the documentation of this file.
1
/*
2
SPDX-FileCopyrightText: 2006 Lubos Lunak <l.lunak@kde.org>
3
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
4
SPDX-FileCopyrightText: 2022 Arjen Hiemstra <ahiemstra@heimr.nl>
5
6
SPDX-License-Identifier: GPL-2.0-or-later
7
*/
8
9
#pragma once
10
11
#include "
effect/effect.h
"
12
#include "
effect/offscreenquickview.h
"
13
14
#include <QElapsedTimer>
15
16
namespace
KWin
17
{
18
19
class
ShowFpsEffect
:
public
Effect
20
{
21
Q_OBJECT
22
Q_PROPERTY(
int
fps
READ
fps
NOTIFY
fpsChanged
)
23
Q_PROPERTY(
int
maximumFps
READ
maximumFps
NOTIFY
maximumFpsChanged
)
24
Q_PROPERTY(
int
paintDuration
READ
paintDuration
NOTIFY
paintChanged
)
25
Q_PROPERTY(
int
paintAmount
READ
paintAmount
NOTIFY
paintChanged
)
26
Q_PROPERTY(QColor
paintColor
READ
paintColor
NOTIFY
paintChanged
)
27
28
public:
29
ShowFpsEffect
();
30
~
ShowFpsEffect
() override;
31
32
int
fps
() const;
33
int
maximumFps
() const;
34
int
paintDuration
() const;
35
int
paintAmount
() const;
36
QColor
paintColor
() const;
37
38
void
prePaintScreen
(
ScreenPrePaintData
&data, std::chrono::milliseconds presentTime) override;
39
void
paintScreen
(const
RenderTarget
&renderTarget, const
RenderViewport
&viewport,
int
mask, const QRegion ®ion,
Output
*screen) override;
40
void
paintWindow
(const
RenderTarget
&renderTarget, const
RenderViewport
&viewport,
EffectWindow
*w,
int
mask, QRegion region,
KWin
::
WindowPaintData
&data) override;
41
void
postPaintScreen
() override;
42
43
static
bool
supported
();
44
45
Q_SIGNALS:
46
void
fpsChanged
();
47
void
maximumFpsChanged
();
48
void
paintChanged
();
49
50
private
:
51
std::unique_ptr<
OffscreenQuickScene
> m_scene;
52
53
uint32_t m_maximumFps = 0;
54
55
int
m_fps = 0;
56
int
m_newFps = 0;
57
std::chrono::steady_clock::time_point m_lastFpsTime;
58
59
int
m_paintDuration = 0;
60
int
m_paintAmount = 0;
61
QElapsedTimer m_paintDurationTimer;
62
};
63
64
}
// namespace KWin
KWin::Effect
Base class for all KWin effects.
Definition
effect.h:535
KWin::EffectWindow
Representation of a window used by/for Effect classes.
Definition
effectwindow.cpp:24
KWin::OffscreenQuickScene
Definition
offscreenquickview.cpp:68
KWin::Output
Definition
output.h:132
KWin::RenderTarget
Definition
rendertarget.h:21
KWin::RenderViewport
Definition
renderviewport.h:21
KWin::ScreenPrePaintData
Definition
effect.h:462
KWin::ShowFpsEffect
Definition
showfpseffect.h:20
KWin::ShowFpsEffect::postPaintScreen
void postPaintScreen() override
Definition
showfpseffect.cpp:110
KWin::ShowFpsEffect::paintColor
QColor paintColor
Definition
showfpseffect.h:26
KWin::ShowFpsEffect::maximumFps
int maximumFps
Definition
showfpseffect.h:23
KWin::ShowFpsEffect::fpsChanged
void fpsChanged()
KWin::ShowFpsEffect::paintWindow
void paintWindow(const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, KWin::WindowPaintData &data) override
Definition
showfpseffect.cpp:97
KWin::ShowFpsEffect::supported
static bool supported()
Definition
showfpseffect.cpp:120
KWin::ShowFpsEffect::maximumFpsChanged
void maximumFpsChanged()
KWin::ShowFpsEffect::paintChanged
void paintChanged()
KWin::ShowFpsEffect::prePaintScreen
void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override
Definition
showfpseffect.cpp:51
KWin::ShowFpsEffect::fps
int fps
Definition
showfpseffect.h:22
KWin::ShowFpsEffect::paintAmount
int paintAmount
Definition
showfpseffect.h:25
KWin::ShowFpsEffect::paintScreen
void paintScreen(const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion ®ion, Output *screen) override
Definition
showfpseffect.cpp:80
KWin::ShowFpsEffect::paintDuration
int paintDuration
Definition
showfpseffect.h:24
KWin::WindowPaintData
Definition
effect.h:300
effect.h
KWin
Definition
activation_test.cpp:20
offscreenquickview.h
private
#define private
Definition
screenedge_test.cpp:17
Generated on Sat Feb 17 2024 01:42:10 for KWin by
1.10.0