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 QRHIWIDGET_P_H
5#define QRHIWIDGET_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 "qrhiwidget.h"
19#include <rhi/qrhi.h>
20#include <private/qwidget_p.h>
21#include <private/qbackingstorerhisupport_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QRhiWidgetPrivate : public QWidgetPrivate
26{
27 Q_DECLARE_PUBLIC(QRhiWidget)
28public:
29 TextureData texture() const override;
30 QPlatformTextureList::Flags textureListFlags() override;
31 QPlatformBackingStoreRhiConfig rhiConfig() const override;
32 void endCompose() override;
33 QImage grabFramebuffer() override;
34
35 void ensureRhi();
36 void ensureTexture(bool *changed);
37 bool invokeInitialize(QRhiCommandBuffer *cb);
38 void resetColorBufferObjects();
39 void resetRenderTargetObjects();
40 void releaseResources();
41
42 QRhi *rhi = nullptr;
43 bool noSize = false;
44 QPlatformBackingStoreRhiConfig config;
45 QRhiWidget::TextureFormat widgetTextureFormat = QRhiWidget::TextureFormat::RGBA8;
46 QRhiTexture::Format rhiTextureFormat = QRhiTexture::RGBA8;
47 int samples = 1;
48 QSize fixedSize;
49 bool autoRenderTarget = true;
50 bool mirrorVertically = false;
51 QBackingStoreRhiSupport offscreenRenderer;
52 bool textureInvalid = false;
53 QRhiTexture *colorTexture = nullptr;
54 QRhiRenderBuffer *msaaColorBuffer = nullptr;
55 QRhiTexture *resolveTexture = nullptr;
56 QRhiRenderBuffer *depthStencilBuffer = nullptr;
57 QRhiTextureRenderTarget *renderTarget = nullptr;
58 QRhiRenderPassDescriptor *renderPassDescriptor = nullptr;
59 mutable QVector<QRhiResource *> pendingDeletes;
60};
61
62QT_END_NAMESPACE
63
64#endif
65

Provided by KDAB

Privacy Policy
Learn Advanced QML with KDAB
Find out more

source code of qtbase/src/widgets/kernel/qrhiwidget_p.h