/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2022 Xaver Hugl SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "drm_layer.h" #include "drm_egl_layer_surface.h" #include #include #include #include #include namespace KWin { class EglGbmBackend; class EglGbmLayer : public DrmPipelineLayer { public: explicit EglGbmLayer(EglGbmBackend *eglBackend, DrmPipeline *pipeline, DrmPlane::TypeIndex type); std::optional doBeginFrame() override; bool doEndFrame(const QRegion &renderedRegion, const QRegion &damagedRegion, OutputFrame *frame) override; bool checkTestBuffer() override; std::shared_ptr currentBuffer() const override; std::shared_ptr texture() const override; ColorDescription colorDescription() const; void releaseBuffers() override; DrmDevice *scanoutDevice() const override; QHash> supportedDrmFormats() const override; QList recommendedSizes() const override; const ColorPipeline &colorPipeline() const override; private: bool doImportScanoutBuffer(GraphicsBuffer *buffer, const ColorDescription &color, RenderingIntent intent, const std::shared_ptr &frame) override; std::shared_ptr m_scanoutBuffer; ColorPipeline m_colorPipeline; EglGbmLayerSurface m_surface; }; }