File indexing completed on 2025-04-20 10:57:34

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 "drm_layer.h"
0011 
0012 #include "drm_dmabuf_feedback.h"
0013 #include "drm_egl_layer_surface.h"
0014 
0015 #include <QMap>
0016 #include <QPointer>
0017 #include <QRegion>
0018 #include <epoxy/egl.h>
0019 #include <optional>
0020 
0021 namespace KWin
0022 {
0023 
0024 class EglGbmBackend;
0025 class DrmGbmBuffer;
0026 
0027 class EglGbmCursorLayer : public DrmOverlayLayer
0028 {
0029 public:
0030     EglGbmCursorLayer(EglGbmBackend *eglBackend, DrmPipeline *pipeline);
0031 
0032     std::optional<OutputLayerBeginFrameInfo> beginFrame() override;
0033     void aboutToStartPainting(const QRegion &damagedRegion) override;
0034     bool endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) override;
0035     std::shared_ptr<DrmFramebuffer> currentBuffer() const override;
0036     QRegion currentDamage() const override;
0037     bool checkTestBuffer() override;
0038     void releaseBuffers() override;
0039 
0040 private:
0041     EglGbmLayerSurface m_surface;
0042 };
0043 
0044 }