2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2015-05-05 11:32:33 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
|
2015-05-05 11:32:33 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2015-05-05 11:32:33 +00:00
|
|
|
#ifndef KWIN_SCENE_QPAINTER_DRM_BACKEND_H
|
|
|
|
#define KWIN_SCENE_QPAINTER_DRM_BACKEND_H
|
2021-01-05 19:23:37 +00:00
|
|
|
#include "qpainterbackend.h"
|
2021-07-24 09:08:30 +00:00
|
|
|
#include "utils.h"
|
2021-01-05 19:23:37 +00:00
|
|
|
|
2015-05-05 11:32:33 +00:00
|
|
|
#include <QObject>
|
2017-08-11 19:40:49 +00:00
|
|
|
#include <QVector>
|
2021-03-22 14:46:09 +00:00
|
|
|
#include <QSharedPointer>
|
2015-05-05 11:32:33 +00:00
|
|
|
|
2021-05-04 10:19:31 +00:00
|
|
|
#include "dumb_swapchain.h"
|
|
|
|
|
2015-05-05 11:32:33 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class DrmBackend;
|
2017-05-09 19:00:33 +00:00
|
|
|
class DrmDumbBuffer;
|
2021-07-26 23:11:50 +00:00
|
|
|
class DrmAbstractOutput;
|
2020-10-05 21:05:55 +00:00
|
|
|
class DrmGpu;
|
2015-05-05 11:32:33 +00:00
|
|
|
|
2021-07-24 08:25:23 +00:00
|
|
|
class DrmQPainterBackend : public QPainterBackend
|
2015-05-05 11:32:33 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-10-05 21:05:55 +00:00
|
|
|
DrmQPainterBackend(DrmBackend *backend, DrmGpu *gpu);
|
2015-05-05 11:32:33 +00:00
|
|
|
|
2021-08-24 20:55:42 +00:00
|
|
|
QImage *bufferForScreen(AbstractOutput *output) override;
|
|
|
|
QRegion beginFrame(AbstractOutput *output) override;
|
2021-11-11 11:24:02 +00:00
|
|
|
void endFrame(AbstractOutput *output, const QRegion &renderedRegion, const QRegion &damagedRegion) override;
|
2015-05-05 11:32:33 +00:00
|
|
|
|
|
|
|
private:
|
2021-07-26 23:11:50 +00:00
|
|
|
void initOutput(DrmAbstractOutput *output);
|
2015-05-05 11:32:33 +00:00
|
|
|
struct Output {
|
2021-07-26 23:11:50 +00:00
|
|
|
DrmAbstractOutput *output;
|
2021-05-04 10:19:31 +00:00
|
|
|
QSharedPointer<DumbSwapchain> swapchain;
|
2021-07-24 09:08:30 +00:00
|
|
|
DamageJournal damageJournal;
|
2015-05-05 11:32:33 +00:00
|
|
|
};
|
2021-08-24 20:55:42 +00:00
|
|
|
QMap<AbstractOutput *, Output> m_outputs;
|
2015-05-05 11:32:33 +00:00
|
|
|
DrmBackend *m_backend;
|
2020-10-05 21:05:55 +00:00
|
|
|
DrmGpu *m_gpu;
|
2015-05-05 11:32:33 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|