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
25
27{
29
30public:
32
33 QSGTexture *texture() const override;
34
35 void sync();
39
40 bool isValid() const
41 {
42 return m_rhi && m_sgTexture;
43 }
44
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
57 {
58 m_renderer.reset(r);
59 }
60
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;
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
76public slots:
77 void render();
78};
79
98
100
101#endif
QRhiTexture * m_colorTexture
QQuickRhiItem * m_item
QQuickRhiItemNode(QQuickRhiItem *item)
QRhiCommandBuffer * queryCommandBuffer()
std::unique_ptr< QRhiTextureRenderTarget > m_renderTarget
std::unique_ptr< QRhiRenderPassDescriptor > m_renderPassDescriptor
std::unique_ptr< QQuickRhiItemRenderer > m_renderer
QQuickWindow * m_window
std::unique_ptr< QRhiRenderBuffer > m_depthStencilBuffer
std::unique_ptr< QSGTexture > m_sgTexture
bool isValid() const
QSGTexture * texture() const override
Returns a pointer to the texture object.
void setRenderer(QQuickRhiItemRenderer *r)
std::unique_ptr< QRhiRenderBuffer > m_msaaColorBuffer
bool hasRenderer() const
QRhiTexture * m_resolveTexture
static QQuickRhiItemPrivate * get(QQuickRhiItem *item)
QRhiTexture::Format rhiTextureFormat
QQuickRhiItemNode * node
QQuickRhiItem::TextureFormat itemTextureFormat
\inmodule QtQuick
\inmodule QtQuick
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
void update()
Schedules the window to render another frame.
\inmodule QtGui
Definition qrhi.h:1651
\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
The QSGSimpleTextureNode class is provided for convenience to easily draw textured content using the ...
The QSGTextureProvider class encapsulates texture based entities in QML.
\inmodule QtQuick
Definition qsgtexture.h:20
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
GLsizei samples
GLboolean r
[2]
#define Q_OBJECT
#define slots
double qreal
Definition qtypes.h:187
QGraphicsItem * item