Condense damage list by merging overlapping dirty rectangles

thanks, Craxic, for suggesting the idea for this optimization in #192 !