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
Родитель b37485e0fc
Коммит 4c6fea1353
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -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());