diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-10-24 14:10:03 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-10-24 16:09:03 +0200 |
commit | 3c4c7ac6069a57b17199627742d8e2b32a3a31c9 (patch) | |
tree | 4b0f849ab070569916f073349d7b792276ac2000 | |
parent | 3cac429c9bf0bc43f281aa12cb121bece608cb37 (diff) | |
download | qtgraphicaleffects-3c4c7ac6069a57b17199627742d8e2b32a3a31c9.tar.gz |
Fix interpolation of effects
6f02d6fc made relevant effects respect the smooth property of the layer,
but made a few mistakes in the interpolation binding:
- It got the order of the ternary operator branches wrong: Nearest was
used when smooth was true, when it should have been Linear.
- It uses the smooth property of the layer, which is automatically set
by QGfxSourceProxy::updatePolish() as a result of setting its
interpolation.
- It also used the smooth property of the rootItem, which is the
overlay itself, and not the source item. It would make more sense to
base it on the smooth property of the source item, since all
Item-derived types have this.
Somehow (and luckily) this didn't result in any visible issues.
Task-number: QTBUG-67382
Change-Id: I264579505b4195f5d19e1869e7e579d75bf97d5d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r-- | src/effects/BrightnessContrast.qml | 3 | ||||
-rw-r--r-- | src/effects/ColorOverlay.qml | 3 | ||||
-rw-r--r-- | src/effects/Colorize.qml | 3 | ||||
-rw-r--r-- | src/effects/Desaturate.qml | 3 | ||||
-rw-r--r-- | src/effects/GammaAdjust.qml | 3 | ||||
-rw-r--r-- | src/effects/HueSaturation.qml | 3 | ||||
-rw-r--r-- | src/effects/LevelAdjust.qml | 3 |
7 files changed, 7 insertions, 14 deletions
diff --git a/src/effects/BrightnessContrast.qml b/src/effects/BrightnessContrast.qml index a95872c..85b38bb 100644 --- a/src/effects/BrightnessContrast.qml +++ b/src/effects/BrightnessContrast.qml @@ -167,8 +167,7 @@ Item { SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { diff --git a/src/effects/ColorOverlay.qml b/src/effects/ColorOverlay.qml index b2cdaa0..f348541 100644 --- a/src/effects/ColorOverlay.qml +++ b/src/effects/ColorOverlay.qml @@ -123,8 +123,7 @@ Item { SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { diff --git a/src/effects/Colorize.qml b/src/effects/Colorize.qml index 501111f..42f1796 100644 --- a/src/effects/Colorize.qml +++ b/src/effects/Colorize.qml @@ -210,8 +210,7 @@ Item { SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { diff --git a/src/effects/Desaturate.qml b/src/effects/Desaturate.qml index 3347e2f..e56de55 100644 --- a/src/effects/Desaturate.qml +++ b/src/effects/Desaturate.qml @@ -122,8 +122,7 @@ Item { SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { diff --git a/src/effects/GammaAdjust.qml b/src/effects/GammaAdjust.qml index e4e39e5..2c3edbb 100644 --- a/src/effects/GammaAdjust.qml +++ b/src/effects/GammaAdjust.qml @@ -159,8 +159,7 @@ luminance = pow(original_luminance, 1.0 / gamma); // The luminance is assumed to SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { diff --git a/src/effects/HueSaturation.qml b/src/effects/HueSaturation.qml index 526f474..eb13dcb 100644 --- a/src/effects/HueSaturation.qml +++ b/src/effects/HueSaturation.qml @@ -199,8 +199,7 @@ Item { SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { diff --git a/src/effects/LevelAdjust.qml b/src/effects/LevelAdjust.qml index 004c798..b98faca 100644 --- a/src/effects/LevelAdjust.qml +++ b/src/effects/LevelAdjust.qml @@ -408,8 +408,7 @@ Item { SourceProxy { id: sourceProxy input: rootItem.source - interpolation: rootItem.smooth || (rootItem.layer.enabled && rootItem.layer.smooth) - ? SourceProxy.NearestInterpolation : SourceProxy.LinearInterpolation + interpolation: input && input.smooth ? SourceProxy.LinearInterpolation : SourceProxy.NearestInterpolation } ShaderEffectSource { |