It's pretty trivial, at least not any sort of GUI-specific hard problem. There is only a low number of objects on any given screen. Don't raster pixel-by-pixel on the CPU, of course.
For anything above that, it can hairy real fast.
For anything above that, it can hairy real fast.