dd6d0b22cc
Software cursor has always been a major source of problems. Hopefully, porting it to RenderLayer will help us with that. Note that the cursor layer is currently visible only when using software cursor, however it will be changed once the Compositor can allocate a real hardware cursor plane. Currently, software cursor uses graphics-specific APIs (OpenGL and QPainter) to paint itself. That will be changed in the future when rendering parts are extracted from the Scene in a reusable helper.
40 lines
762 B
C++
40 lines
762 B
C++
/*
|
|
SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "renderlayerdelegate.h"
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class AbstractOutput;
|
|
|
|
class KWIN_EXPORT CursorView : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CursorView(QObject *parent = nullptr);
|
|
|
|
virtual void paint(AbstractOutput *output, const QRegion ®ion) = 0;
|
|
};
|
|
|
|
class KWIN_EXPORT CursorDelegate : public RenderLayerDelegate
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CursorDelegate(AbstractOutput *output, CursorView *view);
|
|
|
|
void paint(const QRegion &damage, const QRegion &repaint, QRegion &update, QRegion &valid) override;
|
|
|
|
private:
|
|
CursorView *m_view;
|
|
AbstractOutput *m_output;
|
|
};
|
|
|
|
} // namespace KWin
|