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.
Created attachment 231511 [details] WIP
Created attachment 231513 [details] Patch
Created attachment 231514 [details] Patch with fixed typo
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
Created attachment 231520 [details] Patch for landing
Created attachment 231521 [details] Patch for landing v2
Comment on attachment 231521 [details] Patch for landing v2 Clearing flags on attachment: 231521 Committed r168899: <http://trac.webkit.org/changeset/168899>
All reviewed patches have been landed. Closing bug.
Re-opened since this is blocked by bug 132965
Created attachment 231569 [details] Patch v2
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 on attachment 231569 [details] Patch v2 Clearing flags on attachment: 231569 Committed r168967: <http://trac.webkit.org/changeset/168967>