Erase dirty rectangles before creating a clipping region

Some Android phones do not allow CanvasRenderingContext2D.clearRect() to erase only the inside of a clipping region. This change calls the function for each dirty rectangle to work around this issue.