KWin
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
KWin::OpenGLBackend Class Referenceabstract

The OpenGLBackend creates and holds the OpenGL context and is responsible for Texture from Pixmap. More...

#include <openglbackend.h>

Inheritance diagram for KWin::OpenGLBackend:
KWin::RenderBackend KWin::AbstractEglBackend KWin::GlxBackend KWin::EglBackend KWin::EglGbmBackend KWin::VirtualEglBackend KWin::Wayland::WaylandEglBackend KWin::X11WindowedEglBackend

Public Member Functions

 OpenGLBackend ()
 
virtual ~OpenGLBackend ()
 
virtual void init ()=0
 
CompositingType compositingType () const override final
 
bool checkGraphicsReset () override final
 
virtual bool makeCurrent ()=0
 
virtual void doneCurrent ()=0
 
bool isFailed () const
 Whether the creation of the Backend failed.
 
bool supportsBufferAge () const
 
bool supportsNativeFence () const
 
QList< QByteArray > extensions () const
 
bool hasExtension (const QByteArray &extension) const
 
void copyPixels (const QRegion &region, const QSize &screenSize)
 
virtual std::pair< std::shared_ptr< GLTexture >, ColorDescriptiontextureForOutput (Output *output) const
 
- Public Member Functions inherited from KWin::RenderBackend
 RenderBackend (QObject *parent=nullptr)
 
virtual OverlayWindowoverlayWindow () const
 
virtual OutputLayerprimaryLayer (Output *output)=0
 
virtual OutputLayercursorLayer (Output *output)
 
virtual void present (Output *output, const std::shared_ptr< OutputFrame > &frame)=0
 
virtual GraphicsBufferAllocatorgraphicsBufferAllocator () const
 
virtual bool testImportBuffer (GraphicsBuffer *buffer)
 
virtual QHash< uint32_t, QList< uint64_t > > supportedFormats () const
 
virtual std::unique_ptr< SurfaceTexturecreateSurfaceTextureX11 (SurfacePixmapX11 *pixmap)
 
virtual std::unique_ptr< SurfaceTexturecreateSurfaceTextureWayland (SurfacePixmap *pixmap)
 

Protected Member Functions

void setFailed (const QString &reason)
 Sets the backend initialization to failed.
 
void setSupportsBufferAge (bool value)
 
void setSupportsNativeFence (bool value)
 
void setExtensions (const QList< QByteArray > &extensions)
 

Detailed Description

The OpenGLBackend creates and holds the OpenGL context and is responsible for Texture from Pixmap.

The OpenGLBackend is an abstract base class used by the SceneOpenGL to abstract away the differences between various OpenGL windowing systems such as GLX and EGL.

A concrete implementation has to create and release the OpenGL context in a way so that the SceneOpenGL does not have to care about it.

In addition a major task for this class is to generate the SceneOpenGLTexturePrivate which is able to perform the texture from pixmap operation in the given backend.

Author
Martin Gräßlin mgrae.nosp@m.ssli.nosp@m.n@kde.nosp@m..org

Definition at line 37 of file openglbackend.h.

Constructor & Destructor Documentation

◆ OpenGLBackend()

KWin::OpenGLBackend::OpenGLBackend ( )

Definition at line 22 of file openglbackend.cpp.

◆ ~OpenGLBackend()

KWin::OpenGLBackend::~OpenGLBackend ( )
virtual

Definition at line 28 of file openglbackend.cpp.

Member Function Documentation

◆ checkGraphicsReset()

bool KWin::OpenGLBackend::checkGraphicsReset ( )
finaloverridevirtual

Reimplemented from KWin::RenderBackend.

Definition at line 61 of file openglbackend.cpp.

◆ compositingType()

CompositingType KWin::OpenGLBackend::compositingType ( ) const
finaloverridevirtual

Implements KWin::RenderBackend.

Definition at line 32 of file openglbackend.cpp.

◆ copyPixels()

void KWin::OpenGLBackend::copyPixels ( const QRegion & region,
const QSize & screenSize )

Copy a region of pixels from the current read to the current draw buffer

Definition at line 43 of file openglbackend.cpp.

◆ doneCurrent()

virtual void KWin::OpenGLBackend::doneCurrent ( )
pure virtual

◆ extensions()

QList< QByteArray > KWin::OpenGLBackend::extensions ( ) const
inline

The backend specific extensions (e.g. EGL/GLX extensions).

Not the OpenGL (ES) extension!

Definition at line 80 of file openglbackend.h.

◆ hasExtension()

bool KWin::OpenGLBackend::hasExtension ( const QByteArray & extension) const
inline
Returns
whether the backend specific extensions contains extension.

Definition at line 88 of file openglbackend.h.

◆ init()

virtual void KWin::OpenGLBackend::init ( )
pure virtual

◆ isFailed()

bool KWin::OpenGLBackend::isFailed ( ) const
inline

Whether the creation of the Backend failed.

The SceneOpenGL should test whether the Backend got constructed correctly. If this method returns true, the SceneOpenGL should not try to start the rendering.

Returns
bool true if the creation of the Backend failed, false otherwise.

Definition at line 60 of file openglbackend.h.

◆ makeCurrent()

virtual bool KWin::OpenGLBackend::makeCurrent ( )
pure virtual

◆ setExtensions()

void KWin::OpenGLBackend::setExtensions ( const QList< QByteArray > & extensions)
inlineprotected

Sets the platform-specific extensions.

These are the EGL/GLX extensions, not the OpenGL extensions

Definition at line 126 of file openglbackend.h.

◆ setFailed()

void KWin::OpenGLBackend::setFailed ( const QString & reason)
protected

Sets the backend initialization to failed.

This method should be called by the concrete subclass in case the initialization failed. The given reason is logged as a warning.

Parameters
reasonThe reason why the initialization failed.

Definition at line 37 of file openglbackend.cpp.

◆ setSupportsBufferAge()

void KWin::OpenGLBackend::setSupportsBufferAge ( bool value)
inlineprotected

Definition at line 111 of file openglbackend.h.

◆ setSupportsNativeFence()

void KWin::OpenGLBackend::setSupportsNativeFence ( bool value)
inlineprotected

Definition at line 116 of file openglbackend.h.

◆ supportsBufferAge()

bool KWin::OpenGLBackend::supportsBufferAge ( ) const
inline

Definition at line 65 of file openglbackend.h.

◆ supportsNativeFence()

bool KWin::OpenGLBackend::supportsNativeFence ( ) const
inline

Definition at line 70 of file openglbackend.h.

◆ textureForOutput()

std::pair< std::shared_ptr< KWin::GLTexture >, ColorDescription > KWin::OpenGLBackend::textureForOutput ( Output * output) const
virtual

The documentation for this class was generated from the following files: