By: D. Towell
Published in: PLoPD4
Category: GUI Development
Summary: Patterns for designing display architecture.
Visible component occlusion is important to the GUI, but components shouldn't have this responsibility. Maintain a list of all visual components and let the order dictate occlusion.
Visual components may be occluded by others in a GUI, complicating display updates. Request display update rather than redraw directly.
You would use Request Update, but tracking many update requests slows the display. Instead of tracking individual update requests, update the entire display.
Rendering a single visual component in a GUI with correct occlusion requires significant interobject knowledge of boundaries. Draw all components without regard to occlusion, back to front, so each visual object will replace any part of the image behind it. The display must be rewritable. This will exact a heavy penalty in display cost.
Processing individual update requests from user events can be disruptive and inefficient. Consolidate update requests generated by a single user event. If transition times are lengthy, this pattern can give the impression the system has failed to respond.
Category: Event-Driven Systems, GUI Development
Consecutive, similar redraws of a GUI may hinder interaction. Postpone redraws until time allows.
Updating hidden regions of a GUI is unnecessary and inefficient. Exclude opaque foreground regions from update requests.
Updating components directly to the display causes display flicker. Render visible components to a hidden display, then use a single operation to update the visible display.
You're using Global Update. You would use Double Buffer, but it's inefficient. Swap the active display buffer. Rendering will alternate between the two buffers. While one is visible, the other can be redrawn.