Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
TEST=fast/multicol/span/outline.html
Committed: https://crrev.com/42c48698112091f8067d13d8e8d84a799b658e4b
Cr-Commit-Position: refs/heads/master@{#371652}
4 years, 11 months ago
(2016-01-12 18:52:48 UTC)
#2
chrishtr
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp#newcode1389 third_party/WebKit/Source/core/layout/LayoutObject.cpp:1389: PaintLayer* layer = enclosingLayer()->enclosingSelfPaintingLayer(); This is a tree walk ...
4 years, 11 months ago
(2016-01-12 23:52:24 UTC)
#3
Also found that some painters (e.g. TablePainter) handles PaintPhaseSelfOutline and PaintPhaseChildOutlines incorrectly. They paint child ...
4 years, 11 months ago
(2016-01-13 00:11:03 UTC)
#4
Also found that some painters (e.g. TablePainter) handles PaintPhaseSelfOutline
and PaintPhaseChildOutlines incorrectly. They paint child outlines during
PaintPhaseSelfOutline phase, but ignore PaintPhaseChildOutlines. This was not an
issue before this change because they two phases were interchangeably if the
layer is not scrollable.
Also working on fixing this.
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right):
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutObject.cpp:1389: PaintLayer* layer =
enclosingLayer()->enclosingSelfPaintingLayer();
On 2016/01/12 23:52:24, chrishtr wrote:
> This is a tree walk for every LayoutObject. PaintInvalidationState goes to
great
> lengths to avoid this for paint invalidation container, I don't think we can
> afford this cost...
Not every LayoutObject, but only LayoutObject having outline which is relatively
rare.
Just noticed that we already have such tree walk in
LayoutObject::invalidateDisplayItemClients(), but there haven't been performance
regressions reported, so we should definitely fix this. Will land the fix before
this CL.
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutObject.cpp:1390: if
(layer->layoutObject() != this)
On 2016/01/12 23:52:24, chrishtr wrote:
> Why this conditional?
We paint self outline and child outlines in different phases. Here we need to
exclude self outline.
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right):
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/paint/PaintLayer.cpp:951: for (PaintLayer* layer
= const_cast<PaintLayer*>(this); layer; layer = layer->parent()) {
On 2016/01/12 23:52:24, chrishtr wrote:
> should be compositingContainer() instead of parent() right?
No. We just want to find the self painting layer which may be between this layer
and compositingContainer(). This won't violet paint order because if this layer
is self painting, the function returns this; otherwise the self painting layer
should definitely be the ancestor of this layer.
chrishtr
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp#newcode1389 third_party/WebKit/Source/core/layout/LayoutObject.cpp:1389: PaintLayer* layer = enclosingLayer()->enclosingSelfPaintingLayer(); On 2016/01/13 at 00:11:03, Xianzhu ...
4 years, 11 months ago
(2016-01-13 05:01:17 UTC)
#5
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right):
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/layout/LayoutObject.cpp:1389: PaintLayer* layer =
enclosingLayer()->enclosingSelfPaintingLayer();
On 2016/01/13 at 00:11:03, Xianzhu wrote:
> On 2016/01/12 23:52:24, chrishtr wrote:
> > This is a tree walk for every LayoutObject. PaintInvalidationState goes to
great
> > lengths to avoid this for paint invalidation container, I don't think we can
> > afford this cost...
>
> Not every LayoutObject, but only LayoutObject having outline which is
relatively rare.
>
> Just noticed that we already have such tree walk in
LayoutObject::invalidateDisplayItemClients(), but there haven't been performance
regressions reported, so we should definitely fix this. Will land the fix before
this CL.
I'll wait for that patch first then.
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right):
https://codereview.chromium.org/1584493002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/paint/PaintLayer.cpp:951: for (PaintLayer* layer
= const_cast<PaintLayer*>(this); layer; layer = layer->parent()) {
On 2016/01/13 at 00:11:03, Xianzhu wrote:
> On 2016/01/12 23:52:24, chrishtr wrote:
> > should be compositingContainer() instead of parent() right?
>
> No. We just want to find the self painting layer which may be between this
layer and compositingContainer(). This won't violet paint order because if this
layer is self painting, the function returns this; otherwise the self painting
layer should definitely be the ancestor of this layer.
I see, ok.
chrishtr
Also, could you performance test this? It should be straightforward to use rasterize-and-record to demonstrate ...
4 years, 11 months ago
(2016-01-13 05:04:01 UTC)
#6
Also, could you performance test this? It should be straightforward to use
rasterize-and-record to demonstrate how much faster this is on a page without
outlines.
Xianzhu
On 2016/01/13 05:04:01, chrishtr wrote: > Also, could you performance test this? It should be ...
4 years, 11 months ago
(2016-01-14 18:08:02 UTC)
#7
On 2016/01/13 05:04:01, chrishtr wrote:
> Also, could you performance test this? It should be straightforward to use
> rasterize-and-record to demonstrate how much faster this is on a page without
> outlines.
Tested combination of several CLs (https://codereview.chromium.org/1584903002/,
https://codereview.chromium.org/1585823002/, this CL and
https://codereview.chromium.org/1581593003/) on cluster telemetry. Results are:
- On Android
record_time_cache_disabled: -4.5%
record_time_subsequence_cache_disabled: -32.5%
- On Linux
record_time_cache_disabled: -4.5%
record_time_subsequence_cache_disabled: -45.2%
See runs 420 and 421 in https://ct.skia.org/chromium_perf_runs/ for details.
Xianzhu
Depended CLs landed. This CL is ready. Ptal.
4 years, 11 months ago
(2016-01-20 18:43:09 UTC)
#8
Depended CLs landed. This CL is ready. Ptal.
Xianzhu
Just found a bug about outline in multi-column span (not covered by existing layout tests). ...
4 years, 11 months ago
(2016-01-20 20:02:48 UTC)
#9
Just found a bug about outline in multi-column span (not covered by existing
layout tests). Investigating.
Xianzhu
On 2016/01/20 20:02:48, Xianzhu wrote: > Just found a bug about outline in multi-column span ...
4 years, 11 months ago
(2016-01-20 21:44:39 UTC)
#10
On 2016/01/20 20:02:48, Xianzhu wrote:
> Just found a bug about outline in multi-column span (not covered by existing
> layout tests). Investigating.
The latest CL changed PaintInvalidationState::enclosingLayer() to
PaintInvalidationState::enclosingSelfPaintingLayer() (with the special handling
of multicol spanner removed), and changed how LayoutObject asserts the enclosing
layer has setNeedsRepaint.
FYI, some details about multicol spanner:
For DOM:
<div style="multicol">
<div style="-webkit-column-span: all">
...
</div>
</div>
the layer/layout tree is like:
layer 1
LayoutBlockFlow DIV multicol
LayoutMultiColumnSpannerPlaceholder (anonymous)
LayoutMultiColumnSet (anonymous)
normal flow list(1)
layer 2
LayoutMultiColumnFlowThread (anonymous)
LayoutBlockFlow (column spanner) DIV column-span:all
...
LayoutBlockFlow (anonymous)
... multi-column contents
The spanner has a special layer ownership: it's enclosingLayer is layer 2, but
it's painted by layer 1.
PaintInvalidationContainer::enclosingSelfPaintingLayer() automatically returns
layer 1 for the spanner because m_enclosingSelfPaintingLayer is set according to
the paint invalidation order for the spanner. The order is same as painting
order for the spanner: the spanner's paint invalidation and paint are invoked
from the anonymous LayoutMultiColumnSpannerPlaceholder, not the enclosing layer.
Xianzhu
Description was changed from ========== Skip PaintPhaseChildOutlines if no child outlines in the layer BUG=574938 ...
4 years, 11 months ago
(2016-01-22 00:48:50 UTC)
#11
Description was changed from
==========
Skip PaintPhaseChildOutlines if no child outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
==========
to
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
==========
Xianzhu
Patchset #9 (id:160001) has been deleted
4 years, 11 months ago
(2016-01-22 00:50:44 UTC)
#12
Patchset #9 (id:160001) has been deleted
Xianzhu
Patchset #8 (id:140001) has been deleted
4 years, 11 months ago
(2016-01-22 00:50:51 UTC)
#13
Patchset #8 (id:140001) has been deleted
Xianzhu
Description was changed from ========== Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer BUG=574938 ...
4 years, 11 months ago
(2016-01-22 00:51:24 UTC)
#14
Description was changed from
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
==========
to
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
TEST=fast/multicol/span/outline.html
==========
Xianzhu
Ptal. The PaintPhaseFloat CL depends on this.
4 years, 11 months ago
(2016-01-22 17:30:26 UTC)
#15
+Morten for second review of the multi-column part.
4 years, 11 months ago
(2016-01-22 18:21:35 UTC)
#17
+Morten for second review of the multi-column part.
Xianzhu
On 2016/01/22 18:21:35, chrishtr wrote: > +Morten for second review of the multi-column part. Morten, ...
4 years, 11 months ago
(2016-01-22 18:24:57 UTC)
#18
On 2016/01/22 18:21:35, chrishtr wrote:
> +Morten for second review of the multi-column part.
Morten, please see #10 for what is multi-column related.
mstensho (USE GERRIT)
Not too familiar with this code, so I'll just write something about spanners for now. ...
4 years, 11 months ago
(2016-01-22 21:24:26 UTC)
#19
Not too familiar with this code, so I'll just write something about spanners for
now. :)
The thing with spanners is that their containing block is the multicol
container. Anything else in the ancestry between the spanner and the multicol
container should not affect how the spanner is displayed. See
LayoutObject::containingBlock().
There's something for spanners in accumulateOffsetTowardsAncestor() in
PaintLayer.cpp. Does your CL agree with the code there? Essentially, the
enclosing layer of a spanner is always the multicol container [1].
[1] But note that we don't allow spanners to be spanners if they are put inside
things like out-of-flow objects. So it's not completely crazy. See
LayoutMultiColumnFlowThread::descendantIsValidColumnSpanner().
https://codereview.chromium.org/1584493002/diff/60001/third_party/WebKit/Layo...
File third_party/WebKit/LayoutTests/fast/multicol/span/outline.html (right):
https://codereview.chromium.org/1584493002/diff/60001/third_party/WebKit/Layo...
third_party/WebKit/LayoutTests/fast/multicol/span/outline.html:2: <p>Test that
an outlined element inside a spanner. Passes if there is a complete blue
rectangle below.</p>
-"that"?
https://codereview.chromium.org/1584493002/diff/200001/third_party/WebKit/Lay...
File third_party/WebKit/LayoutTests/fast/multicol/span/outline.html (right):
https://codereview.chromium.org/1584493002/diff/200001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/fast/multicol/span/outline.html:4: <div
style="-webkit-column-span:all">
Is this still going to work if you make this one position:relative? Also, will
it keep working if you wrap a position:relative DIV around it?
Xianzhu
On 2016/01/22 21:24:26, mstensho wrote: > Not too familiar with this code, so I'll just ...
4 years, 11 months ago
(2016-01-22 22:07:22 UTC)
#20
On 2016/01/22 21:24:26, mstensho wrote:
> Not too familiar with this code, so I'll just write something about spanners
for
> now. :)
>
> The thing with spanners is that their containing block is the multicol
> container. Anything else in the ancestry between the spanner and the multicol
> container should not affect how the spanner is displayed. See
> LayoutObject::containingBlock().
>
> There's something for spanners in accumulateOffsetTowardsAncestor() in
> PaintLayer.cpp. Does your CL agree with the code there? Essentially, the
> enclosing layer of a spanner is always the multicol container [1].
Yes the CL agrees it. However I modified the CL to make it more like the code
there.
>
> [1] But note that we don't allow spanners to be spanners if they are put
inside
> things like out-of-flow objects. So it's not completely crazy. See
> LayoutMultiColumnFlowThread::descendantIsValidColumnSpanner().
>
Xianzhu
https://codereview.chromium.org/1584493002/diff/60001/third_party/WebKit/LayoutTests/fast/multicol/span/outline.html File third_party/WebKit/LayoutTests/fast/multicol/span/outline.html (right): https://codereview.chromium.org/1584493002/diff/60001/third_party/WebKit/LayoutTests/fast/multicol/span/outline.html#newcode2 third_party/WebKit/LayoutTests/fast/multicol/span/outline.html:2: <p>Test that an outlined element inside a spanner. Passes ...
4 years, 11 months ago
(2016-01-22 22:07:34 UTC)
#21
Please split out the fix for multicol that is not in the current tests. Otherwise ...
4 years, 11 months ago
(2016-01-23 00:52:37 UTC)
#22
Please split out the fix for multicol that is not in the current tests.
Otherwise looks generally
good.
Xianzhu
On 2016/01/23 00:52:37, chrishtr wrote: > Please split out the fix for multicol that is ...
4 years, 11 months ago
(2016-01-23 01:17:58 UTC)
#23
On 2016/01/23 00:52:37, chrishtr wrote:
> Please split out the fix for multicol that is not in the current tests.
> Otherwise looks generally
> good.
The multicol issue is not a standalone issue, but only with this CL when we mark
the layer needs outline phase. We need to consider multicol spanner when
checking if the correct layer is marked.
chrishtr
On 2016/01/23 at 01:17:58, wangxianzhu wrote: > On 2016/01/23 00:52:37, chrishtr wrote: > > Please ...
4 years, 11 months ago
(2016-01-23 01:38:02 UTC)
#24
On 2016/01/23 at 01:17:58, wangxianzhu wrote:
> On 2016/01/23 00:52:37, chrishtr wrote:
> > Please split out the fix for multicol that is not in the current tests.
> > Otherwise looks generally
> > good.
>
> The multicol issue is not a standalone issue, but only with this CL when we
mark the layer needs outline phase. We need to consider multicol spanner when
checking if the correct layer is marked.
Sure, but this patch has an effect on paint invalidation code even without the
outline phase code. Therefore it should be a
fix to a code structure issue which does not expose itself currently but should
be compatible with the current code.
Xianzhu
On 2016/01/23 01:17:58, Xianzhu wrote: > On 2016/01/23 00:52:37, chrishtr wrote: > > Please split ...
4 years, 11 months ago
(2016-01-23 02:08:29 UTC)
#25
On 2016/01/23 01:17:58, Xianzhu wrote:
> On 2016/01/23 00:52:37, chrishtr wrote:
> > Please split out the fix for multicol that is not in the current tests.
> > Otherwise looks generally
> > good.
>
> The multicol issue is not a standalone issue, but only with this CL when we
mark
> the layer needs outline phase. We need to consider multicol spanner when
> checking if the correct layer is marked.
Agreed. Done.
chrishtr
lgtm
4 years, 11 months ago
(2016-01-23 04:58:22 UTC)
#26
lgtm
Xianzhu
The CQ bit was checked by wangxianzhu@chromium.org
4 years, 11 months ago
(2016-01-26 22:40:07 UTC)
#27
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1584493002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1584493002/260001
4 years, 11 months ago
(2016-01-26 22:42:29 UTC)
#29
Description was changed from ========== Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer BUG=574938 ...
4 years, 11 months ago
(2016-01-27 00:16:22 UTC)
#30
Message was sent while issue was closed.
Description was changed from
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
TEST=fast/multicol/span/outline.html
==========
to
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
TEST=fast/multicol/span/outline.html
==========
commit-bot: I haz the power
Committed patchset #12 (id:260001)
4 years, 11 months ago
(2016-01-27 00:16:23 UTC)
#31
Message was sent while issue was closed.
Committed patchset #12 (id:260001)
commit-bot: I haz the power
Description was changed from ========== Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer BUG=574938 ...
4 years, 11 months ago
(2016-01-27 00:17:07 UTC)
#32
Message was sent while issue was closed.
Description was changed from
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
TEST=fast/multicol/span/outline.html
==========
to
==========
Skip PaintPhaseDescendantOutlinesOnly if no descendant outlines in the layer
BUG=574938
TEST=PaintLayerPainterTest.PaintPhaseOutline
TEST=fast/multicol/span/outline.html
Committed: https://crrev.com/42c48698112091f8067d13d8e8d84a799b658e4b
Cr-Commit-Position: refs/heads/master@{#371652}
==========
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/42c48698112091f8067d13d8e8d84a799b658e4b Cr-Commit-Position: refs/heads/master@{#371652}
4 years, 11 months ago
(2016-01-27 00:17:08 UTC)
#33
Issue 1584493002: Skip PaintPhaseDescendantOutlinesOnly if no descendent outlines in the layer
(Closed)
Created 4 years, 11 months ago by Xianzhu
Modified 4 years, 11 months ago
Reviewers: chrishtr, mstensho (USE GERRIT)
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 12