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

Issue 2161523002: Isolation of subtrees of stacking contexts and out-of-flow positioned objects (Closed)

Created:
4 years, 5 months ago by Xianzhu
Modified:
4 years, 4 months ago
Reviewers:
pdr., trchen
CC:
chromium-reviews, blink-reviews, dshwang, slimming-paint-reviews_chromium.org, blink-reviews-paint_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@CachePaintProperties
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Isolation of subtrees of stacking contexts and out-of-flow positioned objects BUG=

Patch Set 1 #

Patch Set 2 #

Patch Set 3 : - #

Messages

Total messages: 31 (14 generated)
Xianzhu
This is not ready for review yet. Some layout tests result 1-pixel shift of some ...
4 years, 5 months ago (2016-07-18 17:58:45 UTC) #6
trchen
I got that you want to re-use nodes that will be created in the first ...
4 years, 5 months ago (2016-07-19 22:38:42 UTC) #7
Xianzhu
On 2016/07/19 22:38:42, trchen wrote: > I got that you want to re-use nodes that ...
4 years, 5 months ago (2016-07-19 22:48:14 UTC) #8
trchen
Chatted with xianzhu offline. I think his idea will work. The basic idea is that ...
4 years, 5 months ago (2016-07-19 23:18:09 UTC) #10
chrishtr
On 2016/07/19 at 23:18:09, trchen wrote: > Chatted with xianzhu offline. I think his idea ...
4 years, 5 months ago (2016-07-19 23:57:41 UTC) #11
Xianzhu
On 2016/07/19 23:57:41, chrishtr wrote: > On 2016/07/19 at 23:18:09, trchen wrote: > > Chatted ...
4 years, 5 months ago (2016-07-20 19:04:39 UTC) #12
pdr.
I'm a little worried about the two proposals that add extra nodes because of the ...
4 years, 5 months ago (2016-07-22 00:06:23 UTC) #21
Xianzhu
On 2016/07/22 00:06:23, pdr. wrote: > I'm a little worried about the two proposals that ...
4 years, 5 months ago (2016-07-22 00:12:23 UTC) #22
pdr.
On 2016/07/22 at 00:12:23, wangxianzhu wrote: > On 2016/07/22 00:06:23, pdr. wrote: > > I'm ...
4 years, 5 months ago (2016-07-22 00:37:30 UTC) #23
Xianzhu
On 2016/07/22 00:37:30, pdr. wrote: > On 2016/07/22 at 00:12:23, wangxianzhu wrote: > > On ...
4 years, 5 months ago (2016-07-22 00:49:20 UTC) #24
Xianzhu
For now this Cl might be unnecessary because we'll invalidate the subtree when transform, opacity, ...
4 years, 5 months ago (2016-07-25 21:26:38 UTC) #25
pdr.
I talked with Tien-Ren and now better understand the isolation node proposals. Because we effectively ...
4 years, 5 months ago (2016-07-25 21:36:22 UTC) #26
pdr.
On 2016/07/25 at 21:36:22, pdr. wrote: Ack! We were both adding comments at the same ...
4 years, 5 months ago (2016-07-25 21:38:02 UTC) #27
pdr.
On 2016/07/25 at 21:26:38, wangxianzhu wrote: > For now this Cl might be unnecessary because ...
4 years, 5 months ago (2016-07-25 23:26:04 UTC) #28
Xianzhu
On 2016/07/25 23:26:04, pdr. wrote: > On 2016/07/25 at 21:26:38, wangxianzhu wrote: > > For ...
4 years, 5 months ago (2016-07-26 00:11:10 UTC) #29
chrishtr
My current feeling is that we should re-paint everything that may be affected by paint ...
4 years, 5 months ago (2016-07-26 00:41:49 UTC) #30
Xianzhu
4 years, 4 months ago (2016-07-26 16:52:10 UTC) #31
Message was sent while issue was closed.
On 2016/07/26 00:41:49, chrishtr wrote:
> My current feeling is that we should re-paint everything that may be affected
by
> paint property tree nodes which change. Adding up to 7 new isolation property
> tree nodes is a lot of overhead and complexity. Also, only handling
normal-flow
> descendants 
> 

With the choice of this CL, we add up to 3 new isolation property tree nodes
(may be 4 if we add scrolling nodes) for a stacking context or an out-of-flow
positioned object. If we chose not to create isolation nodes for
non-stacking-context out-of-flow positioned objects, there would be up to 5 new
nodes and 2 new references from ObjectPaintProperties for each stacking context.
The overhead still looks scary. I feel this would create 1x to 2x number of more
nodes.

> Thus in some cases,
> adding a single property tree node could cause re-paint of the entire page.
> 
> However, this does not preclude various optimizations, such as:
> 
> - New paint property tree nodes don't affect paint chunks that are not on a
> descendant chain in any tree (e.g. siblings). Therefore they don't need to
> be painted.
> - In some cases, we may be able to efficiently detect whether paint chunks
that
> are descendants actually reference new paint property tree nodes.
> If they don't, then they don't need to be re-painted. (trchen had an idea to
> detect this situation by reference counting pointers to property tree nodes)
>

I think we should separate the need of pre-paint tree walk and the need of
repaint. We need to walk into the subtree when a property node is created during
pre-paint tree walk to update the tree structure (the parent node), but don't
necessarily repaint the subtree (more discussions below).

> Two other things that came to mind:
> 
> - we have similar complications to the SPv1 subsequence caching system. e.g
when
> an overflow-related property changes, needsRepaint is set on overflow change.
We
> also I believe set needsRepaint conservatively in similar cases?

In spv1, every change of clipping (except for a composited contents layer) will
cause change of paint results. In spv2, we should introduce interest rects for
scrolling overflow clippings, so repaint is needed only if the interest rect
changes, which requires basically the same algorithm we used in
GraphicsLayer::paintWithoutCommit(), which is separate from paint invalidation
algorithm.

Thus perhaps we don't need to invalidate any object or any layer during paint
invalidation for property changes. For layers, we can check interest rect change
in shouldRepaintSubsequence(). Rasterization invalidation caused by property
changes will happen after paint.

Without isolation, if we don't repaint the subtree with changed paint property,
references to out-dated property nodes from PaintChunkProperties of cached
chunks is still a problem. Will think more about this. Repaint merely for
updating the references is not good.

> - We should consider which use cases benefit the most from SPv1 subsequence
> caching, and target those use cases with minimal code complexity.
> My intuition (which needs to be backed by data...) is that the most important
> use case is to avoid traversing the tree when local invalidation s occur
> elsewhere.
> 
> > Subtree isolation may be not only for subsequence caching. Perhaps is
"subtree
> synchronization point" a better name? At a subtree synchronization point, we
> synchronize all the paint property subtrees.
> 
> Did you have another use case in mind? That would certainly affect things.

No. Thought of isolation nodes might help pruning pre-paint tree walk, but it
seemed not to.

Powered by Google App Engine
This is Rietveld 408576698