ef6fa25d90
EGL for X and EGL for Wayland backends are quite different. The main motivation behind this change is to prepare the EGL backends for monitoring vblank events. Things work quite differently depending on if the EGL backend renders onto a toplevel window or overlay window.
46 lines
1 KiB
C++
46 lines
1 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "eglonxbackend.h"
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class EglBackend : public EglOnXBackend
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit EglBackend(Display *display);
|
|
|
|
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
|
|
QRegion beginFrame(int screenId) override;
|
|
void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override;
|
|
void screenGeometryChanged(const QSize &size) override;
|
|
|
|
private:
|
|
void presentSurface(EGLSurface surface, const QRegion &damage, const QRect &screenGeometry);
|
|
|
|
int m_bufferAge = 0;
|
|
};
|
|
|
|
class EglTexture : public AbstractEglTexture
|
|
{
|
|
public:
|
|
~EglTexture() override;
|
|
|
|
void onDamage() override;
|
|
bool loadTexture(WindowPixmap *pixmap) override;
|
|
|
|
private:
|
|
friend class EglBackend;
|
|
EglTexture(SceneOpenGLTexture *texture, EglBackend *backend);
|
|
EglBackend *m_backend;
|
|
};
|
|
|
|
} // namespace KWin
|