File indexing completed on 2024-02-18 16:19:56

0001 /*
0002     SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "kwin_export.h"
0010 
0011 #include "core/dmabufattributes.h"
0012 
0013 #include <memory>
0014 
0015 namespace KWin
0016 {
0017 class GLFramebuffer;
0018 class GLTexture;
0019 
0020 class KWIN_EXPORT DmaBufTexture
0021 {
0022 public:
0023     explicit DmaBufTexture(std::shared_ptr<GLTexture> texture, DmaBufAttributes &&attributes);
0024     virtual ~DmaBufTexture();
0025 
0026     const DmaBufAttributes &attributes() const;
0027     GLTexture *texture() const;
0028     GLFramebuffer *framebuffer() const;
0029 
0030 protected:
0031     std::shared_ptr<GLTexture> m_texture;
0032     std::unique_ptr<GLFramebuffer> m_framebuffer;
0033     DmaBufAttributes m_attributes;
0034 };
0035 
0036 }