Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsgrhilayer_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QSGRHILAYER_P_H
4#define QSGRHILAYER_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <private/qsgadaptationlayer_p.h>
18#include <private/qsgcontext_p.h>
19#include <private/qsgtexture_p.h>
20#include <rhi/qrhi.h>
21
23
25
26class Q_QUICK_EXPORT QSGRhiLayer : public QSGLayer
27{
29
30public:
33
34 bool updateTexture() override;
35
36 bool hasAlphaChannel() const override;
37 bool hasMipmaps() const override;
38 QSize textureSize() const override { return m_pixelSize; }
39
40 qint64 comparisonKey() const override;
41 QRhiTexture *rhiTexture() const override;
42 void commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates) override;
43
44 void setItem(QSGNode *item) override;
45 void setRect(const QRectF &logicalRect) override;
46 void setSize(const QSize &pixelSize) override;
47 void setHasMipmaps(bool mipmap) override;
48 void setFormat(Format format) override;
49 void setLive(bool live) override;
50 void setRecursive(bool recursive) override;
51 void setDevicePixelRatio(qreal ratio) override { m_dpr = ratio; }
52 void setMirrorHorizontal(bool mirror) override;
53 void setMirrorVertical(bool mirror) override;
54 QRectF normalizedTextureSubRect() const override;
55 void setSamples(int samples) override { m_samples = samples; }
56
57 void scheduleUpdate() override;
58 QImage toImage() const override;
59
60public Q_SLOTS:
61 void markDirtyTexture() override;
62 void invalidated() override;
63
64private:
65 void grab();
66 void releaseResources();
67
68 QSGNode *m_item = nullptr;
69 QRectF m_logicalRect;
70 QSize m_pixelSize;
71 qreal m_dpr = 1;
73
74 QSGRenderer *m_renderer = nullptr;
75 QRhiTexture *m_texture = nullptr;
76 QRhiRenderBuffer *m_ds = nullptr;
77 QRhiRenderBuffer *m_msaaColorBuffer = nullptr;
78 QRhiTexture *m_secondaryTexture = nullptr;
79 QRhiTextureRenderTarget *m_rt = nullptr;
80 QRhiRenderPassDescriptor *m_rtRp = nullptr;
81
82 QSGDefaultRenderContext *m_context = nullptr;
83 QRhi *m_rhi = nullptr;
84 int m_samples = 0;
85
86 uint m_mipmap : 1;
87 uint m_live : 1;
88 uint m_recursive : 1;
89 uint m_dirtyTexture : 1;
90 uint m_multisampling : 1;
91 uint m_grab : 1;
92 uint m_mirrorHorizontal : 1;
93 uint m_mirrorVertical : 1;
94};
95
97
98#endif // QSGRHILAYER_P_H
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtGui
Definition qrhi.h:1094
\inmodule QtGui
Definition qrhi.h:1142
\inmodule QtGui
Definition qrhi.h:1731
\inmodule QtGui
Definition qrhi.h:1184
\inmodule QtGui
Definition qrhi.h:895
Format
Specifies the texture format.
Definition qrhi.h:914
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
The renderer class is the abstract baseclass used for rendering the QML scene graph.
void setDevicePixelRatio(qreal ratio) override
QSize textureSize() const override
Returns the size of the texture in pixels.
void setSamples(int samples) override
\inmodule QtCore
Definition qsize.h:25
Format
Definition ddsheader.h:14
widget setFormat(format)
Combined button and popup list for selecting options.
static void * context
GLsizei samples
GLint GLsizei GLsizei GLenum format
#define Q_OBJECT
#define Q_SLOTS
unsigned int uint
Definition qtypes.h:34
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QGraphicsItem * item