2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2015-05-06 15:47:07 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
|
2015-05-06 15:47:07 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2015-05-06 15:47:07 +00:00
|
|
|
#ifndef KWIN_EGL_HWCOMPOSER_BACKEND_H
|
|
|
|
#define KWIN_EGL_HWCOMPOSER_BACKEND_H
|
|
|
|
#include "abstract_egl_backend.h"
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class HwcomposerBackend;
|
|
|
|
class HwcomposerWindow;
|
|
|
|
|
|
|
|
class EglHwcomposerBackend : public AbstractEglBackend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EglHwcomposerBackend(HwcomposerBackend *backend);
|
|
|
|
virtual ~EglHwcomposerBackend();
|
|
|
|
bool usesOverlayWindow() const override;
|
2017-09-08 20:30:18 +00:00
|
|
|
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
|
2015-05-06 15:47:07 +00:00
|
|
|
void screenGeometryChanged(const QSize &size) override;
|
2020-11-09 14:31:26 +00:00
|
|
|
QRegion beginFrame(int screenId) override;
|
|
|
|
void endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override;
|
2015-11-25 12:09:28 +00:00
|
|
|
void init() override;
|
2015-05-06 15:47:07 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void present() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool initializeEgl();
|
|
|
|
bool initRenderingContext();
|
|
|
|
bool initBufferConfigs();
|
|
|
|
bool makeContextCurrent();
|
|
|
|
HwcomposerBackend *m_backend;
|
|
|
|
HwcomposerWindow *m_nativeSurface = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
class EglHwcomposerTexture : public AbstractEglTexture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~EglHwcomposerTexture();
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class EglHwcomposerBackend;
|
2017-09-08 20:30:18 +00:00
|
|
|
EglHwcomposerTexture(SceneOpenGLTexture *texture, EglHwcomposerBackend *backend);
|
2015-05-06 15:47:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|