KWin
Loading...
Searching...
No Matches
drm_qpainter_backend.cpp
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
10#include "drm_backend.h"
11#include "drm_gpu.h"
12#include "drm_output.h"
13#include "drm_pipeline.h"
14#include "drm_qpainter_layer.h"
15#include "drm_virtual_output.h"
16
17#include <drm_fourcc.h>
18
19namespace KWin
20{
21
24 , m_backend(backend)
25{
26 m_backend->setRenderBackend(this);
27}
28
30{
31 m_backend->releaseBuffers();
32 m_backend->setRenderBackend(nullptr);
33}
34
39
40void DrmQPainterBackend::present(Output *output, const std::shared_ptr<OutputFrame> &frame)
41{
42 static_cast<DrmAbstractOutput *>(output)->present(frame);
43}
44
46{
47 return static_cast<DrmAbstractOutput *>(output)->primaryLayer();
48}
49
51{
52 return static_cast<DrmAbstractOutput *>(output)->cursorLayer();
53}
54
55std::shared_ptr<DrmPipelineLayer> DrmQPainterBackend::createPrimaryLayer(DrmPipeline *pipeline)
56{
57 return std::make_shared<DrmQPainterLayer>(pipeline);
58}
59
60std::shared_ptr<DrmPipelineLayer> DrmQPainterBackend::createCursorLayer(DrmPipeline *pipeline)
61{
62 return std::make_shared<DrmCursorQPainterLayer>(pipeline);
63}
64
65std::shared_ptr<DrmOutputLayer> DrmQPainterBackend::createLayer(DrmVirtualOutput *output)
66{
67 return std::make_shared<DrmVirtualQPainterLayer>(output);
68}
69
70}
71
72#include "moc_drm_qpainter_backend.cpp"
void setRenderBackend(DrmRenderBackend *backend)
DrmGpu * primaryGpu() const
GraphicsBufferAllocator * graphicsBufferAllocator() const
Definition drm_gpu.cpp:834
OutputLayer * primaryLayer(Output *output) override
GraphicsBufferAllocator * graphicsBufferAllocator() const override
std::shared_ptr< DrmPipelineLayer > createCursorLayer(DrmPipeline *pipeline) override
DrmQPainterBackend(DrmBackend *backend)
std::shared_ptr< DrmPipelineLayer > createPrimaryLayer(DrmPipeline *pipeline) override
std::shared_ptr< DrmOutputLayer > createLayer(DrmVirtualOutput *output) override
OutputLayer * cursorLayer(Output *output) override
void present(Output *output, const std::shared_ptr< OutputFrame > &frame) override