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
qquickrhiitem_p.h
Go to the documentation of this file.
1
// Copyright (C) 2023 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
4
#ifndef QQUICKRHIITEM_P_H
5
#define QQUICKRHIITEM_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#include "
qquickrhiitem.h
"
19
#include <QtQuick/QSGTextureProvider>
20
#include <QtQuick/QSGSimpleTextureNode>
21
#include <QtQuick/private/qquickitem_p.h>
22
#include <
rhi/qrhi.h
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QQuickRhiItemNode
:
public
QSGTextureProvider
,
public
QSGSimpleTextureNode
27
{
28
Q_OBJECT
29
30
public
:
31
QQuickRhiItemNode
(
QQuickRhiItem
*
item
);
32
33
QSGTexture
*
texture
()
const override
;
34
35
void
sync
();
36
QRhiCommandBuffer
*
queryCommandBuffer
();
37
void
resetColorBufferObjects
();
38
void
resetRenderTargetObjects
();
39
40
bool
isValid
()
const
41
{
42
return
m_rhi
&&
m_sgTexture
;
43
}
44
45
void
scheduleUpdate
()
46
{
47
m_renderPending
=
true
;
48
m_window
->
update
();
// ensure getting to beforeRendering() at some point
49
}
50
51
bool
hasRenderer
()
const
52
{
53
return
m_renderer
!=
nullptr
;
54
}
55
56
void
setRenderer
(
QQuickRhiItemRenderer
*
r
)
57
{
58
m_renderer
.reset(
r
);
59
}
60
61
QQuickRhiItem
*
m_item
;
62
QQuickWindow
*
m_window
;
63
QSize
m_pixelSize
;
64
qreal
m_dpr
= 0.0f;
65
QRhi
*
m_rhi
=
nullptr
;
66
bool
m_renderPending
=
true
;
67
std::unique_ptr<QSGTexture>
m_sgTexture
;
68
std::unique_ptr<QQuickRhiItemRenderer>
m_renderer
;
69
QRhiTexture
*
m_colorTexture
=
nullptr
;
70
QRhiTexture
*
m_resolveTexture
=
nullptr
;
71
std::unique_ptr<QRhiRenderBuffer>
m_msaaColorBuffer
;
72
std::unique_ptr<QRhiRenderBuffer>
m_depthStencilBuffer
;
73
std::unique_ptr<QRhiTextureRenderTarget>
m_renderTarget
;
74
std::unique_ptr<QRhiRenderPassDescriptor>
m_renderPassDescriptor
;
75
76
public
slots
:
77
void
render
();
78
};
79
80
class
QQuickRhiItemPrivate
:
public
QQuickItemPrivate
81
{
82
Q_DECLARE_PUBLIC(
QQuickRhiItem
)
83
84
public
:
85
static
QQuickRhiItemPrivate
*
get
(
QQuickRhiItem
*
item
) {
return
item
->d_func(); }
86
87
mutable
QQuickRhiItemNode
*
node
=
nullptr
;
88
QQuickRhiItem::TextureFormat
itemTextureFormat
=
QQuickRhiItem::TextureFormat::RGBA8
;
89
QRhiTexture::Format
rhiTextureFormat
=
QRhiTexture::RGBA8
;
90
int
samples
= 1;
91
bool
autoRenderTarget
=
true
;
92
bool
mirrorVertically
=
false
;
93
bool
blend
=
false
;
94
int
fixedTextureWidth
= 0;
95
int
fixedTextureHeight
= 0;
96
QSize
effectiveTextureSize
;
97
};
98
99
QT_END_NAMESPACE
100
101
#endif
QQuickItemPrivate
Definition
qquickitem_p.h:226
QQuickRhiItemNode
Definition
qquickrhiitem_p.h:27
QQuickRhiItemNode::scheduleUpdate
void scheduleUpdate()
Definition
qquickrhiitem_p.h:45
QQuickRhiItemNode::m_colorTexture
QRhiTexture * m_colorTexture
Definition
qquickrhiitem_p.h:69
QQuickRhiItemNode::m_item
QQuickRhiItem * m_item
Definition
qquickrhiitem_p.h:61
QQuickRhiItemNode::QQuickRhiItemNode
QQuickRhiItemNode(QQuickRhiItem *item)
Definition
qquickrhiitem.cpp:153
QQuickRhiItemNode::m_pixelSize
QSize m_pixelSize
Definition
qquickrhiitem_p.h:63
QQuickRhiItemNode::queryCommandBuffer
QRhiCommandBuffer * queryCommandBuffer()
Definition
qquickrhiitem.cpp:360
QQuickRhiItemNode::resetRenderTargetObjects
void resetRenderTargetObjects()
Definition
qquickrhiitem.cpp:181
QQuickRhiItemNode::m_renderTarget
std::unique_ptr< QRhiTextureRenderTarget > m_renderTarget
Definition
qquickrhiitem_p.h:73
QQuickRhiItemNode::m_rhi
QRhi * m_rhi
Definition
qquickrhiitem_p.h:65
QQuickRhiItemNode::m_renderPassDescriptor
std::unique_ptr< QRhiRenderPassDescriptor > m_renderPassDescriptor
Definition
qquickrhiitem_p.h:74
QQuickRhiItemNode::m_renderer
std::unique_ptr< QQuickRhiItemRenderer > m_renderer
Definition
qquickrhiitem_p.h:68
QQuickRhiItemNode::m_window
QQuickWindow * m_window
Definition
qquickrhiitem_p.h:62
QQuickRhiItemNode::m_depthStencilBuffer
std::unique_ptr< QRhiRenderBuffer > m_depthStencilBuffer
Definition
qquickrhiitem_p.h:72
QQuickRhiItemNode::sync
void sync()
Definition
qquickrhiitem.cpp:188
QQuickRhiItemNode::resetColorBufferObjects
void resetColorBufferObjects()
Definition
qquickrhiitem.cpp:170
QQuickRhiItemNode::m_sgTexture
std::unique_ptr< QSGTexture > m_sgTexture
Definition
qquickrhiitem_p.h:67
QQuickRhiItemNode::isValid
bool isValid() const
Definition
qquickrhiitem_p.h:40
QQuickRhiItemNode::texture
QSGTexture * texture() const override
Returns a pointer to the texture object.
Definition
qquickrhiitem.cpp:165
QQuickRhiItemNode::m_renderPending
bool m_renderPending
Definition
qquickrhiitem_p.h:66
QQuickRhiItemNode::setRenderer
void setRenderer(QQuickRhiItemRenderer *r)
Definition
qquickrhiitem_p.h:56
QQuickRhiItemNode::m_msaaColorBuffer
std::unique_ptr< QRhiRenderBuffer > m_msaaColorBuffer
Definition
qquickrhiitem_p.h:71
QQuickRhiItemNode::render
void render()
Definition
qquickrhiitem.cpp:379
QQuickRhiItemNode::hasRenderer
bool hasRenderer() const
Definition
qquickrhiitem_p.h:51
QQuickRhiItemNode::m_dpr
qreal m_dpr
Definition
qquickrhiitem_p.h:64
QQuickRhiItemNode::m_resolveTexture
QRhiTexture * m_resolveTexture
Definition
qquickrhiitem_p.h:70
QQuickRhiItemPrivate
Definition
qquickrhiitem_p.h:81
QQuickRhiItemPrivate::fixedTextureWidth
int fixedTextureWidth
Definition
qquickrhiitem_p.h:94
QQuickRhiItemPrivate::get
static QQuickRhiItemPrivate * get(QQuickRhiItem *item)
Definition
qquickrhiitem_p.h:85
QQuickRhiItemPrivate::rhiTextureFormat
QRhiTexture::Format rhiTextureFormat
Definition
qquickrhiitem_p.h:89
QQuickRhiItemPrivate::blend
bool blend
Definition
qquickrhiitem_p.h:93
QQuickRhiItemPrivate::node
QQuickRhiItemNode * node
Definition
qquickrhiitem_p.h:87
QQuickRhiItemPrivate::autoRenderTarget
bool autoRenderTarget
Definition
qquickrhiitem_p.h:91
QQuickRhiItemPrivate::mirrorVertically
bool mirrorVertically
Definition
qquickrhiitem_p.h:92
QQuickRhiItemPrivate::effectiveTextureSize
QSize effectiveTextureSize
Definition
qquickrhiitem_p.h:96
QQuickRhiItemPrivate::fixedTextureHeight
int fixedTextureHeight
Definition
qquickrhiitem_p.h:95
QQuickRhiItemPrivate::itemTextureFormat
QQuickRhiItem::TextureFormat itemTextureFormat
Definition
qquickrhiitem_p.h:88
QQuickRhiItemRenderer
\inmodule QtQuick
Definition
qquickrhiitem.h:21
QQuickRhiItem
\inmodule QtQuick
Definition
qquickrhiitem.h:49
QQuickRhiItem::TextureFormat
TextureFormat
Definition
qquickrhiitem.h:62
QQuickRhiItem::TextureFormat::RGBA8
@ RGBA8
QQuickWindow
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
Definition
qquickwindow.h:42
QQuickWindow::update
void update()
Schedules the window to render another frame.
Definition
qquickwindow.cpp:399
QRhiCommandBuffer
\inmodule QtGui
Definition
qrhi.h:1651
QRhiTexture
\inmodule QtGui
Definition
qrhi.h:895
QRhiTexture::Format
Format
Specifies the texture format.
Definition
qrhi.h:914
QRhiTexture::RGBA8
@ RGBA8
Definition
qrhi.h:917
QRhi
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition
qrhi.h:1804
QSGSimpleTextureNode
The QSGSimpleTextureNode class is provided for convenience to easily draw textured content using the ...
Definition
qsgsimpletexturenode.h:16
QSGTextureProvider
The QSGTextureProvider class encapsulates texture based entities in QML.
Definition
qsgtextureprovider.h:13
QSGTexture
\inmodule QtQuick
Definition
qsgtexture.h:20
QSize
\inmodule QtCore
Definition
qsize.h:25
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
samples
GLsizei samples
Definition
qopengles2ext.h:738
r
GLboolean r
[2]
Definition
qopengles2ext.h:337
qquickrhiitem.h
qrhi.h
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:119
slots
#define slots
Definition
qtmetamacros.h:40
qreal
double qreal
Definition
qtypes.h:187
item
QGraphicsItem * item
Definition
src_gui_graphicsview_qgraphicsitem.cpp:107
qtdeclarative
src
quick
items
qquickrhiitem_p.h
Generated by
1.10.0