forked from joejulian/gio
759b796283
Using Window.Invalidate for animation with, say var w Window var e FrameEvent w.Invalidate() e.Frame(...) stops and immediately starts animation mode which is inefficient and may cause jitter in the redraw timing. InvalidateOp is the efficient and sure way to achieve smooth animation, and Invalidate only exists for external events where there is nowhere to add an InvalidateOp. We can do better, so this change makes Invalidate almost as efficient as InvalidateOp by checking for Invalidates at the same time we check for InvalidateOps. Note that we can't avoid the inefficiency in all cases, for example when the calls above are swapped, e.Frame(...) w.Invalidate() the Invalidate may not be registered before the check during Frame. While here, add a note to Invalidate that it's meant for externally triggered redraws. Signed-off-by: Elias Naur <mail@eliasnaur.com>