2022-02-05 17:00:25 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "kwin_export.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QRegion>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2022-04-06 14:36:22 +00:00
|
|
|
class SurfaceItem;
|
|
|
|
|
2022-02-05 17:00:25 +00:00
|
|
|
class KWIN_EXPORT OutputLayer : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit OutputLayer(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
QRegion repaints() const;
|
|
|
|
void resetRepaints();
|
|
|
|
void addRepaint(const QRegion ®ion);
|
|
|
|
|
2022-04-06 14:36:22 +00:00
|
|
|
/**
|
|
|
|
* Notifies about starting to paint.
|
|
|
|
*
|
|
|
|
* @p damage contains the reported damage as suggested by windows and effects on prepaint calls.
|
|
|
|
*/
|
|
|
|
virtual void aboutToStartPainting(const QRegion &damage);
|
|
|
|
|
|
|
|
virtual QRegion beginFrame() = 0;
|
|
|
|
virtual void endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tries to import the newest buffer of the surface for direct scanout
|
|
|
|
* Returns @c true if scanout succeeds, @c false if rendering is necessary
|
|
|
|
*/
|
|
|
|
virtual bool scanout(SurfaceItem *surfaceItem);
|
|
|
|
|
2022-02-05 17:00:25 +00:00
|
|
|
private:
|
|
|
|
QRegion m_repaints;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|