Invalidation/Redraw of an ImageItem object

ET++ uses the Invalidation/Redraw Pattern to optimize and minimize redraws. Instead of redrawing parts of a window at the moment the part becomes invalid, ET++ collects a series of invalid areas in a geometric union of rectangles, and redraws the entire set regularly. This helps eliminate drawing in cases where the area will soon be redrawn, and tends to be considerably faster than the naive approach.

To illustrate the Invalidation/Redraw mechanism of ET++, we will examine the specific example of an ImageItem object (a VObject representing a bitmap) which needs to redraw itself, perhaps because its underlying bitmap picture has changed.

Phase 1: Invalidating the ImageItem rectangle

  1. VObject::ForceRedraw()
  2. VObject::InvalidateRect()
  3. Window::InvalidateRect()
  4. WindowPort::InvalidateRect()
Note that no drawing has yet occurred. The drawing occurs in the second phase:

Phase 2: Redrawing the invalid area

  1. XWinSystem::Notify()
  2. WindowSystem::Update()
  3. WindowPort::DevUpdate()
  4. WindowPort::UpdateRect()
  5. VObject::DrawAll()
  6. VObject::DrawInner()
  7. ImageItem::Draw()
I also have a partial inheritance hierarchy.

Suggestions to ferrar@uiuc.edu.