Fix high CPU load in grid customizer (GH9060)#9066
Fix high CPU load in grid customizer (GH9060)#9066neilcsmith-net merged 1 commit intoapache:masterfrom
Conversation
Ensure the animation layer paint is called at least once inside paintComponent so that the animation timer is shut down.
mbien
left a comment
There was a problem hiding this comment.
should work I think. I was a little worried about all those if (phase == 1f) checks but it should be 1f still.
|
Yes, there is much that is questionable in that animation layer, but I didn't want to do a lot of refactoring. The phase seems to always be set by a constant. Considered changing to |
|
i think its fine to be merged as is since the rendering code in The only place which resets the phase to 0 is the if block above your change. |
|
Thanks, same analysis as me. OK, merging. |
Ensure the animation layer paint is called at least once inside paintComponent so that the animation timer is shut down.
This is a minimal fix for #9060. If a change is made that triggers no change in bounds, then
animationwas set tofalse. However, if an existing animation was active at that time, the animation layer timer isn't stopped becauseanimLayer.paint(..)isn't called during repaint. This causes a doom loop of repaint requests with excessive CPU usage.This whole animation layer code is a little suspect - ideally it would exit cleanly during the timer listener - but it doesn't seem worth doing a full refactor for a little used feature.
Fixes #9060