Bug 132121

Summary: [CSS Regions] Reduce the RenderRegion invasiveness in rendering code
Product: WebKit Reporter: Andrei Bucur <abucur>
Component: WebKit Misc.Assignee: Andrei Bucur <abucur>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, d-r, eric.carlson, esprehn+autocc, fmalita, glenn, gyuyoung.kim, jer.noble, kondapallykalyan, pdr, philipj, schenney, sergio, simon.fraser, WebkitBugTracker
Priority: P2 Keywords: AdobeTracked
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 132965    
Bug Blocks: 128243    
Attachments:
Description Flags
WIP
none
Patch
none
Patch with fixed typo
koivisto: review+
Patch for landing
abucur: commit-queue-
Patch for landing v2
none
Patch v2 none

Description Andrei Bucur 2014-04-24 02:56:29 PDT
During the layout of the flow threads, they are cached to prevent slow tree walks. We can apply the same technique at paint time as well.
Comment 1 Andrei Bucur 2014-05-15 07:17:31 PDT
Created attachment 231511 [details]
WIP
Comment 2 Andrei Bucur 2014-05-15 08:01:26 PDT
Created attachment 231513 [details]
Patch
Comment 3 Andrei Bucur 2014-05-15 08:03:10 PDT
Created attachment 231514 [details]
Patch with fixed typo
Comment 4 Antti Koivisto 2014-05-15 08:10:56 PDT
Comment on attachment 231514 [details]
Patch with fixed typo

View in context: https://bugs.webkit.org/attachment.cgi?id=231514&action=review

r=me

> Source/WebCore/rendering/RenderLayer.cpp:4475
> +        PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, 0, 0, &localPaintingInfo.rootLayer->renderer());

You could also turn 0's into nullptrs here and various other places since you are touching them.

> Source/WebCore/rendering/RenderLayer.h:713
> +    bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = 0, const LayoutRect* cachedBoundingBox = 0) const;

nullptr

> Source/WebCore/rendering/RenderLayer.h:963
> +        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)

nullptr
Comment 5 Andrei Bucur 2014-05-15 09:03:17 PDT
Created attachment 231520 [details]
Patch for landing
Comment 6 Andrei Bucur 2014-05-15 09:05:22 PDT
Created attachment 231521 [details]
Patch for landing v2
Comment 7 WebKit Commit Bot 2014-05-15 09:43:37 PDT
Comment on attachment 231521 [details]
Patch for landing v2

Clearing flags on attachment: 231521

Committed r168899: <http://trac.webkit.org/changeset/168899>
Comment 8 WebKit Commit Bot 2014-05-15 09:43:43 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 WebKit Commit Bot 2014-05-15 12:11:32 PDT
Re-opened since this is blocked by bug 132965
Comment 10 Andrei Bucur 2014-05-16 05:35:32 PDT
Created attachment 231569 [details]
Patch v2
Comment 11 Andrei Bucur 2014-05-16 05:43:04 PDT
Comment on attachment 231569 [details]
Patch v2

The difference between this patch and the one previously landed is the commented ASSERT inside RenderObject::currentRenderNamedFlowFragment().

Because compositing is not yet fully integrated with regions there are calls to the function during layout (so the current flow thread is set) to determine the ancestor clipping rectangle of a layer. There's a FIXME in RenderLayerCompositor that the code doesn't work with regions because we don't know the containing region at that point. Once we fix that we can re-enable the assert.
Comment 12 WebKit Commit Bot 2014-05-16 06:22:30 PDT
Comment on attachment 231569 [details]
Patch v2

Clearing flags on attachment: 231569

Committed r168967: <http://trac.webkit.org/changeset/168967>
Comment 13 WebKit Commit Bot 2014-05-16 06:22:37 PDT
All reviewed patches have been landed.  Closing bug.