WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
45792
Drawing an image outside the bounds of a canvas still causes repaints
https://bugs.webkit.org/show_bug.cgi?id=45792
Summary
Drawing an image outside the bounds of a canvas still causes repaints
Simon Fraser (smfr)
Reported
2010-09-14 17:34:31 PDT
http://www.phoboslab.org/biolab/
seems to draw all the tiles in the game on every frame, even ones that are far outside the bounds of the canvas. Stupidly, we still turn these into repaints.
Attachments
Patch
(1.89 KB, patch)
2010-09-14 18:38 PDT
,
Simon Fraser (smfr)
oliver
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2010-09-14 18:11:13 PDT
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp index 3838f14..6f46ab4 100644 --- a/WebCore/html/HTMLCanvasElement.cpp +++ b/WebCore/html/HTMLCanvasElement.cpp @@ -193,7 +193,7 @@ void HTMLCanvasElement::didDraw(const FloatRect& rect) FloatRect destRect = ro->contentBoxRect(); FloatRect r = mapRect(rect, FloatRect(0, 0, size().width(), size().height()), destRect); r.intersect(destRect); - if (m_dirtyRect.contains(r)) + if (r.isEmpty() || m_dirtyRect.contains(r)) return; m_dirtyRect.unite(r); I'll make some tests.
Simon Fraser (smfr)
Comment 2
2010-09-14 18:38:38 PDT
Created
attachment 67630
[details]
Patch
Oliver Hunt
Comment 3
2010-09-14 18:46:07 PDT
Comment on
attachment 67630
[details]
Patch r=me
Simon Fraser (smfr)
Comment 4
2010-09-14 18:55:29 PDT
http://trac.webkit.org/changeset/67526
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug