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/qquickshadereffectsource_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/qquickshadereffectsource_p.h')
-rw-r--r-- | src/quick/items/qquickshadereffectsource_p.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index 94bb315566..629acf0f55 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -66,6 +66,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickShaderEffectSource : public QQuickItem, publi Q_PROPERTY(bool hideSource READ hideSource WRITE setHideSource NOTIFY hideSourceChanged) Q_PROPERTY(bool mipmap READ mipmap WRITE setMipmap NOTIFY mipmapChanged) Q_PROPERTY(bool recursive READ recursive WRITE setRecursive NOTIFY recursiveChanged) + Q_PROPERTY(TextureMirroring textureMirroring READ textureMirroring WRITE setTextureMirroring NOTIFY textureMirroringChanged REVISION 1) public: enum WrapMode { @@ -83,6 +84,13 @@ public: }; Q_ENUM(Format) + enum TextureMirroring { + NoMirroring = 0x00, + MirrorHorizontally = 0x01, + MirrorVertically = 0x02 + }; + Q_ENUM(TextureMirroring) + QQuickShaderEffectSource(QQuickItem *parent = 0); ~QQuickShaderEffectSource(); @@ -113,6 +121,9 @@ public: bool recursive() const; void setRecursive(bool enabled); + TextureMirroring textureMirroring() const; + void setTextureMirroring(TextureMirroring mirroring); + bool isTextureProvider() const Q_DECL_OVERRIDE { return true; } QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; @@ -128,6 +139,7 @@ Q_SIGNALS: void hideSourceChanged(); void mipmapChanged(); void recursiveChanged(); + void textureMirroringChanged(); void scheduledUpdateCompleted(); @@ -157,6 +169,7 @@ private: uint m_mipmap : 1; uint m_recursive : 1; uint m_grab : 1; + uint m_textureMirroring : 2; // Stores TextureMirroring enum }; QT_END_NAMESPACE |