2021-06-22 00:23:17 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QSize>
|
|
|
|
#include <kwinglutils.h>
|
|
|
|
|
2022-07-22 13:28:25 +00:00
|
|
|
#include "drm_egl_backend.h"
|
2022-02-18 00:26:29 +00:00
|
|
|
#include "drm_object_plane.h"
|
2021-11-10 13:47:13 +00:00
|
|
|
|
2021-06-22 00:23:17 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class ShadowBuffer
|
|
|
|
{
|
|
|
|
public:
|
2021-11-10 13:47:13 +00:00
|
|
|
ShadowBuffer(const QSize &size, const GbmFormat &format);
|
2021-06-22 00:23:17 +00:00
|
|
|
~ShadowBuffer();
|
|
|
|
|
|
|
|
bool isComplete() const;
|
2022-02-18 00:26:29 +00:00
|
|
|
void render(DrmPlane::Transformations transform);
|
2021-06-22 00:23:17 +00:00
|
|
|
|
2022-04-11 16:46:10 +00:00
|
|
|
GLFramebuffer *fbo() const;
|
2022-05-17 10:36:34 +00:00
|
|
|
std::shared_ptr<GLTexture> texture() const;
|
2022-02-01 02:47:38 +00:00
|
|
|
uint32_t drmFormat() const;
|
2021-05-25 22:05:17 +00:00
|
|
|
|
2021-06-22 00:23:17 +00:00
|
|
|
private:
|
2022-02-01 02:47:38 +00:00
|
|
|
GLint internalFormat(const GbmFormat &format) const;
|
2022-05-17 10:36:34 +00:00
|
|
|
std::shared_ptr<GLTexture> m_texture;
|
2022-06-01 10:12:19 +00:00
|
|
|
std::unique_ptr<GLFramebuffer> m_fbo;
|
|
|
|
std::unique_ptr<GLVertexBuffer> m_vbo;
|
2022-02-01 02:47:38 +00:00
|
|
|
const QSize m_size;
|
|
|
|
const uint32_t m_drmFormat;
|
2021-06-22 00:23:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|