implementing: calculating dirty rects on server side