203d7b3b8a
The responsibilities of the Scene must be reduced to painting only so we can move forward with the layer-based compositing. This change moves direct scanout logic from the opengl scene to the base scene class and the compositor. It makes the opengl scene less overloaded and allows to share direct scanout logic.
45 lines
1 KiB
C++
45 lines
1 KiB
C++
/*
|
|
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
|
|
{
|
|
|
|
class AbstractOutput;
|
|
class OverlayWindow;
|
|
class SurfaceItem;
|
|
|
|
/**
|
|
* 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;
|
|
virtual OverlayWindow *overlayWindow() const;
|
|
|
|
virtual bool checkGraphicsReset();
|
|
|
|
virtual QRegion beginFrame(AbstractOutput *output) = 0;
|
|
virtual void endFrame(AbstractOutput *output, const QRegion &renderedRegion, const QRegion &damagedRegion) = 0;
|
|
|
|
/**
|
|
* 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);
|
|
};
|
|
|
|
} // namespace KWin
|