kwin/plugins/platforms/hwcomposer/egl_hwcomposer_backend.h

56 lines
1.4 KiB
C
Raw Normal View History

2020-08-02 22:22:19 +00:00
/*
KWin - the KDE window manager
This file is part of the KDE project.
2020-08-02 22:22:19 +00:00
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
2020-08-02 22:22:19 +00:00
SPDX-License-Identifier: GPL-3.0-or-later
*/
#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;
SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override;
void screenGeometryChanged(const QSize &size) override;
QRegion beginFrame(int screenId) override;
void endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override;
void init() override;
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;
EglHwcomposerTexture(SceneOpenGLTexture *texture, EglHwcomposerBackend *backend);
};
}
#endif