Bug 730508. Clip canvas invalidations to the content area of the canvas. r=roc

Previously, operations like drawImage() could invalidate areas outside of the
canvas. This hurt performance of runfield on maple.
This commit is contained in:
Jeff Muizelaar 2012-02-27 01:05:10 -05:00
parent b37485e0fc
commit 4c6fea1353

View File

@ -709,6 +709,8 @@ nsHTMLCanvasElement::InvalidateCanvasContent(const gfxRect* damageRect)
// then make it a nsRect
invalRect = nsRect(realRect.X(), realRect.Y(),
realRect.Width(), realRect.Height());
invalRect = invalRect.Intersect(nsRect(nsPoint(0,0), contentArea.Size()));
}
} else {
invalRect = nsRect(nsPoint(0, 0), contentArea.Size());