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
qquickframebufferobject.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QQUICKFRAMEBUFFEROBJECT_H
6#define QQUICKFRAMEBUFFEROBJECT_H
7
8#include <QtQuick/QQuickItem>
9
10QT_BEGIN_NAMESPACE
11
12class QOpenGLFramebufferObject;
15
16class Q_QUICK_EXPORT QQuickFramebufferObject : public QQuickItem
17{
18 Q_OBJECT
19 Q_DECLARE_PRIVATE(QQuickFramebufferObject)
20
21 Q_PROPERTY(bool textureFollowsItemSize READ textureFollowsItemSize WRITE setTextureFollowsItemSize NOTIFY textureFollowsItemSizeChanged)
22 Q_PROPERTY(bool mirrorVertically READ mirrorVertically WRITE setMirrorVertically NOTIFY mirrorVerticallyChanged)
23
24public:
25
26 class Q_QUICK_EXPORT Renderer {
27 protected:
28 Renderer();
29 virtual ~Renderer();
30 virtual void render() = 0;
31 virtual QOpenGLFramebufferObject *createFramebufferObject(const QSize &size);
32 virtual void synchronize(QQuickFramebufferObject *);
33 QOpenGLFramebufferObject *framebufferObject() const;
34 void update();
35 void invalidateFramebufferObject();
36 private:
37 friend class QSGFramebufferObjectNode;
38 friend class QQuickFramebufferObject;
39 void *data;
40 };
41
42 QQuickFramebufferObject(QQuickItem *parent = nullptr);
43
44 bool textureFollowsItemSize() const;
45 void setTextureFollowsItemSize(bool follows);
46
47 bool mirrorVertically() const;
48 void setMirrorVertically(bool enable);
49
50 virtual Renderer *createRenderer() const = 0;
51
52 bool isTextureProvider() const override;
53 QSGTextureProvider *textureProvider() const override;
54 void releaseResources() override;
55
56protected:
57 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
58
59protected:
60 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
61
62Q_SIGNALS:
63 void textureFollowsItemSizeChanged(bool);
64 void mirrorVerticallyChanged(bool);
65
66private Q_SLOTS:
67 void invalidateSceneGraph();
68};
69
70QT_END_NAMESPACE
71
72#endif // QQUICKFRAMEBUFFEROBJECT_H
QOpenGLFramebufferObject * msDisplayFbo
QOpenGLFramebufferObject * fbo
QQuickFramebufferObject * quickFbo
static bool isOpenGL(QSGRenderContext *rc)