Added partial support for dirty rectangles