Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QQUICKRHIITEM_P_H
6
#
define
QQUICKRHIITEM_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
"qquickrhiitem.h"
20
#
include
<
QtQuick
/
QSGTextureProvider
>
21
#
include
<
QtQuick
/
QSGSimpleTextureNode
>
22
#
include
<
QtQuick
/
private
/
qquickitem_p
.
h
>
23
#
include
<
rhi
/
qrhi
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
class
QQuickRhiItemNode
:
public
QSGTextureProvider
,
public
QSGSimpleTextureNode
28
{
29
Q_OBJECT
30
31
public
:
32
QQuickRhiItemNode
(
QQuickRhiItem
*
item
);
33
34
QSGTexture
*
texture
()
const
override
;
35
36
void
sync
();
37
QRhiCommandBuffer *
queryCommandBuffer
();
38
void
resetColorBufferObjects
();
39
void
resetRenderTargetObjects
();
40
41
bool
isValid
()
const
42
{
43
return
m_rhi && m_sgTexture;
44
}
45
46
void
scheduleUpdate
()
47
{
48
m_renderPending
=
true
;
49
m_window->update();
// ensure getting to beforeRendering() at some point
50
}
51
52
bool
hasRenderer
()
const
53
{
54
return
m_renderer !=
nullptr
;
55
}
56
57
void
setRenderer
(QQuickRhiItemRenderer *r)
58
{
59
m_renderer.reset(r);
60
}
61
62
QQuickRhiItem *
m_item
;
63
QQuickWindow
*
m_window
;
64
QSize
m_pixelSize
;
65
qreal
m_dpr
= 0.0f;
66
QRhi *
m_rhi
=
nullptr
;
67
bool
m_renderPending
=
true
;
68
std
::
unique_ptr
<
QSGTexture
>
m_sgTexture
;
69
std
::
unique_ptr
<
QQuickRhiItemRenderer
>
m_renderer
;
70
QRhiTexture *
m_colorTexture
=
nullptr
;
71
QRhiTexture *
m_resolveTexture
=
nullptr
;
72
std
::
unique_ptr
<
QRhiRenderBuffer
>
m_msaaColorBuffer
;
73
std
::
unique_ptr
<
QRhiRenderBuffer
>
m_depthStencilBuffer
;
74
std
::
unique_ptr
<
QRhiTextureRenderTarget
>
m_renderTarget
;
75
std
::
unique_ptr
<
QRhiRenderPassDescriptor
>
m_renderPassDescriptor
;
76
77
public
slots
:
78
void
render
();
79
};
80
81
class
QQuickRhiItemPrivate
:
public
QQuickItemPrivate
82
{
83
Q_DECLARE_PUBLIC(QQuickRhiItem)
84
85
public
:
86
static
QQuickRhiItemPrivate
*
get
(
QQuickRhiItem
*
item
) {
return
item
->
d_func
(); }
87
88
mutable
QQuickRhiItemNode
*
node
=
nullptr
;
89
QQuickRhiItem
::
TextureFormat
itemTextureFormat
=
QQuickRhiItem
::
TextureFormat
::
RGBA8
;
90
QRhiTexture
::
Format
rhiTextureFormat
=
QRhiTexture
::
RGBA8
;
91
int
samples
= 1;
92
bool
autoRenderTarget
=
true
;
93
bool
mirrorVertically
=
false
;
94
bool
blend
=
false
;
95
int
fixedTextureWidth
= 0;
96
int
fixedTextureHeight
= 0;
97
QSize
effectiveTextureSize
;
98
};
99
100
QT_END_NAMESPACE
101
102
#
endif
QQuickRhiItemNode
Definition
qquickrhiitem_p.h:28
QQuickRhiItemNode::scheduleUpdate
void scheduleUpdate()
Definition
qquickrhiitem_p.h:46
QQuickRhiItemNode::m_colorTexture
QRhiTexture * m_colorTexture
Definition
qquickrhiitem_p.h:70
QQuickRhiItemNode::m_item
QQuickRhiItem * m_item
Definition
qquickrhiitem_p.h:62
QQuickRhiItemNode::m_pixelSize
QSize m_pixelSize
Definition
qquickrhiitem_p.h:64
QQuickRhiItemNode::queryCommandBuffer
QRhiCommandBuffer * queryCommandBuffer()
Definition
qquickrhiitem.cpp:370
QQuickRhiItemNode::resetRenderTargetObjects
void resetRenderTargetObjects()
Definition
qquickrhiitem.cpp:191
QQuickRhiItemNode::m_renderTarget
std::unique_ptr< QRhiTextureRenderTarget > m_renderTarget
Definition
qquickrhiitem_p.h:74
QQuickRhiItemNode::m_rhi
QRhi * m_rhi
Definition
qquickrhiitem_p.h:66
QQuickRhiItemNode::m_renderPassDescriptor
std::unique_ptr< QRhiRenderPassDescriptor > m_renderPassDescriptor
Definition
qquickrhiitem_p.h:75
QQuickRhiItemNode::m_renderer
std::unique_ptr< QQuickRhiItemRenderer > m_renderer
Definition
qquickrhiitem_p.h:69
QQuickRhiItemNode::m_window
QQuickWindow * m_window
Definition
qquickrhiitem_p.h:63
QQuickRhiItemNode::m_depthStencilBuffer
std::unique_ptr< QRhiRenderBuffer > m_depthStencilBuffer
Definition
qquickrhiitem_p.h:73
QQuickRhiItemNode::sync
void sync()
Definition
qquickrhiitem.cpp:198
QQuickRhiItemNode::resetColorBufferObjects
void resetColorBufferObjects()
Definition
qquickrhiitem.cpp:180
QQuickRhiItemNode::m_sgTexture
std::unique_ptr< QSGTexture > m_sgTexture
Definition
qquickrhiitem_p.h:68
QQuickRhiItemNode::isValid
bool isValid() const
Definition
qquickrhiitem_p.h:41
QQuickRhiItemNode::texture
QSGTexture * texture() const override
Returns a pointer to the texture object.
Definition
qquickrhiitem.cpp:175
QQuickRhiItemNode::m_renderPending
bool m_renderPending
Definition
qquickrhiitem_p.h:67
QQuickRhiItemNode::setRenderer
void setRenderer(QQuickRhiItemRenderer *r)
Definition
qquickrhiitem_p.h:57
QQuickRhiItemNode::m_msaaColorBuffer
std::unique_ptr< QRhiRenderBuffer > m_msaaColorBuffer
Definition
qquickrhiitem_p.h:72
QQuickRhiItemNode::hasRenderer
bool hasRenderer() const
Definition
qquickrhiitem_p.h:52
QQuickRhiItemNode::m_dpr
qreal m_dpr
Definition
qquickrhiitem_p.h:65
QQuickRhiItemNode::m_resolveTexture
QRhiTexture * m_resolveTexture
Definition
qquickrhiitem_p.h:71
QQuickRhiItemPrivate
Definition
qquickrhiitem_p.h:82
QQuickRhiItemPrivate::fixedTextureWidth
int fixedTextureWidth
Definition
qquickrhiitem_p.h:95
QQuickRhiItemPrivate::rhiTextureFormat
QRhiTexture::Format rhiTextureFormat
Definition
qquickrhiitem_p.h:90
QQuickRhiItemPrivate::blend
bool blend
Definition
qquickrhiitem_p.h:94
QQuickRhiItemPrivate::samples
int samples
Definition
qquickrhiitem_p.h:91
QQuickRhiItemPrivate::autoRenderTarget
bool autoRenderTarget
Definition
qquickrhiitem_p.h:92
QQuickRhiItemPrivate::mirrorVertically
bool mirrorVertically
Definition
qquickrhiitem_p.h:93
QQuickRhiItemPrivate::effectiveTextureSize
QSize effectiveTextureSize
Definition
qquickrhiitem_p.h:97
QQuickRhiItemPrivate::fixedTextureHeight
int fixedTextureHeight
Definition
qquickrhiitem_p.h:96
QQuickRhiItemPrivate::itemTextureFormat
QQuickRhiItem::TextureFormat itemTextureFormat
Definition
qquickrhiitem_p.h:89
QQuickRhiItem
\inmodule QtQuick
Definition
qquickrhiitem.h:50
QRhiColorAttachment
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition
qrhi.h:577
QRhiTextureRenderTargetDescription
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition
qrhi.h:621
QPlatformGraphicsBufferHelper
\inmodule QtGui
item
QGraphicsItem * item
Definition
src_gui_graphicsview_qgraphicsitem.cpp:107
qtdeclarative
src
quick
items
qquickrhiitem_p.h
Generated on
for Qt by
1.14.0