KWin
Loading...
Searching...
No Matches
virtual_output.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: 2018 Roman Gilg <subdiff@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "core/output.h"
12
13#include <QObject>
14#include <QRect>
15
16namespace KWin
17{
18
19class SoftwareVsyncMonitor;
20class VirtualBackend;
21class OutputFrame;
22
23class VirtualOutput : public Output
24{
25 Q_OBJECT
26
27public:
28 VirtualOutput(VirtualBackend *parent, bool internal);
29 ~VirtualOutput() override;
30
31 RenderLoop *renderLoop() const override;
32 void present(const std::shared_ptr<OutputFrame> &frame);
33
34 void init(const QPoint &logicalPosition, const QSize &pixelSize, qreal scale);
35 void updateEnabled(bool enabled);
36
37private:
38 void vblank(std::chrono::nanoseconds timestamp);
39
40 Q_DISABLE_COPY(VirtualOutput);
41 friend class VirtualBackend;
42
43 VirtualBackend *m_backend;
44 std::unique_ptr<RenderLoop> m_renderLoop;
45 std::unique_ptr<SoftwareVsyncMonitor> m_vsyncMonitor;
46 int m_gammaSize = 200;
47 bool m_gammaResult = true;
48 int m_identifier;
49 std::shared_ptr<OutputFrame> m_frame;
50};
51
52} // namespace KWin
qreal scale() const
Definition output.cpp:455
QSize pixelSize() const
Definition output.cpp:485
VirtualOutput(VirtualBackend *parent, bool internal)
void updateEnabled(bool enabled)
void present(const std::shared_ptr< OutputFrame > &frame)
RenderLoop * renderLoop() const override
void init(const QPoint &logicalPosition, const QSize &pixelSize, qreal scale)