kwin/src/dmabuftexture.h

47 lines
918 B
C
Raw Normal View History

/*
2020-08-02 22:22:19 +00:00
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include "kwin_export.h"
#include <memory>
namespace KWin
{
class GLFramebuffer;
class GLTexture;
struct DmaBufAttributes
{
2022-06-11 08:26:43 +00:00
int planeCount = 0;
int width = 0;
int height = 0;
uint32_t format = 0;
uint64_t modifier = 0;
int fd[4] = {-1, -1, -1, -1};
int offset[4] = {0, 0, 0, 0};
int pitch[4] = {0, 0, 0, 0};
};
class KWIN_EXPORT DmaBufTexture
{
public:
explicit DmaBufTexture(std::shared_ptr<GLTexture> texture, const DmaBufAttributes &attributes);
virtual ~DmaBufTexture();
DmaBufAttributes attributes() const;
GLTexture *texture() const;
GLFramebuffer *framebuffer() const;
protected:
std::shared_ptr<GLTexture> m_texture;
std::unique_ptr<GLFramebuffer> m_framebuffer;
DmaBufAttributes m_attributes;
};
}