File indexing completed on 2024-11-10 04:57:53

0001 /*
0002     SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "placeholderoutput.h"
0008 
0009 namespace KWin
0010 {
0011 
0012 PlaceholderOutput::PlaceholderOutput(const QSize &size, qreal scale)
0013 {
0014     auto mode = std::make_shared<OutputMode>(size, 60000);
0015 
0016     m_renderLoop = std::make_unique<RenderLoop>(this);
0017     m_renderLoop->setRefreshRate(mode->refreshRate());
0018     m_renderLoop->inhibit();
0019 
0020     setState(State{
0021         .scale = scale,
0022         .modes = {mode},
0023         .currentMode = mode,
0024         .enabled = true,
0025     });
0026 
0027     setInformation(Information{
0028         .name = QStringLiteral("Placeholder-1"),
0029         .placeholder = true,
0030     });
0031 }
0032 
0033 PlaceholderOutput::~PlaceholderOutput()
0034 {
0035 }
0036 
0037 RenderLoop *PlaceholderOutput::renderLoop() const
0038 {
0039     return m_renderLoop.get();
0040 }
0041 
0042 } // namespace KWin
0043 
0044 #include "moc_placeholderoutput.cpp"