kwin/src/core/rendertarget.h
Vlad Zahorodnii d2fb4147fc Move multi-purpose code in its own directory
Things such as Output, InputDevice and so on are made to be
multi-purpose. In order to make this separation more clear, this change
moves that code in the core directory. Some things still link to the
abstraction level above (kwin), they can be tackled in future refactors.
Ideally code in core/ should depend either on other code in core/ or
system libs.
2022-09-06 11:21:40 +03:00

40 lines
710 B
C++

/*
SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "kwin_export.h"
#include <QImage>
#include <variant>
namespace KWin
{
class GLFramebuffer;
class KWIN_EXPORT RenderTarget
{
public:
RenderTarget();
explicit RenderTarget(GLFramebuffer *fbo);
explicit RenderTarget(QImage *image);
QSize size() const;
using NativeHandle = std::variant<GLFramebuffer *, QImage *>;
NativeHandle nativeHandle() const;
void setDevicePixelRatio(qreal ratio);
qreal devicePixelRatio() const;
private:
NativeHandle m_nativeHandle;
qreal m_devicePixelRatio = 1;
};
} // namespace KWin