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>
|
|
|
|
|
2021-11-10 13:47:13 +00:00
|
|
|
#include "egl_gbm_backend.h"
|
|
|
|
|
2021-06-22 00:23:17 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2021-07-26 23:11:50 +00:00
|
|
|
class DrmAbstractOutput;
|
2021-06-22 00:23:17 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
void bind();
|
2021-07-26 23:11:50 +00:00
|
|
|
void render(DrmAbstractOutput *output);
|
2021-06-22 00:23:17 +00:00
|
|
|
|
|
|
|
int texture() const;
|
|
|
|
|
2021-05-25 22:05:17 +00:00
|
|
|
QSize textureSize() const;
|
|
|
|
|
2021-06-22 00:23:17 +00:00
|
|
|
private:
|
2021-11-10 13:47:13 +00:00
|
|
|
GLint internalFormat(const GbmFormat &format);
|
2021-06-22 00:23:17 +00:00
|
|
|
GLuint m_texture;
|
|
|
|
GLuint m_framebuffer;
|
|
|
|
QScopedPointer<GLVertexBuffer> m_vbo;
|
2021-05-25 22:05:17 +00:00
|
|
|
QSize m_size;
|
2021-06-22 00:23:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|