If a graphics reset happens during compositing startup it is possible
that the next try to start compositing will run into the same graphics
reset. In that case KWin would be in an endless restart compositor loop.
This change makes use of the frames to test for safety. If a graphics
reset happens while there are still frames to test we consider the
OpenGL context broken and don't re-enable compositing.
It is not clear whether the number of frames to test is sufficient. In
the bug report we have for the problem, it seems to be during effect
loading. After each loaded effect a frame could be rendered, so maybe
the three frames to test by default are not sufficient.
In master we should also show a notification why compositing got
disabled.
CCBUG: 372145