Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qbackingstoredefaultcompositor.cpp File Reference
#include "qbackingstoredefaultcompositor_p.h"
#include <QtGui/private/qwindow_p.h>
#include <qpa/qplatformgraphicsbuffer.h>
#include <QtCore/qfile.h>
+ Include dependency graph for qbackingstoredefaultcompositor.cpp:

Go to the source code of this file.

Enumerations

enum class  SourceTransformOrigin { BottomLeft , TopLeft }
 
enum class  PipelineBlend { None , Alpha , PremulAlpha }
 

Functions

static QRect scaledRect (const QRect &rect, qreal factor)
 
static QPoint scaledOffset (const QPoint &pt, qreal factor)
 
static QRegion scaledRegion (const QRegion &region, qreal factor, const QPoint &offset)
 
static QMatrix4x4 targetTransform (const QRectF &target, const QRect &viewport, bool invertY)
 
static QMatrix3x3 sourceTransform (const QRectF &subTexture, const QSize &textureSize, SourceTransformOrigin origin)
 
static QRect toBottomLeftRect (const QRect &topLeftRect, int windowHeight)
 
static bool prepareDrawForRenderToTextureWidget (const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect, const QPoint &offset, bool invertTargetY, bool invertSource, QMatrix4x4 *target, QMatrix3x3 *source)
 
static QShader getShader (const QString &name)
 
static void updateMatrix3x3 (QRhiResourceUpdateBatch *resourceUpdates, QRhiBuffer *ubuf, const QMatrix3x3 &m)
 
static QRhiGraphicsPipelinecreateGraphicsPipeline (QRhi *rhi, QRhiShaderResourceBindings *srb, QRhiSwapChain *swapchain, PipelineBlend blend)
 

Variables

static const int UBUF_SIZE = 120
 

Enumeration Type Documentation

◆ PipelineBlend

enum class PipelineBlend
strong
Enumerator
None 
Alpha 
PremulAlpha 

Definition at line 275 of file qbackingstoredefaultcompositor.cpp.

◆ SourceTransformOrigin

enum class SourceTransformOrigin
strong
Enumerator
BottomLeft 
TopLeft 

Definition at line 179 of file qbackingstoredefaultcompositor.cpp.

Function Documentation

◆ createGraphicsPipeline()

◆ getShader()

static QShader getShader ( const QString name)
static

Definition at line 248 of file qbackingstoredefaultcompositor.cpp.

References QShader::fromSerialized(), qPrintable, qWarning, and QIODeviceBase::ReadOnly.

Referenced by createGraphicsPipeline(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareDrawForRenderToTextureWidget()

static bool prepareDrawForRenderToTextureWidget ( const QPlatformTextureList textures,
int  idx,
QWindow window,
const QRect deviceWindowRect,
const QPoint offset,
bool  invertTargetY,
bool  invertSource,
QMatrix4x4 target,
QMatrix3x3 source 
)
static

Definition at line 216 of file qbackingstoredefaultcompositor.cpp.

References BottomLeft, QRect::height(), QRect::isEmpty(), scaledRect(), QRect::size(), sourceTransform(), targetTransform(), toBottomLeftRect(), QRect::topLeft(), TopLeft, QRect::translate(), QRect::translated(), and window().

Referenced by QBackingStoreDefaultCompositor::flush().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scaledOffset()

static QPoint scaledOffset ( const QPoint pt,
qreal  factor 
)
inlinestatic

Definition at line 136 of file qbackingstoredefaultcompositor.cpp.

Referenced by QBackingStoreDefaultCompositor::flush().

+ Here is the caller graph for this function:

◆ scaledRect()

static QRect scaledRect ( const QRect rect,
qreal  factor 
)
inlinestatic

Definition at line 131 of file qbackingstoredefaultcompositor.cpp.

References rect.

Referenced by QBackingStoreDefaultCompositor::flush(), prepareDrawForRenderToTextureWidget(), and scaledRegion().

+ Here is the caller graph for this function:

◆ scaledRegion()

static QRegion scaledRegion ( const QRegion region,
qreal  factor,
const QPoint offset 
)
static

Definition at line 141 of file qbackingstoredefaultcompositor.cpp.

References QVarLengthArray< T, Prealloc >::append(), QVarLengthArray< T, Prealloc >::constData(), rect, QRegion::rectCount(), QVarLengthArray< T, Prealloc >::reserve(), scaledRect(), QRegion::setRects(), and QVLABaseBase::size().

Referenced by QBackingStoreDefaultCompositor::flush().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sourceTransform()

static QMatrix3x3 sourceTransform ( const QRectF subTexture,
const QSize textureSize,
SourceTransformOrigin  origin 
)
static

Definition at line 184 of file qbackingstoredefaultcompositor.cpp.

References QRectF::height(), QSize::height(), QRectF::topLeft(), TopLeft, QRectF::width(), QSize::width(), QPointF::x(), and QPointF::y().

Referenced by QOpenGLTextureBlitterPrivate::blit(), QOpenGLTextureBlitterPrivate::blit(), QBackingStoreDefaultCompositor::flush(), prepareDrawForRenderToTextureWidget(), and QOpenGLTextureBlitterPrivate::toTextureCoordinates().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ targetTransform()

static QMatrix4x4 targetTransform ( const QRectF target,
const QRect viewport,
bool  invertY 
)
static

Definition at line 156 of file qbackingstoredefaultcompositor.cpp.

References viewport(), QPointF::x(), and QPointF::y().

Referenced by QOpenGLTextureBlitterPrivate::blit(), QOpenGLTextureBlitterPrivate::blit(), and prepareDrawForRenderToTextureWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toBottomLeftRect()

static QRect toBottomLeftRect ( const QRect topLeftRect,
int  windowHeight 
)
inlinestatic

Definition at line 210 of file qbackingstoredefaultcompositor.cpp.

References QRect::bottomRight(), QRect::height(), QRect::width(), QRect::x(), and QPoint::y().

Referenced by QBackingStoreDefaultCompositor::flush(), and prepareDrawForRenderToTextureWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateMatrix3x3()

static void updateMatrix3x3 ( QRhiResourceUpdateBatch resourceUpdates,
QRhiBuffer ubuf,
const QMatrix3x3 m 
)
static

Definition at line 260 of file qbackingstoredefaultcompositor.cpp.

References QRhiResourceUpdateBatch::updateDynamicBuffer().

+ Here is the call graph for this function:

Variable Documentation

◆ UBUF_SIZE

const int UBUF_SIZE = 120
static