Added dirty rectangles and Bounding rect calculation