kwin/src/renderloop_p.h

54 lines
1.2 KiB
C
Raw Normal View History

2020-11-19 08:52:29 +00:00
/*
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "renderloop.h"
#include "renderjournal.h"
2020-11-19 08:52:29 +00:00
#include <QTimer>
namespace KWin
{
class KWIN_EXPORT RenderLoopPrivate
{
public:
static RenderLoopPrivate *get(RenderLoop *loop);
explicit RenderLoopPrivate(RenderLoop *q);
void dispatch();
void invalidate();
void delayScheduleRepaint();
void scheduleRepaint();
void maybeScheduleRepaint();
void notifyFrameFailed();
2020-11-19 08:52:29 +00:00
void notifyFrameCompleted(std::chrono::nanoseconds timestamp);
RenderLoop *q;
std::chrono::nanoseconds lastPresentationTimestamp = std::chrono::nanoseconds::zero();
std::chrono::nanoseconds nextPresentationTimestamp = std::chrono::nanoseconds::zero();
QTimer compositeTimer;
RenderJournal renderJournal;
2020-11-19 08:52:29 +00:00
int refreshRate = 60000;
int pendingFrameCount = 0;
int inhibitCount = 0;
bool pendingReschedule = false;
bool pendingRepaint = false;
RenderLoop::VrrPolicy vrrPolicy = RenderLoop::VrrPolicy::Never;
Item *fullscreenItem = nullptr;
enum class SyncMode {
Fixed,
Adaptive,
};
SyncMode presentMode = SyncMode::Fixed;
2020-11-19 08:52:29 +00:00
};
} // namespace KWin