Bug 45792

Summary: Drawing an image outside the bounds of a canvas still causes repaints
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.phoboslab.org/biolab/
Attachments:
Description Flags
Patch oliver: review+

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+
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
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
Note You need to log in before you can comment on or make changes to this bug.