Document ImageEffectFilter::applyEffect should not write to buffer

It would be nice if this documentation warned more clearly that the image buffer passed into applyEffect() should not be written to. Spent some hours this evening debugging very intermittent poor rendering due to my being unaware of this restriction.

https://docs.juce.com/master/classjuce_1_1ImageEffectFilter.html

The idea is that you can write to it but that does not automatically mean that is what is shown to screen. For example to apply a blur you would first blur the image and then draw the image to the graphics context.

OK I was writing to it and then drawing to the graphics context as you describe. Under highly intermittent circumstances (I hadn’t seen it in about 3 months since initial implementation) I experienced tearing and mixed content on a grid. I reviewed the bundled effects and saw that none of them write directly to the passed in buffer. So now I am making a copy and writing to that. The problems went away when I made this change.

How it should look:

With the visual corruption described:

Is it possible you’ve called setOpaque() on the component that has the effect applied? and if so are you definitely filling the entire background in paint()?

No, I have two component effects which are applied to components that are layered on top of each other. Neither has setOpaque() called. Only the background graphics layer, which is a separate component with no children, has setOpaque(), and it has no effects applied.

Of the two components with effects applied, one has the background entirely filled and one does not. I have assumed as you indicate, which is that this is not an issue.