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

Issue 2565223002: Add more specific metrics for main thread scrolling reasons (Closed)

Created:
4 years ago by yigu
Modified:
3 years, 11 months ago
Reviewers:
flackr, bokan, pdr., weiliangc, jwd
CC:
asvitkine+watch_chromium.org, blink-layers+watch_chromium.org, blink-reviews, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, cc-bugs_chromium.org, chromium-reviews, dshwang, eae+blinkwatch, jchaffraix+rendering, kenneth.christiansen, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

We should replace the broad main thread reasons of non layer viewport constrained objects and non fast scrollable reason with the more specific reasons which are preventing us from compositing them so that we can prioritize. BUG=660907 TEST=ScrollingCoordinatorTest.MainThreadScrollingReasonDueToLayoutObject CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Committed: https://crrev.com/e92b679fee2d010570bb1ea1896b443d01eb5a84 Cr-Commit-Position: refs/heads/master@{#439944}

Patch Set 1 #

Patch Set 2 : Add unit test && refactoring #

Total comments: 24

Patch Set 3 : Relocate the logic of updating mainThreadScrollingFromStyle #

Total comments: 14

Patch Set 4 : Move logic regarding clearing up ReasonsCounter upon layer dispose to ScrollingCoordinator #

Total comments: 2

Patch Set 5 : Add preferCompositingToLCDTextEnable check #

Total comments: 4

Patch Set 6 : Move updating main thread scrolling reasons from style to PLSA #

Total comments: 8

Patch Set 7 : Refactoring #

Total comments: 18

Patch Set 8 : Refactoring && merging master #

Total comments: 4

Patch Set 9 : nit #

Total comments: 4

Patch Set 10 : Test that there should be no reason set if setPrefercompositingToCDLTextEnabled(true) #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -8 lines) Patch
M cc/input/main_thread_scrolling_reason.h View 1 2 5 chunks +19 lines, -2 lines 4 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 7 3 chunks +30 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp View 1 2 3 4 5 6 7 8 5 chunks +51 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +47 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/web/tests/data/two_transparent_scrollable_area.html View 1 2 3 4 5 6 1 chunk +29 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 59 (26 generated)
yigu
Hi David, This patch is about adding the main thread scrolling reason "layout has opacity". ...
4 years ago (2016-12-12 15:33:41 UTC) #10
bokan
https://codereview.chromium.org/2565223002/diff/20001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/2565223002/diff/20001/cc/input/main_thread_scrolling_reason.h#newcode34 cc/input/main_thread_scrolling_reason.h:34: kHasOpacity = 1 << 16, kHasOpacityAndScrollDependent? A regular scroller ...
4 years ago (2016-12-13 14:38:57 UTC) #11
blink-reviews
Hi David, Thanks for the feedback! Just a quick thought. I am not sure about ...
4 years ago (2016-12-13 15:35:11 UTC) #12
chromium-reviews
Hi David, Thanks for the feedback! Just a quick thought. I am not sure about ...
4 years ago (2016-12-13 15:35:11 UTC) #13
bokan
On 2016/12/13 15:35:11, chromium-reviews wrote: > Hi David, > > Thanks for the feedback! Just ...
4 years ago (2016-12-13 15:56:56 UTC) #14
yigu
On 2016/12/13 15:56:56, bokan wrote: > On 2016/12/13 15:35:11, chromium-reviews wrote: > > Hi David, ...
4 years ago (2016-12-13 16:05:50 UTC) #15
yigu
Hi David, I've moved part of the logic out of compositingReasonFinder as you suggested. The ...
4 years ago (2016-12-13 20:54:10 UTC) #16
bokan
Thanks, I think I better understand what's going on now. https://codereview.chromium.org/2565223002/diff/20001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/2565223002/diff/20001/cc/input/main_thread_scrolling_reason.h#newcode34 ...
4 years ago (2016-12-14 13:28:59 UTC) #17
yigu
Hi David, I have moved the logic of resetting ReasonCounter to ScrollingCoordinator. PTAL. Thanks! https://codereview.chromium.org/2565223002/diff/40001/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp ...
4 years ago (2016-12-14 21:17:35 UTC) #18
bokan
https://codereview.chromium.org/2565223002/diff/20001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/2565223002/diff/20001/cc/input/main_thread_scrolling_reason.h#newcode34 cc/input/main_thread_scrolling_reason.h:34: kHasOpacity = 1 << 16, On 2016/12/14 13:28:58, bokan ...
4 years ago (2016-12-15 20:47:45 UTC) #19
yigu
Hi David, I have added a check about preferCompositingToLCDText. PTAL. Thanks! https://codereview.chromium.org/2565223002/diff/60001/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp File third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp (right): ...
4 years ago (2016-12-16 18:17:39 UTC) #20
bokan
Thanks, almost there :) https://codereview.chromium.org/2565223002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp File third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp (right): https://codereview.chromium.org/2565223002/diff/80001/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp#newcode256 third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp:256: updateMainThreadScrollingReasonsFromStyle(layer); Sorry, one last thing. ...
4 years ago (2016-12-16 23:06:01 UTC) #21
yigu
Hi David, I've moved the updater to PLSA. I am not checking LCD this time ...
4 years ago (2016-12-18 15:05:12 UTC) #26
bokan
https://codereview.chromium.org/2565223002/diff/100001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp (right): https://codereview.chromium.org/2565223002/diff/100001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp#newcode1743 third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp:1743: return false; I'd prefer we call updateMainThreadScrollingReasonsFromStyle here. The ...
4 years ago (2016-12-19 14:54:25 UTC) #27
yigu
Hi David, New patch regarding the refactoring is on. PTAL. Thanks! Yi https://codereview.chromium.org/2565223002/diff/100001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp ...
4 years ago (2016-12-19 18:55:04 UTC) #28
bokan
https://codereview.chromium.org/2565223002/diff/120001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp (right): https://codereview.chromium.org/2565223002/diff/120001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp#newcode1234 third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp:1234: // Decrese the number of layer that has any ...
4 years ago (2016-12-19 21:25:15 UTC) #29
yigu
Hi David, I have some feedback. Please take a look. Thanks! Yi https://codereview.chromium.org/2565223002/diff/120001/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp File third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp ...
4 years ago (2016-12-20 01:41:20 UTC) #30
bokan
https://codereview.chromium.org/2565223002/diff/120001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp (right): https://codereview.chromium.org/2565223002/diff/120001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp#newcode1731 third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp:1731: getScrollingCoordinator() On 2016/12/20 01:41:20, yigu wrote: > On 2016/12/19 ...
4 years ago (2016-12-20 15:53:15 UTC) #31
yigu
Hi David. I landed another CL which makes mainThreadScrollingReason frame based rather than page based. ...
4 years ago (2016-12-20 16:55:46 UTC) #32
bokan
https://codereview.chromium.org/2565223002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp (right): https://codereview.chromium.org/2565223002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp#newcode1754 third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp:1754: addStyleRelatedMainThreadScrollingReasons( This still has the issue I brought up ...
4 years ago (2016-12-20 19:35:53 UTC) #33
bokan
FYI, for future reviews, if you have multiple patches that depend on each other, you ...
4 years ago (2016-12-20 19:38:38 UTC) #34
yigu
Hi David, Made the changes as you suggested. Thanks! Yi https://codereview.chromium.org/2565223002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp File third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp (right): https://codereview.chromium.org/2565223002/diff/140001/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp#newcode1754 ...
4 years ago (2016-12-20 19:59:32 UTC) #35
bokan
Please add another test but otherwise lgtm! https://codereview.chromium.org/2565223002/diff/160001/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp File third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp (right): https://codereview.chromium.org/2565223002/diff/160001/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp#newcode1035 third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp:1035: webViewImpl()->settings()->setPreferCompositingToLCDTextEnabled(false); Please ...
4 years ago (2016-12-20 20:09:07 UTC) #36
yigu
Thanks David :) https://codereview.chromium.org/2565223002/diff/160001/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp File third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp (right): https://codereview.chromium.org/2565223002/diff/160001/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp#newcode1035 third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp:1035: webViewImpl()->settings()->setPreferCompositingToLCDTextEnabled(false); On 2016/12/20 20:09:07, bokan wrote: ...
4 years ago (2016-12-20 20:17:11 UTC) #37
weiliangc
cc/ LGTM
4 years ago (2016-12-20 20:36:24 UTC) #39
jwd
lgtm
4 years ago (2016-12-20 20:40:33 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2565223002/180001
4 years ago (2016-12-21 00:03:51 UTC) #48
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years ago (2016-12-21 00:10:58 UTC) #51
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/e92b679fee2d010570bb1ea1896b443d01eb5a84 Cr-Commit-Position: refs/heads/master@{#439944}
4 years ago (2016-12-21 00:14:35 UTC) #53
pdr.
https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_scrolling_reason.h#newcode34 cc/input/main_thread_scrolling_reason.h:34: kHasOpacity = 1 << 16, Why does opacity (and ...
3 years, 11 months ago (2017-01-07 22:25:26 UTC) #55
bokan
https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_scrolling_reason.h#newcode34 cc/input/main_thread_scrolling_reason.h:34: kHasOpacity = 1 << 16, On 2017/01/07 22:25:25, pdr. ...
3 years, 11 months ago (2017-01-09 13:29:08 UTC) #56
pdr.
https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_scrolling_reason.h File cc/input/main_thread_scrolling_reason.h (right): https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_scrolling_reason.h#newcode34 cc/input/main_thread_scrolling_reason.h:34: kHasOpacity = 1 << 16, On 2017/01/09 at 13:29:08, ...
3 years, 11 months ago (2017-01-09 17:22:12 UTC) #57
bokan
3 years, 11 months ago (2017-01-09 17:54:57 UTC) #59
Message was sent while issue was closed.
+flackr@ who's been OOO but should have more context here and is back now.

https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_s...
File cc/input/main_thread_scrolling_reason.h (right):

https://codereview.chromium.org/2565223002/diff/180001/cc/input/main_thread_s...
cc/input/main_thread_scrolling_reason.h:34: kHasOpacity = 1 << 16,
On 2017/01/09 17:22:12, pdr. wrote:
> On 2017/01/09 at 13:29:08, bokan wrote:
> > On 2017/01/07 22:25:25, pdr. wrote:
> > > Why does opacity (and later patches: transform) prevent composited
> scrolling? Is
> > > it due to how opacity and lcd text interact?
> > 
> > Right, I think it's because in order to do LCD text antialiasing, you need
to
> know what's behind the text. Opacity means other layers in CC might change
> what's behind the text. Transforms I'm less sure, I'm guessing some transforms
> might "ruin" the antialiasing (e.g. perspective might distort the subpixel
> adjustments across multiple pixels)? Just to clarify, these patches are just
> adding metrics to existing compositing outs rather than actually changing
what's
> getting composited.
> 
> Thanks for the explanation. Would you be okay with changing kHasOpacity to
> kHasOpacityAndLCDText? I can put up a patch to do that.

Yeah, that sounds clearer. sgtm


> Also, aren't we using these flags for real performance changes by forcing the
> main thread? If not, why don't we put them on a different structure instead of
> re-using MainThreadScrollingReason?

For these newly added flags, my understanding is that we wouldn't have created a
cc::Layer in these cases at all so there was nothing to put the reason onto.
We're now storing these on the ScrollableArea as well as the cc::Layer but (on
main thread) it's being used to track stats rather than making compositing
decisions.

Powered by Google App Engine
This is Rietveld 408576698