Lite update box versus lite draw box

From DirectFBWiki


LiTE's basic graphics enclosure is a so called LiteBox. All primitive widgets such as LiteButton, LiteSlider up to even a LiteWindow really has a LiteBox that is mapped to a sub-surface of the main surface.

There are two APIs to update this sub-surface, or LiteBox after the contents have changed, lite_update_box() and lite_draw_box().

lite_update_box() will set a dirty flag for the specific box (note that even the LiteWindow is underneath a LiteBox), and during the event loop this flag is checked for each time the event loop goes through an iteration. If there are any dirty boxes that needs to be redrawn, then this will happen here.

lite_draw_box() will call the drawing functions directly, without the need to wait for the event loop to process a dirty flag. This operation is used to show results on the screen immediately, for example if you have a time critical update.

Depending on the need and performance, sometimes lite_draw_box() is too expensive, sometimes lite_update_box() is too asynchronous. But in most cases it makes sense using lite_update_box() to merge multiple updates in the queue and do just one single update where different updates overlap.