2015-05-06 15:47:07 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
2020-08-02 22:10:35 +00:00
|
|
|
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
|
2015-05-06 15:47:07 +00:00
|
|
|
|
2020-08-02 22:10:35 +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;
|
|
|
|
QRegion prepareRenderingFrame() override;
|
|
|
|
void endRenderingFrame(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
|