Bug 133335 - REGRESSION (Margin tiles): Background gradient on dom.spec.whatwg.org is very slow to render
Summary: REGRESSION (Margin tiles): Background gradient on dom.spec.whatwg.org is very...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL: http://dom.spec.whatwg.org
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-27 21:01 PDT by Tim Horton
Modified: 2014-05-27 21:50 PDT (History)
2 users (show)

See Also:


Attachments
patch (4.24 KB, patch)
2014-05-27 21:37 PDT, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff

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