Bug 16859 - Canvas repaints too much
Summary: Canvas repaints too much
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-13 01:00 PST by Oliver Hunt
Modified: 2008-01-13 05:24 PST (History)
2 users (show)

See Also:


Attachments
Very very preliminary patch (1.47 KB, patch)
2008-01-13 01:03 PST, Oliver Hunt
no flags Details | Formatted Diff | Diff
Real patch (3.38 KB, patch)
2008-01-13 04:12 PST, Oliver Hunt
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2008-01-13 01:00:28 PST
whenever the graphics context of a canvas is updated, it marks the entire element as needing an update, regardless of actual need.
Comment 1 Oliver Hunt 2008-01-13 01:03:23 PST
Created attachment 18418 [details]
Very very preliminary patch

This is just a proof of triviality patch, it works correctly afaict, however someone else may want to test.

Here are the problems:
 * i don't have a machine that is slow enough for a full canvas repaint to be more significant than the 10ms minimum timer interval
 * This is a hack job, and needs to be tidied up and made cross platform (currently it blindly assumes CG is present).
Comment 2 Oliver Hunt 2008-01-13 02:47:14 PST
Okay further investigation has shown a gain when the canvas is very large (eg. 1000x1000), but also when scaled in css, eg.
<canvas width="1000" height="1000" style="width:500px; height: 500px" ></canvas>

there is a substantial benefit *provided* the painting is spread out suffuciently or over a compact enough region to prevent repaint rect coalescing from effectively repainting the entire canvas 

 
Comment 3 Oliver Hunt 2008-01-13 04:12:24 PST
Created attachment 18421 [details]
Real patch

Here we go, fresh off the compiler
Comment 4 Oliver Hunt 2008-01-13 05:22:43 PST
Comment on attachment 18421 [details]
Real patch

REviewed with comments by mark

Landed 29448