KWin
Loading...
Searching...
No Matches
renderloop.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "effect/globals.h"
10
11#include <QObject>
12
13namespace KWin
14{
15
16class RenderLoopPrivate;
17class SurfaceItem;
18class Item;
19class Output;
20
29class KWIN_EXPORT RenderLoop : public QObject
30{
31 Q_OBJECT
32
33public:
34 explicit RenderLoop(Output *output);
35 ~RenderLoop() override;
36
44 void inhibit();
45
49 void uninhibit();
50
55 void prepareNewFrame();
56
61 void beginPaint();
62
66 int refreshRate() const;
67
71 void setRefreshRate(int refreshRate);
72
73 void setPresentationSafetyMargin(std::chrono::nanoseconds safetyMargin);
74
78 void scheduleRepaint(Item *item = nullptr);
79
84 std::chrono::nanoseconds lastPresentationTimestamp() const;
85
91 std::chrono::nanoseconds nextPresentationTimestamp() const;
92
93 void setPresentationMode(PresentationMode mode);
94
95Q_SIGNALS:
104 void framePresented(RenderLoop *loop, std::chrono::nanoseconds timestamp, PresentationMode mode);
105
112
113private:
114 std::unique_ptr<RenderLoopPrivate> d;
115 friend class RenderLoopPrivate;
116};
117
118} // namespace KWin
void frameRequested(RenderLoop *loop)
void framePresented(RenderLoop *loop, std::chrono::nanoseconds timestamp, PresentationMode mode)
void refreshRateChanged()
PresentationMode
Definition globals.h:276