1// Copyright (C) 2020 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 QQUICKRENDERTARGET_P_H
5#define QQUICKRENDERTARGET_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 <QtQuick/private/qtquickglobal_p.h>
19#include "qquickrendertarget.h"
20#include <QAtomicInt>
21
22QT_BEGIN_NAMESPACE
23
24class QRhi;
25class QQuickWindowRenderTarget;
26
27class Q_QUICK_PRIVATE_EXPORT QQuickRenderTargetPrivate
28{
29public:
30 static QQuickRenderTargetPrivate *get(QQuickRenderTarget *rt) { return rt->d; }
31 static const QQuickRenderTargetPrivate *get(const QQuickRenderTarget *rt) { return rt->d; }
32 QQuickRenderTargetPrivate();
33 QQuickRenderTargetPrivate(const QQuickRenderTargetPrivate *other);
34 bool resolve(QRhi *rhi, QQuickWindowRenderTarget *dst);
35
36 enum class Type {
37 Null,
38 NativeTexture,
39 NativeRenderbuffer,
40 RhiRenderTarget,
41 PaintDevice
42 };
43
44 QAtomicInt ref;
45 Type type = Type::Null;
46 QSize pixelSize;
47 qreal devicePixelRatio = 1.0;
48 int sampleCount = 1;
49 struct NativeTexture {
50 quint64 object;
51 int layoutOrState;
52 uint rhiFormat;
53 uint rhiFlags;
54 };
55 union {
56 NativeTexture nativeTexture;
57 quint64 nativeRenderbufferObject;
58 QRhiRenderTarget *rhiRt;
59 QPaintDevice *paintDevice;
60 } u;
61
62 bool mirrorVertically = false;
63};
64
65QT_END_NAMESPACE
66
67#endif // QQUICKRENDERTARGET_P_H
68

source code of qtdeclarative/src/quick/items/qquickrendertarget_p.h