summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qrhiwidget_p.h
blob: b594b67ec82ce1605f67caee26b51c84427f5131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QRHIWIDGET_P_H
#define QRHIWIDGET_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include "qrhiwidget.h"
#include <rhi/qrhi.h>
#include <private/qwidget_p.h>
#include <private/qbackingstorerhisupport_p.h>

QT_BEGIN_NAMESPACE

class QRhiWidgetPrivate : public QWidgetPrivate
{
    Q_DECLARE_PUBLIC(QRhiWidget)
public:
    TextureData texture() const override;
    QPlatformTextureList::Flags textureListFlags() override;
    QPlatformBackingStoreRhiConfig rhiConfig() const override;
    void endCompose() override;
    QImage grabFramebuffer() override;

    void ensureRhi();
    void ensureTexture(bool *changed);
    bool invokeInitialize(QRhiCommandBuffer *cb);
    void resetColorBufferObjects();
    void resetRenderTargetObjects();
    void releaseResources();

    QRhi *rhi = nullptr;
    bool noSize = false;
    QPlatformBackingStoreRhiConfig config;
    QRhiWidget::TextureFormat widgetTextureFormat = QRhiWidget::TextureFormat::RGBA8;
    QRhiTexture::Format rhiTextureFormat = QRhiTexture::RGBA8;
    int samples = 1;
    QSize fixedSize;
    bool autoRenderTarget = true;
    bool mirrorVertically = false;
    QBackingStoreRhiSupport offscreenRenderer;
    bool textureInvalid = false;
    QRhiTexture *colorTexture = nullptr;
    QRhiRenderBuffer *msaaColorBuffer = nullptr;
    QRhiTexture *resolveTexture = nullptr;
    QRhiRenderBuffer *depthStencilBuffer = nullptr;
    QRhiTextureRenderTarget *renderTarget = nullptr;
    QRhiRenderPassDescriptor *renderPassDescriptor = nullptr;
    mutable QVector<QRhiResource *> pendingDeletes;
};

QT_END_NAMESPACE

#endif