Fix for T53599: OpenGL render with transparent background
I had to make Eevee draw its scene in the scene pass (before it was doing it in the background pass). This is not ideal since reference images require a separation between scene and background.
But it's the best way to solve it now. Clay is working fine.
For some reason, when press play there is a delay in the animation flag check and this produces errors. To be sure, we set cache as dirty because the frame is changing.
If the color fill opacity is equal to 1.0, it's very hard to see the strokes that you want to fill. With this change, always the stroke is visible while painting.
The problem was if the layer below had animation in frames not present in top layer. As the active frame of top layer was the previous keyframe, after merging, the draw of bottom layer replaced the draw of top layer and the result was that some drawings were missing.
The solution was to duplicate the active frame in top layer before merge the bottom layer.