diff options
author | Marko Niemelä <marko.a.niemela@nokia.com> | 2012-01-16 13:48:23 +0200 |
---|---|---|
committer | Marko Niemelä <marko.a.niemela@nokia.com> | 2012-01-16 13:48:23 +0200 |
commit | 8e68fea33a7881bd3da511d353a2d83942a43b44 (patch) | |
tree | 8f87bb76590d08377ed3564052ef7016be8536fc /src | |
parent | 3657d0ab5ff2914b3d62afdec28663019eec6274 (diff) |
DropShadow and Glow effect changed to draw also original pixels
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/DropShadow.qml | 43 | ||||
-rw-r--r-- | src/effects/Glow.qml | 5 |
2 files changed, 39 insertions, 9 deletions
diff --git a/src/effects/DropShadow.qml b/src/effects/DropShadow.qml index a88b3c2..5f2a43e 100644 --- a/src/effects/DropShadow.qml +++ b/src/effects/DropShadow.qml @@ -54,18 +54,43 @@ Item { property bool cached: false property bool transparentBorder: false - Glow { + Loader { x: rootItem.horizontalOffset y: rootItem.verticalOffset width: parent.width height: parent.height - source: rootItem.source - radius: rootItem.radius - samples: rootItem.samples - color: rootItem.color - cached: rootItem.cached - spread: rootItem.spread - transparentBorder: rootItem.transparentBorder - fast: rootItem.fast + sourceComponent: rootItem.fast ? fastGlow : gaussianGlow + } + + Component { + id: gaussianGlow + GaussianGlow { + anchors.fill: parent + source: rootItem.source + radius: rootItem.radius + maximumRadius: rootItem.samples * 0.5 + color: rootItem.color + cached: rootItem.cached + spread: rootItem.spread + transparentBorder: rootItem.transparentBorder + } + } + + Component { + id: fastGlow + FastGlow { + anchors.fill: parent + source: rootItem.source + blur: Math.pow(rootItem.radius / 64.0, 0.4) + color: rootItem.color + cached: rootItem.cached + spread: rootItem.spread + transparentBorder: rootItem.transparentBorder + } + } + + ShaderEffectSource { + anchors.fill: parent + sourceItem: rootItem.source } } diff --git a/src/effects/Glow.qml b/src/effects/Glow.qml index d5a9df1..8c65142 100644 --- a/src/effects/Glow.qml +++ b/src/effects/Glow.qml @@ -83,4 +83,9 @@ Item { transparentBorder: rootItem.transparentBorder } } + + ShaderEffectSource { + anchors.fill: parent + sourceItem: rootItem.source + } } |