The old scheme of work - when the state changes (hot/unhot, pressed/checked and so on), next was call set_needs_layout();, which led to a recalculation of all sizes and call Invalidate for the whole window at the end.
The new scheme of work - when the state changes there is redrawn once - set clip_rect, render parent for update the background under the changed item, then draw the element itself and its children.
The changes made suitable use of UI controls in the applications running on the clan :: Application :: update(), because now they do not cause repeated redrawing the entire window.
Before making changes on a laptop with a built-in videocard, the window with multiple controls (ButtonView, CheckBoxView, LabelView) at rest FPS was about 800. After start move the mouse through all the controls, FPS sink 100 times - less than 10 frames per second. After making changes there no visible reduction the FPS.
set_needs_layout();
, which led to a recalculation of all sizes and callInvalidate
for the whole window at the end.clip_rect
, render parent for update the background under the changed item, then draw the element itself and its children.The changes made suitable use of UI controls in the applications running on the
clan :: Application :: update()
, because now they do not cause repeated redrawing the entire window.Before making changes on a laptop with a built-in videocard, the window with multiple controls (
ButtonView
,CheckBoxView
,LabelView
) at rest FPS was about 800. After start move the mouse through all the controls, FPS sink 100 times - less than 10 frames per second. After making changes there no visible reduction the FPS.Also small changes in the examples are done.