kwin/src/core/graphicsbufferview.h
Vlad Zahorodnii 082301920e backends/drm: Port to GraphicsBuffer
This change ports the drm backend to the GraphicsBuffer and
GraphicsBufferAllocator.

The main motivation is to unify graphics buffer abstractions across
various backends and to prepare it for output layers, which could be
nicer if we could have direct control over the buffers.
2023-06-19 22:42:58 +03:00

31 lines
570 B
C++

/*
SPDX-FileCopyrightText: 2023 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "core/graphicsbuffer.h"
#include <QImage>
namespace KWin
{
class KWIN_EXPORT GraphicsBufferView
{
public:
explicit GraphicsBufferView(GraphicsBuffer *buffer, GraphicsBuffer::MapFlags accessFlags = GraphicsBuffer::Read);
~GraphicsBufferView();
bool isNull() const;
QImage *image();
const QImage *image() const;
private:
GraphicsBuffer *m_buffer;
QImage m_image;
};
} // namespace KWin