Bug 133335

Summary: REGRESSION (Margin tiles): Background gradient on dom.spec.whatwg.org is very slow to render
Product: WebKit Reporter: Tim Horton <thorton>
Component: Layout and RenderingAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: koivisto, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://dom.spec.whatwg.org
Attachments:
Description Flags
patch simon.fraser: review+

Description Tim Horton 2014-05-27 21:01:23 PDT
<rdar://problem/17011392>
Comment 1 Tim Horton 2014-05-27 21:10:52 PDT
Here's the story:

1. Margin tiles mean that we use drawPattern() instead of draw() for the background gradient, because it gets tiled into the margin.

2. drawPattern() paints into an ImageBuffer and uses that to do the pattern tiling.

There was already code in Image::drawTiled to avoid proper ImageBuffer-backed patterned drawing and instead repeatedly call draw() in the case where the tile buffer would be very large, but it was only enabled on iOS. It seems like a pretty reasonable thing to do everywhere, so let's do that (but with a bigger limit than on iOS).
Comment 2 Tim Horton 2014-05-27 21:13:32 PDT
3. The ImageBuffer is the size of the gradient. The gradient on this page is the size of the document. A bitmap the size of the document is nearly 2GB here.
Comment 3 Tim Horton 2014-05-27 21:37:44 PDT
Created attachment 232167 [details]
patch
Comment 4 Tim Horton 2014-05-27 21:50:47 PDT
http://trac.webkit.org/changeset/169412