Bug 88386 - shouldSuppressPaintingLayer shouldn't be called on every RenderLayers
Summary: shouldSuppressPaintingLayer shouldn't be called on every RenderLayers
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Julien Chaffraix
URL:
Keywords:
Depends on:
Blocks: 75001
  Show dependency treegraph
 
Reported: 2012-06-05 18:40 PDT by Julien Chaffraix
Modified: 2012-06-06 10:46 PDT (History)
4 users (show)

See Also:


Attachments
Proposed change v1. (6.58 KB, patch)
2012-06-05 19:41 PDT, Julien Chaffraix
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 Julien Chaffraix 2012-06-05 18:40:49 PDT
After doing some archeology (see r16129), the code is used to avoid FOUCs by preventing paints to propagate to child RenderLayers (meaning that there will be a flash to white instead). It was later extended to allow for paints suppression. All the conditions that the function checks are tied to the document - the exception being that it checks for child layer - which means that instead of having a fixed cost per paint phase, it's a cost per RenderLayer::paintLayer. On http://dglazkov.github.com/performance-tests/biggrid.html, this is an ~8 - 10% cost as we need to do a lot of paintLayer calls.

At the time the function was introduced, it's unclear if the painting went through a single point as it does now but we can easily move the code to the FrameView now.

Patch forthcoming.
Comment 1 Julien Chaffraix 2012-06-05 19:41:47 PDT
Created attachment 145917 [details]
Proposed change v1.
Comment 2 Simon Fraser (smfr) 2012-06-05 20:29:13 PDT
Comment on attachment 145917 [details]
Proposed change v1.

What happens when there are compositing layers, which can enter painting on a non-root RenderLayer? Or do we never have compositing layers this early on?
Comment 3 Simon Fraser (smfr) 2012-06-06 08:23:54 PDT
Comment on attachment 145917 [details]
Proposed change v1.

r- until we resolve the compositing issue.
Comment 4 Julien Chaffraix 2012-06-06 09:21:43 PDT
(In reply to comment #2)
> (From update of attachment 145917 [details])
> What happens when there are compositing layers, which can enter painting on a non-root RenderLayer? Or do we never have compositing layers this early on?

The compositing code is bypassing the checks for the owning layer already as RenderLayerBacking::paintContents calls directly RenderLayer::paintLayerContents. However you would not paint the descendant layers as you would need to go through RenderLayer::paintLayer.

I don't think anything prevents us from having compositing layers during a potential FOUC so the logic needs to be changed.
Comment 5 Julien Chaffraix 2012-06-06 10:46:55 PDT
Mhh, it also looks like the new logic wouldn't repaint the RenderView or the document's element which means we wouldn't paint the background and do a "flash to white" like the old code. It doesn't sound like a good idea to change that.