merge dirty rects if possible