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 #include "dmabuftexture.h"
0008 
0009 #include "kwinglutils.h"
0010 
0011 #include <unistd.h>
0012 
0013 namespace KWin
0014 {
0015 
0016 DmaBufTexture::DmaBufTexture(std::shared_ptr<GLTexture> texture, DmaBufAttributes &&attributes)
0017     : m_texture(texture)
0018     , m_framebuffer(std::make_unique<GLFramebuffer>(texture.get()))
0019     , m_attributes(std::move(attributes))
0020 {
0021 }
0022 DmaBufTexture::~DmaBufTexture() = default;
0023 
0024 const DmaBufAttributes &DmaBufTexture::attributes() const
0025 {
0026     return m_attributes;
0027 }
0028 
0029 KWin::GLTexture *DmaBufTexture::texture() const
0030 {
0031     return m_texture.get();
0032 }
0033 
0034 KWin::GLFramebuffer *DmaBufTexture::framebuffer() const
0035 {
0036     return m_framebuffer.get();
0037 }
0038 
0039 } // namespace KWin