aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/imagine/impl/OpacityMask.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/imagine/impl/OpacityMask.qml')
-rw-r--r--src/quickcontrols/imagine/impl/OpacityMask.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/quickcontrols/imagine/impl/OpacityMask.qml b/src/quickcontrols/imagine/impl/OpacityMask.qml
new file mode 100644
index 0000000000..3e78c15865
--- /dev/null
+++ b/src/quickcontrols/imagine/impl/OpacityMask.qml
@@ -0,0 +1,35 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+
+/*
+ A cross-graphics API implementation of QtGraphicalEffects' OpacityMask.
+ */
+Item {
+ id: rootItem
+
+ property variant source
+ property variant maskSource
+ property bool cached: false
+
+ ShaderEffectSource {
+ id: cacheItem
+ anchors.fill: parent
+ visible: rootItem.cached
+ smooth: true
+ sourceItem: shaderItem
+ live: true
+ hideSource: visible
+ }
+
+ ShaderEffect {
+ id: shaderItem
+ property variant source: rootItem.source
+ property variant maskSource: rootItem.maskSource
+
+ anchors.fill: parent
+
+ fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls/Imagine/impl/shaders/OpacityMask.frag.qsb"
+ }
+}