diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-08-10 14:33:14 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-08-20 09:49:18 +0000 |
commit | 3f4d7a755585f1b79c7e9675220b8210f10f358e (patch) | |
tree | 50e4e4faef56413bede418bcf495ca7fe41677ba /src/quick/items/qquickitem_p.h | |
parent | 04f30db289225e700fe99c163f53f0dd7e920caf (diff) |
Add possibility to mirror ShaderEffectSource generated textures
Using textures generated by ShaderEffectSource items (or Item.layer)
with custom OpenGL code was non-intuitive due to mismatching coordinate
systems, so added a possibility to control the generated texture
orientation.
[ChangeLog][QtQuick][ShaderEffectSource] Added possibility to mirror
generated OpenGL texture.
Change-Id: I7c03d8b6fbfc43d69812c15d244200fb8e7c7bb9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/items/qquickitem_p.h')
-rw-r--r-- | src/quick/items/qquickitem_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 5e0246c32e..942b51bf68 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -143,6 +143,7 @@ class QQuickItemLayer : public QObject, public QQuickItemChangeListener Q_PROPERTY(QQuickShaderEffectSource::Format format READ format WRITE setFormat NOTIFY formatChanged) Q_PROPERTY(QByteArray samplerName READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(QQmlComponent *effect READ effect WRITE setEffect NOTIFY effectChanged) + Q_PROPERTY(QQuickShaderEffectSource::TextureMirroring textureMirroring READ textureMirroring WRITE setTextureMirroring NOTIFY textureMirroringChanged) public: QQuickItemLayer(QQuickItem *item); ~QQuickItemLayer(); @@ -177,6 +178,9 @@ public: QQmlComponent *effect() const { return m_effectComponent; } void setEffect(QQmlComponent *effect); + QQuickShaderEffectSource::TextureMirroring textureMirroring() const { return m_textureMirroring; } + void setTextureMirroring(QQuickShaderEffectSource::TextureMirroring mirroring); + QQuickShaderEffectSource *effectSource() const { return m_effectSource; } void itemGeometryChanged(QQuickItem *, const QRectF &, const QRectF &) Q_DECL_OVERRIDE; @@ -200,6 +204,7 @@ Q_SIGNALS: void smoothChanged(bool smooth); void formatChanged(QQuickShaderEffectSource::Format format); void sourceRectChanged(const QRectF &sourceRect); + void textureMirroringChanged(QQuickShaderEffectSource::TextureMirroring mirroring); private: friend class QQuickTransformAnimatorJob; @@ -223,6 +228,7 @@ private: QQmlComponent *m_effectComponent; QQuickItem *m_effect; QQuickShaderEffectSource *m_effectSource; + QQuickShaderEffectSource::TextureMirroring m_textureMirroring; }; class Q_QUICK_PRIVATE_EXPORT QQuickItemPrivate : public QObjectPrivate |