Compositor: add back in various optimizations

A number of additional GDI+ optimizations are included with this commit,
and some bug-fixes as well.