Display Maintenance


By: D. Towell
Published in: PLoPD4
Pages: 489-502
Category: GUI Development

Summary: Patterns for designing display architecture.

Pattern: Display List

Pages: 491-492

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.

Pattern: Request Update

Pages: 492-493

Visual components may be occluded by others in a GUI, complicating display updates. Request display update rather than redraw directly.

Pattern: Global Update

Pages: 493-494

You would use Request Update, but tracking many update requests slows the display. Instead of tracking individual update requests, update the entire display.

Pattern: Painter's Algorithm

Pages: 494-496

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.

Pattern: Consolidate Requests

Pages: 496-497

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

Pattern: Lazy Redraw

Pages: 497-498

Consecutive, similar redraws of a GUI may hinder interaction. Postpone redraws until time allows.

Pattern: Clip Requests

Pages: 498-499

Updating hidden regions of a GUI is unnecessary and inefficient. Exclude opaque foreground regions from update requests.

Pattern: Double Buffer

Pages: 500-501

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.

Pattern: Page Flip

Pages: 501

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.