OpenCoverage

qquickshadereffectsource_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickshadereffectsource_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QQUICKSHADEREFFECTSOURCE_P_H-
41#define QQUICKSHADEREFFECTSOURCE_P_H-
42-
43//-
44// W A R N I N G-
45// --------------
46//-
47// This file is not part of the Qt API. It exists purely as an-
48// implementation detail. This header file may change from version to-
49// version without notice, or even be removed.-
50//-
51// We mean it.-
52//-
53-
54#include <QtQuick/private/qtquickglobal_p.h>-
55-
56QT_REQUIRE_CONFIG(quick_shadereffect);-
57-
58#include "qquickitem.h"-
59#include <QtQuick/qsgtextureprovider.h>-
60#include <private/qsgadaptationlayer_p.h>-
61#include <QtQuick/private/qsgcontext_p.h>-
62#include <private/qsgdefaultinternalimagenode_p.h>-
63#include <private/qquickitemchangelistener_p.h>-
64-
65#include "qpointer.h"-
66#include "qsize.h"-
67#include "qrect.h"-
68-
69QT_BEGIN_NAMESPACE-
70-
71class QSGNode;-
72class UpdatePaintNodeData;-
73class QOpenGLFramebufferObject;-
74class QSGSimpleRectNode;-
75-
76class QQuickShaderEffectSourceTextureProvider;-
77-
78class Q_QUICK_PRIVATE_EXPORT QQuickShaderEffectSource : public QQuickItem, public QQuickItemChangeListener-
79{-
80 Q_OBJECT-
81 Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)-
82 Q_PROPERTY(QQuickItem *sourceItem READ sourceItem WRITE setSourceItem NOTIFY sourceItemChanged)-
83 Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged)-
84 Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged)-
85 Q_PROPERTY(Format format READ format WRITE setFormat NOTIFY formatChanged)-
86 Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged)-
87 Q_PROPERTY(bool hideSource READ hideSource WRITE setHideSource NOTIFY hideSourceChanged)-
88 Q_PROPERTY(bool mipmap READ mipmap WRITE setMipmap NOTIFY mipmapChanged)-
89 Q_PROPERTY(bool recursive READ recursive WRITE setRecursive NOTIFY recursiveChanged)-
90 Q_PROPERTY(TextureMirroring textureMirroring READ textureMirroring WRITE setTextureMirroring NOTIFY textureMirroringChanged REVISION 1)-
91 Q_PROPERTY(int samples READ samples WRITE setSamples NOTIFY samplesChanged REVISION 2)-
92-
93public:-
94 enum WrapMode {-
95 ClampToEdge,-
96 RepeatHorizontally,-
97 RepeatVertically,-
98 Repeat-
99 };-
100 Q_ENUM(WrapMode)-
101 // Equivalents to GL_ALPHA and similar type constants.-
102 enum Format {-
103 Alpha = 0x1906,-
104 RGB = 0x1907,-
105 RGBA = 0x1908-
106 };-
107 Q_ENUM(Format)-
108-
109 enum TextureMirroring {-
110 NoMirroring = 0x00,-
111 MirrorHorizontally = 0x01,-
112 MirrorVertically = 0x02-
113 };-
114 Q_ENUM(TextureMirroring)-
115-
116 QQuickShaderEffectSource(QQuickItem *parent = nullptr);-
117 ~QQuickShaderEffectSource() override;-
118-
119 WrapMode wrapMode() const;-
120 void setWrapMode(WrapMode mode);-
121-
122 QQuickItem *sourceItem() const;-
123 void setSourceItem(QQuickItem *item);-
124-
125 QRectF sourceRect() const;-
126 void setSourceRect(const QRectF &rect);-
127-
128 QSize textureSize() const;-
129 void setTextureSize(const QSize &size);-
130-
131 Format format() const;-
132 void setFormat(Format format);-
133-
134 bool live() const;-
135 void setLive(bool live);-
136-
137 bool hideSource() const;-
138 void setHideSource(bool hide);-
139-
140 bool mipmap() const;-
141 void setMipmap(bool enabled);-
142-
143 bool recursive() const;-
144 void setRecursive(bool enabled);-
145-
146 TextureMirroring textureMirroring() const;-
147 void setTextureMirroring(TextureMirroring mirroring);-
148-
149 bool isTextureProvider() const override { return true; }
executed 58 times by 3 tests: return true;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
  • tst_qquickitemlayer
58
150 QSGTextureProvider *textureProvider() const override;-
151-
152 Q_INVOKABLE void scheduleUpdate();-
153-
154 int samples() const;-
155 void setSamples(int count);-
156-
157Q_SIGNALS:-
158 void wrapModeChanged();-
159 void sourceItemChanged();-
160 void sourceRectChanged();-
161 void textureSizeChanged();-
162 void formatChanged();-
163 void liveChanged();-
164 void hideSourceChanged();-
165 void mipmapChanged();-
166 void recursiveChanged();-
167 void textureMirroringChanged();-
168 void samplesChanged();-
169-
170 void scheduledUpdateCompleted();-
171-
172private Q_SLOTS:-
173 void sourceItemDestroyed(QObject *item);-
174 void invalidateSceneGraph();-
175-
176protected:-
177 void releaseResources() override;-
178 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;-
179-
180 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override;-
181 void itemChange(ItemChange change, const ItemChangeData &value) override;-
182-
183private:-
184 void ensureTexture();-
185-
186 QQuickShaderEffectSourceTextureProvider *m_provider;-
187 QSGLayer *m_texture;-
188 WrapMode m_wrapMode;-
189 QQuickItem *m_sourceItem;-
190 QRectF m_sourceRect;-
191 QSize m_textureSize;-
192 Format m_format;-
193 int m_samples;-
194 uint m_live : 1;-
195 uint m_hideSource : 1;-
196 uint m_mipmap : 1;-
197 uint m_recursive : 1;-
198 uint m_grab : 1;-
199 uint m_textureMirroring : 2; // Stores TextureMirroring enum-
200};-
201-
202QT_END_NAMESPACE-
203-
204#endif // QQUICKSHADEREFFECTSOURCE_P_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0