2020-07-22 17:29:23 +00:00
|
|
|
/*
|
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
|
|
|
|
*/
|
2020-07-22 17:29:23 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "kwin_export.h"
|
2022-05-13 09:06:17 +00:00
|
|
|
|
2022-05-17 10:36:34 +00:00
|
|
|
#include <memory>
|
2020-07-22 17:29:23 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2022-04-11 16:46:10 +00:00
|
|
|
class GLFramebuffer;
|
2020-07-22 17:29:23 +00:00
|
|
|
class GLTexture;
|
|
|
|
|
2022-05-13 09:06:17 +00:00
|
|
|
struct DmaBufAttributes
|
|
|
|
{
|
|
|
|
int planeCount;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int format;
|
2022-06-02 01:42:13 +00:00
|
|
|
uint64_t modifier;
|
2022-05-13 09:06:17 +00:00
|
|
|
|
|
|
|
int fd[4];
|
|
|
|
int offset[4];
|
|
|
|
int pitch[4];
|
|
|
|
};
|
|
|
|
|
2020-07-22 17:29:23 +00:00
|
|
|
class KWIN_EXPORT DmaBufTexture
|
|
|
|
{
|
|
|
|
public:
|
2022-05-17 10:36:34 +00:00
|
|
|
explicit DmaBufTexture(std::shared_ptr<GLTexture> texture, const DmaBufAttributes &attributes);
|
2020-07-22 17:29:23 +00:00
|
|
|
virtual ~DmaBufTexture();
|
|
|
|
|
2022-05-13 09:06:17 +00:00
|
|
|
DmaBufAttributes attributes() const;
|
|
|
|
GLTexture *texture() const;
|
|
|
|
GLFramebuffer *framebuffer() const;
|
2020-07-22 17:29:23 +00:00
|
|
|
|
|
|
|
protected:
|
2022-05-17 10:36:34 +00:00
|
|
|
std::shared_ptr<GLTexture> m_texture;
|
|
|
|
std::unique_ptr<GLFramebuffer> m_framebuffer;
|
2022-05-13 09:06:17 +00:00
|
|
|
DmaBufAttributes m_attributes;
|
2020-07-22 17:29:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|