Hi,

I found some interesting code online about recursive shaders. It was not to difficult to build a mobile app with it but my app is not getting approved. The issue is that it is not going to sleep when the phone is.
To send it to sleep I tried to build in an active property and binding the shader to it but that does not help.

Qt Code:
  1. ShaderEffect {
  2. id: inputItem
  3. property variant source: ShaderEffectSource { sourceItem: sourceArea; smooth: false }
  4. property variant recursiveSource: recursiveSource
  5. property real ledWidthPercent: ledScreen.ledWidth/ledScreen.width
  6. anchors.fill: sourceArea
  7. visible: false
  8. enabled: root.active
  9.  
  10. fragmentShader: "
  11. varying mediump vec2 qt_TexCoord0;
  12. uniform highp float qt_Opacity;
  13. uniform highp float ledWidthPercent;
  14. uniform lowp sampler2D source;
  15. uniform lowp sampler2D recursiveSource;
  16. void main() {
  17. highp vec4 pix;
  18. if (qt_TexCoord0.x > (1.0 - ledWidthPercent)) {
  19. pix = texture2D(source, qt_TexCoord0);
  20. } else {
  21. highp vec2 pos = vec2(qt_TexCoord0.x+ledWidthPercent, qt_TexCoord0.y);
  22. pix = texture2D(recursiveSource, pos) * (1.0-ledWidthPercent*2.0);
  23. }
  24. gl_FragColor = pix * qt_Opacity;
  25. }
  26. "
  27. }
  28.  
  29. ShaderEffectSource {
  30. id: recursiveSource
  31. sourceItem: inputItem
  32. hideSource: true
  33. visible: false
  34. live: root.updateFrequency == 1//false
  35. recursive: true
  36. smooth: false
  37. enabled: root.active
  38. }
To copy to clipboard, switch view to plain text mode 

Can someone help me to understand how this code works and how I can pause it?

Thanks