KWin
Loading...
Searching...
No Matches
renderloop_p.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 "renderjournal.h"
10#include "renderloop.h"
11
12#include <QTimer>
13
14#include <optional>
15
16namespace KWin
17{
18
19class SurfaceItem;
20
21class KWIN_EXPORT RenderLoopPrivate
22{
23public:
24 static RenderLoopPrivate *get(RenderLoop *loop);
25 explicit RenderLoopPrivate(RenderLoop *q, Output *output);
26
27 void dispatch();
28 void invalidate();
29
30 void delayScheduleRepaint();
31 void scheduleRepaint();
32 void maybeScheduleRepaint();
33
34 void notifyFrameFailed();
35 void notifyFrameCompleted(std::chrono::nanoseconds timestamp, std::chrono::nanoseconds renderTime, PresentationMode mode = PresentationMode::VSync);
36 void notifyVblank(std::chrono::nanoseconds timestamp);
37
38 RenderLoop *const q;
39 Output *const output;
40 std::chrono::nanoseconds lastPresentationTimestamp = std::chrono::nanoseconds::zero();
41 std::chrono::nanoseconds nextPresentationTimestamp = std::chrono::nanoseconds::zero();
44 int refreshRate = 60000;
45 int pendingFrameCount = 0;
46 int inhibitCount = 0;
47 bool pendingReschedule = false;
48 bool pendingRepaint = false;
49 std::chrono::nanoseconds safetyMargin{0};
50
51 PresentationMode presentationMode = PresentationMode::VSync;
52};
53
54} // namespace KWin
RenderLoop *const q
RenderJournal renderJournal
PresentationMode
Definition globals.h:276