2021-11-10 10:34:18 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "kwinglobals.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2021-11-11 11:24:02 +00:00
|
|
|
class AbstractOutput;
|
2021-11-11 09:48:43 +00:00
|
|
|
class OverlayWindow;
|
2022-02-04 17:38:58 +00:00
|
|
|
class SurfaceItem;
|
2021-11-11 09:48:43 +00:00
|
|
|
|
2021-11-10 10:34:18 +00:00
|
|
|
/**
|
|
|
|
* The RenderBackend class is the base class for all rendering backends.
|
|
|
|
*/
|
|
|
|
class KWIN_EXPORT RenderBackend : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RenderBackend(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
virtual CompositingType compositingType() const = 0;
|
2021-11-11 09:48:43 +00:00
|
|
|
virtual OverlayWindow *overlayWindow() const;
|
2021-11-11 11:24:02 +00:00
|
|
|
|
2021-12-31 11:51:42 +00:00
|
|
|
virtual bool checkGraphicsReset();
|
|
|
|
|
2022-02-16 17:13:57 +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(AbstractOutput *output, const QRegion &damage);
|
|
|
|
|
2021-11-11 11:24:02 +00:00
|
|
|
virtual QRegion beginFrame(AbstractOutput *output) = 0;
|
|
|
|
virtual void endFrame(AbstractOutput *output, const QRegion &renderedRegion, const QRegion &damagedRegion) = 0;
|
2022-02-04 17:38:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tries to directly scan out a surface to the screen
|
|
|
|
* Returns @c true if scanout succeeds, @c false if rendering is necessary
|
|
|
|
*/
|
|
|
|
virtual bool scanout(AbstractOutput *output, SurfaceItem *surfaceItem);
|
2021-11-10 10:34:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|