Make OpenGLBackend and QPainterBackend QObjects
Almost all their subclasses are QObjects. This simplifies the class hierarchy by making OpenGLBackend and QPainterBackend qobjects.
This commit is contained in:
parent
d543c0dff6
commit
4abbb6f0d6
17 changed files with 27 additions and 16 deletions
|
@ -79,8 +79,6 @@ static void destroyGlobalShareContext()
|
|||
AbstractEglBackend *AbstractEglBackend::s_primaryBackend = nullptr;
|
||||
|
||||
AbstractEglBackend::AbstractEglBackend()
|
||||
: QObject(nullptr)
|
||||
, OpenGLBackend()
|
||||
{
|
||||
if (s_primaryBackend == nullptr) {
|
||||
setPrimaryBackend(this);
|
||||
|
|
|
@ -33,7 +33,7 @@ struct AbstractEglBackendFunctions
|
|||
class EglDmabuf;
|
||||
class AbstractOutput;
|
||||
|
||||
class KWIN_EXPORT AbstractEglBackend : public QObject, public OpenGLBackend
|
||||
class KWIN_EXPORT AbstractEglBackend : public OpenGLBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#ifndef KWIN_SCENE_OPENGL_BACKEND_H
|
||||
#define KWIN_SCENE_OPENGL_BACKEND_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QRegion>
|
||||
|
||||
#include <kwin_export.h>
|
||||
|
@ -40,8 +41,10 @@ class GLTexture;
|
|||
*
|
||||
* @author Martin Gräßlin <mgraesslin@kde.org>
|
||||
*/
|
||||
class KWIN_EXPORT OpenGLBackend
|
||||
class KWIN_EXPORT OpenGLBackend : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OpenGLBackend();
|
||||
virtual ~OpenGLBackend();
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#ifndef KWIN_SCENE_QPAINTER_BACKEND_H
|
||||
#define KWIN_SCENE_QPAINTER_BACKEND_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QImage;
|
||||
class QRegion;
|
||||
class QSize;
|
||||
|
@ -21,8 +23,10 @@ class PlatformSurfaceTexture;
|
|||
class SurfacePixmapInternal;
|
||||
class SurfacePixmapWayland;
|
||||
|
||||
class QPainterBackend
|
||||
class QPainterBackend : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual ~QPainterBackend();
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ class DrmBuffer;
|
|||
|
||||
class AbstractEglDrmBackend : public AbstractEglBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
void screenGeometryChanged(const QSize &size) override;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
class EglMultiBackend : public QObject, public OpenGLBackend
|
||||
class EglMultiBackend : public OpenGLBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -16,8 +16,7 @@ namespace KWin
|
|||
{
|
||||
|
||||
DrmQPainterBackend::DrmQPainterBackend(DrmBackend *backend, DrmGpu *gpu)
|
||||
: QObject()
|
||||
, QPainterBackend()
|
||||
: QPainterBackend()
|
||||
, m_backend(backend)
|
||||
, m_gpu(gpu)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ class DrmDumbBuffer;
|
|||
class DrmOutput;
|
||||
class DrmGpu;
|
||||
|
||||
class DrmQPainterBackend : public QObject, public QPainterBackend
|
||||
class DrmQPainterBackend : public QPainterBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
namespace KWin
|
||||
{
|
||||
FramebufferQPainterBackend::FramebufferQPainterBackend(FramebufferBackend *backend)
|
||||
: QObject()
|
||||
, QPainterBackend()
|
||||
: QPainterBackend()
|
||||
, m_renderBuffer(backend->screenSize(), QImage::Format_RGB32)
|
||||
, m_backend(backend)
|
||||
, m_needsFullRepaint(true)
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace KWin
|
|||
{
|
||||
class FramebufferBackend;
|
||||
|
||||
class FramebufferQPainterBackend : public QObject, public QPainterBackend
|
||||
class FramebufferQPainterBackend : public QPainterBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -21,6 +21,8 @@ class GLRenderTarget;
|
|||
*/
|
||||
class EglGbmBackend : public AbstractEglBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EglGbmBackend(VirtualBackend *b);
|
||||
~EglGbmBackend() override;
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace KWin
|
|||
|
||||
class VirtualBackend;
|
||||
|
||||
class VirtualQPainterBackend : public QObject, public QPainterBackend
|
||||
class VirtualQPainterBackend : public QPainterBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -64,7 +64,7 @@ private:
|
|||
friend class WaylandQPainterBackend;
|
||||
};
|
||||
|
||||
class WaylandQPainterBackend : public QObject, public QPainterBackend
|
||||
class WaylandQPainterBackend : public QPainterBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace KWin
|
|||
*/
|
||||
class KWIN_EXPORT EglOnXBackend : public AbstractEglBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EglOnXBackend(Display *display);
|
||||
explicit EglOnXBackend(xcb_connection_t *connection, Display *display, xcb_window_t rootWindow, int screenNumber, xcb_window_t renderingWindow);
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
/**
|
||||
* @brief OpenGL Backend using GLX over an X overlay window.
|
||||
*/
|
||||
class GlxBackend : public QObject, public OpenGLBackend
|
||||
class GlxBackend : public OpenGLBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@ class X11WindowedBackend;
|
|||
*/
|
||||
class EglX11Backend : public EglOnXBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EglX11Backend(X11WindowedBackend *backend);
|
||||
~EglX11Backend() override;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace KWin
|
|||
|
||||
class X11WindowedBackend;
|
||||
|
||||
class X11WindowedQPainterBackend : public QObject, public QPainterBackend
|
||||
class X11WindowedQPainterBackend : public QPainterBackend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
Loading…
Reference in a new issue