Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 2404213004: Implement incremental paint property tree rebuilding (Closed)

Created:
4 years, 2 months ago by pdr.
Modified:
4 years, 1 month ago
Reviewers:
chrishtr, Xianzhu
CC:
blink-reviews, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, chromium-reviews, dshwang, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement incremental paint property tree rebuilding This patch implements incremental paint property tree rebuilding based on an invalidation scheme similar to paint invalidation. When property- affecting values change we set FrameView/LayoutObject as needing a property tree update. At the moment all property node updates force the entire property subtree to be rebuilt, but TODOs have been added to add more granular updates. When no property invalidation occurs we still need to walk the property trees update the builder context, but we can re-use existing nodes instead of reconstructing them. An underinvalidation checking mechanism has been added for debug builds to catch cases where we miss a call to set an object as needing a property tree update. DO NOT COMMIT. This will be broken up into smaller patches. BUG=645667 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Create DCHECK pattern for underinvalidation checking of FrameView properties #

Patch Set 4 : Add basic underinvalidation checking for LayoutObject, begin incrementally building transform nodes #

Patch Set 5 : Cleanup names and comments #

Patch Set 6 : Rebase across rename patches #

Patch Set 7 : Begin incrementally building effect nodes #

Patch Set 8 : Add support for css clip #

Patch Set 9 : Complete underinvalidation implementation, skip property building when possible #

Patch Set 10 : Move underinvalidation behind debug flags, refactor early-out property building #

Patch Set 11 : Fix bug in how svg local to border box was updated, no longer crash in tests #

Total comments: 17

Patch Set 12 : Switch to better dirty bit naming (needsPaintPropertyUpdate), begin cleaning up property tree build… #

Patch Set 13 : Continue refactoring property tree bulider using cleaner context-update pattern #

Patch Set 14 : Finish switching to new property tree builder pattern #

Patch Set 15 : Add and improve comments, general cleanups #

Patch Set 16 : Rebase, re-implement updateTransform and updateEffect #

Total comments: 8

Patch Set 17 : Cleanup needsUpdate finder construction, tighten reasons for updating a property subtree, misc clea… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1020 lines, -377 lines) Patch
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +29 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/core/paint/FindPropertiesNeedingUpdate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +144 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/ObjectPaintProperties.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +68 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +12 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 chunks +430 lines, -337 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +58 lines, -5 lines 0 comments Download
A third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +155 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +17 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +26 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (8 generated)
pdr.
@Chrishtr, this is ready for a high-level review before you head off on vacation next ...
4 years, 2 months ago (2016-10-21 18:41:57 UTC) #8
chrishtr
https://codereview.chromium.org/2404213004/diff/200001/third_party/WebKit/Source/core/frame/FrameView.cpp File third_party/WebKit/Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/2404213004/diff/200001/third_party/WebKit/Source/core/frame/FrameView.cpp#newcode3381 third_party/WebKit/Source/core/frame/FrameView.cpp:3381: setPaintPropertiesInvalid(); Add a brief comment explaining which property tree ...
4 years, 2 months ago (2016-10-21 22:03:09 UTC) #9
chrishtr
On 2016/10/21 at 22:03:09, chrishtr wrote: > https://codereview.chromium.org/2404213004/diff/200001/third_party/WebKit/Source/core/frame/FrameView.cpp > File third_party/WebKit/Source/core/frame/FrameView.cpp (right): > > https://codereview.chromium.org/2404213004/diff/200001/third_party/WebKit/Source/core/frame/FrameView.cpp#newcode3381 ...
4 years, 2 months ago (2016-10-21 22:08:18 UTC) #10
pdr.
Just noticed a small optimization we should probably add in this patch: we only need ...
4 years, 2 months ago (2016-10-21 22:09:59 UTC) #11
pdr.
https://codereview.chromium.org/2404213004/diff/200001/third_party/WebKit/Source/core/frame/FrameView.cpp File third_party/WebKit/Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/2404213004/diff/200001/third_party/WebKit/Source/core/frame/FrameView.cpp#newcode3381 third_party/WebKit/Source/core/frame/FrameView.cpp:3381: setPaintPropertiesInvalid(); On 2016/10/21 at 22:03:09, chrishtr - OOO wrote: ...
4 years, 1 month ago (2016-10-26 03:10:49 UTC) #12
pdr.
@WangXianzhu, I think this is finally ready for a high-level review. I'd like to split ...
4 years, 1 month ago (2016-10-26 03:20:30 UTC) #13
Xianzhu
https://codereview.chromium.org/2404213004/diff/300001/third_party/WebKit/Source/core/layout/LayoutObject.h File third_party/WebKit/Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/2404213004/diff/300001/third_party/WebKit/Source/core/layout/LayoutObject.h#newcode2152 third_party/WebKit/Source/core/layout/LayoutObject.h:2152: // 32 bits have been used in the first ...
4 years, 1 month ago (2016-10-26 19:21:51 UTC) #15
pdr.
https://codereview.chromium.org/2404213004/diff/300001/third_party/WebKit/Source/core/paint/FindPropertiesNeedingUpdate.h File third_party/WebKit/Source/core/paint/FindPropertiesNeedingUpdate.h (right): https://codereview.chromium.org/2404213004/diff/300001/third_party/WebKit/Source/core/paint/FindPropertiesNeedingUpdate.h#newcode30 third_party/WebKit/Source/core/paint/FindPropertiesNeedingUpdate.h:30: } On 2016/10/26 at 19:21:51, Xianzhu wrote: > Can ...
4 years, 1 month ago (2016-10-26 23:10:19 UTC) #16
Xianzhu
4 years, 1 month ago (2016-10-26 23:19:40 UTC) #17
lgtm

https://codereview.chromium.org/2404213004/diff/300001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp (right):

https://codereview.chromium.org/2404213004/diff/300001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp:103:
localContext.needToUpdatePaintPropertySubtree = true;
On 2016/10/26 23:10:19, pdr. wrote:
> On 2016/10/26 at 19:21:51, Xianzhu wrote:
> > I think we don't need to set needToUpdatePaintPropertySubtree but just
> object.setNeedsPaintPropertyUpdate().
> > 
> 
> Initially I'd like to rebuild entire subtrees anytime
> object.needsPaintPropertyUpdate is set. This way we don't yet have to worry
> about descendant properties that point to stale properties on this object. I'd
> then like to improve this in the future. Does that sound reasonable to you, or
> do you think this should be thought out more before landing parts of this
patch?
> 
> I have two ideas for improving setNeedsPaintPropertyUpdate:
> * We could introduce a local-only (or even transform-only, clip-only, etc) bit
> such as setNeedsLocalPaintPropertyUpdate that does not rebuild the entire
> subtree. This would be for the case when a transform changes, for example.
> * Another option is to only rebuild a property subtree if nodes change. If
just
> the values of property nodes change (as opposed to new ones added or deleted),
> all child nodes will still be valid and we do not need to rebuild the subtree
at
> all.
> 
> Does that sound like a good idea? Thoughts welcome.
>

SGTM.

(I overlooked the previous needToUpdatePaintPropertySubtree = true and
misunderstood the above code when writing the previous comment.)

> > About your question in https://codereview.chromium.org/2404213004/#msg13, I
> think we can use mayNeedpaintInvalidation() || shouldDoFullPaintInvalidation()
> here to exclude the cases that the object needs checking paint invalidation
just
> because of having selection and/or childShouldCheckForPaintInvalidation().
> 
> Updated! Can you take another look at this conditional and see if my comments
> can be improved?

Powered by Google App Engine
This is Rietveld 408576698