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

Issue 1298493003: Currently we only composite fixed position elements if we are on High DPI devices. This fix allows …

Created:
5 years, 4 months ago by davidfox
Modified:
5 years, 2 months ago
Reviewers:
Ian Vollick, trchen
CC:
blink-reviews, pdr+renderingwatchlist_chromium.org, zoltan1, szager+layoutwatch_chromium.org, eae+blinkwatch, leviw+renderwatch, slimming-paint-reviews_chromium.org, blink-reviews-rendering, jchaffraix+rendering, blink-reviews-paint_chromium.org, dshwang
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Currently we only composite fixed position elements if we are on High DPI devices. This fix allows these elements to be composited if they are completely opaque (since we will not lose LCD text) OR on High DPI devices BUG=510580, 482229

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use correct bounds and code style fixes #

Patch Set 3 : Fix webkit unit test errors and add new layout test #

Patch Set 4 : Update affected tests #

Total comments: 4

Patch Set 5 : Update fixed-scroll-in-empty-root-layer #

Total comments: 2

Patch Set 6 : Include bounds of children #

Patch Set 7 : Catching up with latest commits #

Patch Set 8 : Remove similarity check #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -38 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/compositing/fixed-position-opaque-compositing.html View 1 2 3 4 5 1 chunk +77 lines, -0 lines 0 comments Download
A LayoutTests/compositing/fixed-position-opaque-compositing-expected.txt View 1 2 3 4 5 6 7 1 chunk +27 lines, -0 lines 0 comments Download
M LayoutTests/compositing/layer-creation/fixed-position-under-transform.html View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/compositing/overflow/fixed-scroll-in-empty-root-layer.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/compositing/repaint/fixed-pos-inside-composited-intermediate-layer.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/compositing/repaint/fixed-pos-with-abs-pos-child-scroll.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/compositing/rtl/rtl-fixed-overflow.html View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/compositing/rtl/rtl-fixed-overflow-scrolled.html View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/fast/repaint/absolute-position-changed.html View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/fast/repaint/fixed.html View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-child-move-after-scroll.html View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-child-of-fixed-move-after-scroll.html View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-move-after-scroll.html View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-tranformed.html View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/repaint/fixed-under-composited-absolute-scrolled.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/repaint/fixed-under-composited-fixed-scrolled.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/repaint/resources/default.css View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/repaint/resources/repaint-with-scrollbar-change.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fixed-scroll-in-empty-root-layer-expected.txt View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/layout/compositing/CompositingReasonFinder.cpp View 1 2 3 4 5 1 chunk +16 lines, -3 lines 3 comments Download
M Source/core/paint/DeprecatedPaintLayer.cpp View 1 2 3 4 5 6 1 chunk +0 lines, -4 lines 0 comments Download
M Source/web/tests/ScrollingCoordinatorTest.cpp View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M Source/web/tests/data/fixed-position-losing-backing.html View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M Source/web/tests/data/fractional-scroll-fixed-position.html View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (16 generated)
trchen
https://codereview.chromium.org/1298493003/diff/1/Source/core/layout/compositing/CompositingReasonFinder.cpp File Source/core/layout/compositing/CompositingReasonFinder.cpp (right): https://codereview.chromium.org/1298493003/diff/1/Source/core/layout/compositing/CompositingReasonFinder.cpp#newcode184 Source/core/layout/compositing/CompositingReasonFinder.cpp:184: if (!(m_compositingTriggers & ViewportConstrainedPositionedTrigger)) { Please swap the branches. ...
5 years, 4 months ago (2015-08-14 21:02:17 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1298493003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1298493003/60001
5 years, 4 months ago (2015-08-20 22:24:25 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/96413)
5 years, 4 months ago (2015-08-20 23:32:16 UTC) #9
Ian Vollick
Hey! Sorry for the slow replies. Have you manually confirmed that the test virtual/prefer_compositing_to_lcd_text/compositing/overflow/fixed-scroll-in-empty-root-layer.html is ...
5 years, 4 months ago (2015-08-21 14:40:43 UTC) #10
davidfox
Regarding virtual/prefer_compositing_to_lcd_text/compositing/overflow/fixed-scroll-in-empty-root-layer.html : The only difference is the contents are no longer opaque due to ...
5 years, 4 months ago (2015-08-21 14:50:35 UTC) #11
davidfox
On 2015/08/21 14:50:35, obto wrote: > Regarding > virtual/prefer_compositing_to_lcd_text/compositing/overflow/fixed-scroll-in-empty-root-layer.html > : > The only difference ...
5 years, 4 months ago (2015-08-21 14:53:52 UTC) #12
Ian Vollick
On 2015/08/21 14:53:52, obto wrote: > On 2015/08/21 14:50:35, obto wrote: > > Regarding > ...
5 years, 4 months ago (2015-08-21 14:56:17 UTC) #13
davidfox
On 2015/08/21 14:56:17, vollick wrote: > On 2015/08/21 14:53:52, obto wrote: > > On 2015/08/21 ...
5 years, 4 months ago (2015-08-21 15:39:49 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1298493003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1298493003/80001
5 years, 3 months ago (2015-08-24 16:29:19 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/103145)
5 years, 3 months ago (2015-08-24 17:25:52 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1298493003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1298493003/80001
5 years, 3 months ago (2015-08-27 00:16:22 UTC) #20
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-08-27 02:02:56 UTC) #22
trchen
https://codereview.chromium.org/1298493003/diff/80001/Source/core/layout/compositing/CompositingReasonFinder.cpp File Source/core/layout/compositing/CompositingReasonFinder.cpp (right): https://codereview.chromium.org/1298493003/diff/80001/Source/core/layout/compositing/CompositingReasonFinder.cpp#newcode188 Source/core/layout/compositing/CompositingReasonFinder.cpp:188: LayoutRect bounds = layer->layoutBox()->visualOverflowRect(); I looked at the semantics ...
5 years, 3 months ago (2015-08-27 23:10:58 UTC) #23
davidfox
https://codereview.chromium.org/1298493003/diff/80001/Source/core/layout/compositing/CompositingReasonFinder.cpp File Source/core/layout/compositing/CompositingReasonFinder.cpp (right): https://codereview.chromium.org/1298493003/diff/80001/Source/core/layout/compositing/CompositingReasonFinder.cpp#newcode188 Source/core/layout/compositing/CompositingReasonFinder.cpp:188: LayoutRect bounds = layer->layoutBox()->visualOverflowRect(); On 2015/08/27 23:10:58, trchen wrote: ...
5 years, 3 months ago (2015-08-30 22:00:04 UTC) #24
trchen
On 2015/08/30 22:00:04, davidfox wrote: > https://codereview.chromium.org/1298493003/diff/80001/Source/core/layout/compositing/CompositingReasonFinder.cpp > File Source/core/layout/compositing/CompositingReasonFinder.cpp (right): > > https://codereview.chromium.org/1298493003/diff/80001/Source/core/layout/compositing/CompositingReasonFinder.cpp#newcode188 > ...
5 years, 3 months ago (2015-08-31 21:22:29 UTC) #25
davidfox
Oh I'm quite enjoying learning about all these intricacies, was just curious if that method ...
5 years, 3 months ago (2015-08-31 22:14:38 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1298493003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1298493003/100001
5 years, 3 months ago (2015-09-09 20:25:41 UTC) #30
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 3 months ago (2015-09-09 20:25:44 UTC) #32
trchen
Hey vollick, I'm a bit worried about the extra time complexity. Do you have some ...
5 years, 3 months ago (2015-09-17 21:40:33 UTC) #33
Ian Vollick
https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/compositing/CompositingReasonFinder.cpp File Source/core/layout/compositing/CompositingReasonFinder.cpp (right): https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/compositing/CompositingReasonFinder.cpp#newcode197 Source/core/layout/compositing/CompositingReasonFinder.cpp:197: } On 2015/09/17 21:40:33, trchen wrote: > A few ...
5 years, 3 months ago (2015-09-18 02:09:50 UTC) #34
davidfox
1. When and how often is CompositingInputsUpdater::updateRecursive invoked? Is it only called for layers decided ...
5 years, 3 months ago (2015-09-18 02:50:37 UTC) #35
davidfox
https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/compositing/CompositingReasonFinder.cpp File Source/core/layout/compositing/CompositingReasonFinder.cpp (right): https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/compositing/CompositingReasonFinder.cpp#newcode197 Source/core/layout/compositing/CompositingReasonFinder.cpp:197: } On 2015/09/18 02:09:50, vollick wrote: > On 2015/09/17 ...
5 years, 3 months ago (2015-09-18 02:55:40 UTC) #36
Ian Vollick
5 years, 3 months ago (2015-09-18 13:45:14 UTC) #37
On 2015/09/18 02:50:37, davidfox wrote:
> 1. When and how often is CompositingInputsUpdater::updateRecursive invoked?
> Is it only called for layers decided to be composited?

Nope, it's called before we make compositing decisions. It's worth doing a
little digging to learn about this machinery, but the inputs are updated
whenever DeprecatedPaintLayer::setNeedsCompositingInputsUpdate is called. You'll
want to check that the input are set to update appropriately.
 
> 2. Are you envisioning it working something like this?:
> 
>    1. Add a method to DepreatedPaintLayer (or where best fit) to calculate
>    its full background rect and cache the result.
>    2. Update CompositingInputsUpdater::updateRecursive to clip the result
>    from the above method, instead of calculating it on its own. This would be
>    the primary way the cache is kept up to date.
>    3. Add a simple getter to retrieve the cached rect. To be used in
>    CompositingReasonFinder::requiresCompositingForPositionFixed

I don't think that's quite what I meant. My thoughts are (and you'll need to
check if this is actually feasible):

1. Ensure that the compositing inputs are updated before we do our opaqueness
check.
2. When updating the compositing inputs cache the background rect we'll need for
the opaqueness check if it doesn't already exist (and add the appropriate getter
on DPL).
3. Use the getter in requiresCompositingForPositionFixed.
> 
> 
> On Thu, Sep 17, 2015 at 9:09 PM <mailto:vollick@chromium.org> wrote:
> 
> >
> >
> >
>
https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/com...
> > File Source/core/layout/compositing/CompositingReasonFinder.cpp (right):
> >
> >
> >
>
https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/com...
> > Source/core/layout/compositing/CompositingReasonFinder.cpp:197
> >
>
<https://codereview.chromium.org/1298493003/diff/140001/Source/core/layout/com...>:
> > }
> > On 2015/09/17 21:40:33, trchen wrote:
> > > A few problem here:
> > > 1. This only adds the overflow from direct children, but we want to
> > take every
> > > descendant layer into consideration.
> > > 2. Need to translate from local coordinate of the descandant to the
> > current
> > > layer before uniting the rects.
> >
> > > You may refer to
> > > DPL::physicalBoundingBoxIncludingReflectionAndStackingChildren() to
> > how it's
> > > done. Perhaps adding an enum option for it to ignore compositing state
> > then it
> > > would be good to go.
> >
> > > I'm a little bit worried though, because it will increase the time
> > complexity of
> > > compositing decision from O(1) to O(N) per layer, where N is the
> > number of layer
> > > in the subtree. You may want a second opinion from a compositing
> > expert.
> >
> > Yes, this is indeed too slow. If you look at
> > DeprecatedPaintLayer::backgroundIsKnownToBeOpaqueInRect, there's a
> > hidden O(N) in there, too, if the queried rect is outside its "local"
> > bounds (though this shouldn't happen too often).
> >
> > I think we may be able to piggyback on some existing code to get this
> > rect. Correct me if I'm wrong, but  what I think we're after here is the
> > composited bounds (see
> > CompositedDeprecatedPaintLayerMapping::compositedBounds). We _almost_
> > compute this value anyhow here:
> >
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> >
> > ..except we clip it away somewhat. Perhaps we could cache the background
> > rect we compute here before we clip it and use it for our opaqueness
> > test.
> >
> > https://codereview.chromium.org/1298493003/
> >
> 
> To unsubscribe from this group and stop receiving emails from it, send an
email
> to mailto:blink-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698