Avoid repainting the entire canvas element when possible.
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Jan 2008 13:09:12 +0000 (13:09 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Jan 2008 13:09:12 +0000 (13:09 +0000)
commit648dbe6335b1657ac5a0f49203f89e83b0abc2d3
treed101f37670f0e7ca24a82173c0ff71512ab5033b
parent3caa773ab8727ea5a5773a8c39d6cabe8bd9ce65
Avoid repainting the entire canvas element when possible.

Reviewed by Mark Rowe.

We now only register the dirty regions of a canvas for repainting, rather
than the entire element (though repaint coalescing may choose to combine
these regions).  This doesn't cause a measurable regression in the worst
case (clearing the canvas repeatedly), but is a moderate-large win if only
a minor update has occurred.  If there is any CSS scaling applied to the
canvas almost any update short of clearing the entire element is substantially
faster.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/html/CanvasRenderingContext2D.cpp
WebCore/html/HTMLCanvasElement.cpp