File indexing completed on 2024-05-26 05:32:39

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 #include "core/outputlayer.h"
0011 
0012 #include <QRegion>
0013 #include <memory>
0014 #include <optional>
0015 
0016 namespace KWin
0017 {
0018 
0019 class SurfaceItem;
0020 class DrmFramebuffer;
0021 class GLTexture;
0022 class DrmPipeline;
0023 
0024 class DrmOutputLayer : public OutputLayer
0025 {
0026 public:
0027     virtual ~DrmOutputLayer();
0028 
0029     virtual std::shared_ptr<GLTexture> texture() const;
0030     virtual QRegion currentDamage() const;
0031     virtual void releaseBuffers() = 0;
0032 };
0033 
0034 class DrmPipelineLayer : public DrmOutputLayer
0035 {
0036 public:
0037     DrmPipelineLayer(DrmPipeline *pipeline);
0038 
0039     virtual bool checkTestBuffer() = 0;
0040     virtual std::shared_ptr<DrmFramebuffer> currentBuffer() const = 0;
0041     virtual bool hasDirectScanoutBuffer() const;
0042 
0043 protected:
0044     DrmPipeline *const m_pipeline;
0045 };
0046 }