KWin
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KWin::GLTexture Class Reference

#include <gltexture.h>

Inheritance diagram for KWin::GLTexture:
KWin::EGLImageTexture KWin::EglPixmapTexture KWin::GlxPixmapTexture

Public Member Functions

 GLTexture (GLenum target)
 
bool create ()
 
virtual ~GLTexture ()
 
bool isNull () const
 
QSize size () const
 
void setSize (const QSize &size)
 
int width () const
 
int height () const
 
void setContentTransform (OutputTransform transform)
 
OutputTransform contentTransform () const
 
void setSwizzle (GLenum red, GLenum green, GLenum blue, GLenum alpha)
 
QMatrix4x4 matrix (TextureCoordinateType type) const
 
void update (const QImage &image, const QPoint &offset=QPoint(0, 0), const QRect &src=QRect())
 
void bind ()
 
void unbind ()
 
void render (const QSizeF &size)
 
void render (const QRegion &region, const QSizeF &size, bool hardwareClipping=false)
 
void render (const QRectF &source, const QRegion &region, const QSizeF &targetSize, bool hardwareClipping=false)
 
GLuint texture () const
 
GLenum target () const
 
GLenum filter () const
 
GLenum internalFormat () const
 
QImage toImage ()
 
void clear ()
 Make the texture fully transparent.
 
void setDirty ()
 
bool isDirty () const
 
void setFilter (GLenum filter)
 
void setWrapMode (GLenum mode)
 
void generateMipmaps ()
 

Static Public Member Functions

static bool framebufferObjectSupported ()
 
static bool supportsSwizzle ()
 
static bool supportsFormatRG ()
 
static std::unique_ptr< GLTexturecreateNonOwningWrapper (GLuint textureId, GLenum internalFormat, const QSize &size)
 
static std::unique_ptr< GLTextureallocate (GLenum internalFormat, const QSize &size, int levels=1)
 
static std::unique_ptr< GLTextureupload (const QImage &image)
 
static std::unique_ptr< GLTextureupload (const QPixmap &pixmap)
 

Protected Member Functions

 GLTexture (GLenum target, GLuint textureId, GLenum internalFormat, const QSize &size, int levels, bool owning, OutputTransform transform)
 
virtual void onDamage ()
 

Protected Attributes

const std::unique_ptr< GLTexturePrivated
 

Detailed Description

Definition at line 39 of file gltexture.h.

Constructor & Destructor Documentation

◆ GLTexture() [1/2]

KWin::GLTexture::GLTexture ( GLenum target)
explicit

Definition at line 84 of file gltexture.cpp.

◆ ~GLTexture()

KWin::GLTexture::~GLTexture ( )
virtual

Definition at line 107 of file gltexture.cpp.

◆ GLTexture() [2/2]

KWin::GLTexture::GLTexture ( GLenum target,
GLuint textureId,
GLenum internalFormat,
const QSize & size,
int levels,
bool owning,
OutputTransform transform )
explicitprotected

Definition at line 90 of file gltexture.cpp.

Member Function Documentation

◆ allocate()

std::unique_ptr< GLTexture > KWin::GLTexture::allocate ( GLenum internalFormat,
const QSize & size,
int levels = 1 )
static

Definition at line 602 of file gltexture.cpp.

◆ bind()

void KWin::GLTexture::bind ( )

Definition at line 275 of file gltexture.cpp.

◆ clear()

void KWin::GLTexture::clear ( )

Make the texture fully transparent.

Definition at line 423 of file gltexture.cpp.

◆ contentTransform()

OutputTransform KWin::GLTexture::contentTransform ( ) const
Returns
the transform between the content and the buffer

Definition at line 523 of file gltexture.cpp.

◆ create()

bool KWin::GLTexture::create ( )

Creates the underlying texture object. Returns true if the texture has been created successfully; otherwise returns false. Note that this does not allocate any storage for the texture.

Definition at line 111 of file gltexture.cpp.

◆ createNonOwningWrapper()

std::unique_ptr< GLTexture > KWin::GLTexture::createNonOwningWrapper ( GLuint textureId,
GLenum internalFormat,
const QSize & size )
static

Definition at line 597 of file gltexture.cpp.

◆ filter()

GLenum KWin::GLTexture::filter ( ) const

Definition at line 413 of file gltexture.cpp.

◆ framebufferObjectSupported()

bool KWin::GLTexture::framebufferObjectSupported ( )
static

Definition at line 556 of file gltexture.cpp.

◆ generateMipmaps()

void KWin::GLTexture::generateMipmaps ( )

Definition at line 322 of file gltexture.cpp.

◆ height()

int KWin::GLTexture::height ( ) const

Definition at line 546 of file gltexture.cpp.

◆ internalFormat()

GLenum KWin::GLTexture::internalFormat ( ) const

Definition at line 418 of file gltexture.cpp.

◆ isDirty()

bool KWin::GLTexture::isDirty ( ) const

Definition at line 460 of file gltexture.cpp.

◆ isNull()

bool KWin::GLTexture::isNull ( ) const

Definition at line 181 of file gltexture.cpp.

◆ matrix()

QMatrix4x4 KWin::GLTexture::matrix ( TextureCoordinateType type) const

Returns a matrix that transforms texture coordinates of the given type, taking the texture target and the y-inversion flag into account.

Since
4.11

Definition at line 551 of file gltexture.cpp.

◆ onDamage()

void KWin::GLTexture::onDamage ( )
protectedvirtual

Definition at line 486 of file gltexture.cpp.

◆ render() [1/3]

void KWin::GLTexture::render ( const QRectF & source,
const QRegion & region,
const QSizeF & targetSize,
bool hardwareClipping = false )

Definition at line 345 of file gltexture.cpp.

◆ render() [2/3]

void KWin::GLTexture::render ( const QRegion & region,
const QSizeF & size,
bool hardwareClipping = false )

Definition at line 339 of file gltexture.cpp.

◆ render() [3/3]

void KWin::GLTexture::render ( const QSizeF & size)

Definition at line 334 of file gltexture.cpp.

◆ setContentTransform()

void KWin::GLTexture::setContentTransform ( OutputTransform transform)

sets the transform between the content and the buffer

Definition at line 515 of file gltexture.cpp.

◆ setDirty()

void KWin::GLTexture::setDirty ( )
Deprecated
track modifications to the texture yourself

Definition at line 481 of file gltexture.cpp.

◆ setFilter()

void KWin::GLTexture::setFilter ( GLenum filter)

Definition at line 465 of file gltexture.cpp.

◆ setSize()

void KWin::GLTexture::setSize ( const QSize & size)

Definition at line 191 of file gltexture.cpp.

◆ setSwizzle()

void KWin::GLTexture::setSwizzle ( GLenum red,
GLenum green,
GLenum blue,
GLenum alpha )

Specifies which component of a texel is placed in each respective component of the vector returned to the shader.

Valid values are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_ONE and GL_ZERO.

See also
swizzleSupported()
Since
5.2

Definition at line 528 of file gltexture.cpp.

◆ setWrapMode()

void KWin::GLTexture::setWrapMode ( GLenum mode)

Definition at line 473 of file gltexture.cpp.

◆ size()

QSize KWin::GLTexture::size ( ) const

Definition at line 186 of file gltexture.cpp.

◆ supportsFormatRG()

bool KWin::GLTexture::supportsFormatRG ( )
static

Returns true if texture formats R* are supported, and false otherwise.

This requires OpenGL 3.0, GL_ARB_texture_rg or OpenGL ES 3.0 or GL_EXT_texture_rg.

Since
5.2.1

Definition at line 566 of file gltexture.cpp.

◆ supportsSwizzle()

bool KWin::GLTexture::supportsSwizzle ( )
static

Returns true if texture swizzle is supported, and false otherwise

Texture swizzle requires OpenGL 3.3, GL_ARB_texture_swizzle, or OpenGL ES 3.0.

Since
5.2

Definition at line 561 of file gltexture.cpp.

◆ target()

GLenum KWin::GLTexture::target ( ) const

Definition at line 408 of file gltexture.cpp.

◆ texture()

GLuint KWin::GLTexture::texture ( ) const

Definition at line 403 of file gltexture.cpp.

◆ toImage()

QImage KWin::GLTexture::toImage ( )

Definition at line 571 of file gltexture.cpp.

◆ unbind()

void KWin::GLTexture::unbind ( )

Definition at line 329 of file gltexture.cpp.

◆ update()

void KWin::GLTexture::update ( const QImage & image,
const QPoint & offset = QPoint(0, 0),
const QRect & src = QRect() )

Definition at line 200 of file gltexture.cpp.

◆ upload() [1/2]

std::unique_ptr< GLTexture > KWin::GLTexture::upload ( const QImage & image)
static

Definition at line 635 of file gltexture.cpp.

◆ upload() [2/2]

std::unique_ptr< GLTexture > KWin::GLTexture::upload ( const QPixmap & pixmap)
static

Definition at line 695 of file gltexture.cpp.

◆ width()

int KWin::GLTexture::width ( ) const

Definition at line 541 of file gltexture.cpp.

Member Data Documentation

◆ d

const std::unique_ptr<GLTexturePrivate> KWin::GLTexture::d
protected

Definition at line 143 of file gltexture.h.


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