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

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed)

Created:
5 years, 5 months ago by Sami
Modified:
5 years, 2 months ago
CC:
darktears, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-rendering, dglazkov+blink, eae+blinkwatch, Eric Willigers, jchaffraix+rendering, leviw+renderwatch, MikeB, pdr., pdr+renderingwatchlist_chromium.org, rjwright, rwlbuis, shans, sof, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Throttle rendering pipeline for invisible frames This patch avoids computing animations (rAF), layout, style, compositing or painting updates for cross origin frames which aren't visible in the root viewport. This helps to reduce the amount of processing we do for updates which would not be seen by the user anyway. Design doc: https://docs.google.com/document/d/1Dd4qi1b_iX-OCZpelvXxizjq6dDJ76XNtk37SZEoTYQ/edit#heading=h.baug2xj0sa2b BUG=487937

Patch Set 1 #

Patch Set 2 : Switched to visibility observers. #

Patch Set 3 : Handle frame hierarchy changes #

Patch Set 4 : Fix visibility check #

Patch Set 5 : Compute clipped visibility. #

Patch Set 6 : Comment out debug prints #

Patch Set 7 : Added cross origin check. #

Patch Set 8 : Fix observe/unobserve pogoing. #

Patch Set 9 : Early-out at any level of the hierarchy. #

Patch Set 10 : Try to throttle the entire pipeline instead (WIP) #

Patch Set 11 : Schedule various updates on expose -- has some lifecycle issues. #

Patch Set 12 : Lifecycle throttling checkpoint; doesn't work. #

Patch Set 13 : "Works" if you squint hard enough. #

Patch Set 14 : Lifecycle adjustments. #

Patch Set 15 : Update throttling at start of lifecycle. #

Patch Set 16 : Build fix. #

Patch Set 17 : Handle forced lifecycle updates. Avoid false animations from hit tests. #

Patch Set 18 : Split animation and lifecycle throttling into two bits. #

Patch Set 19 : Fix hit testing loop. #

Patch Set 20 : Simplify. #

Patch Set 21 : More simplification. #

Patch Set 22 : HitTest feedback loop investigation. #

Patch Set 23 : Avoid lifecycle violation during reload. #

Patch Set 24 : More simplification. Hack for running layout tests. #

Patch Set 25 : Rebased and cleaned up. #

Patch Set 26 : Simplification and renames. #

Patch Set 27 : Rebased. #

Patch Set 28 : Clean up logic. #

Total comments: 22

Patch Set 29 : Review comments. #

Total comments: 26

Patch Set 30 : Ojan's comments. #

Total comments: 1

Patch Set 31 : Adjust painting early-outs. #

Patch Set 32 : Keep animation time consistent. #

Total comments: 4

Patch Set 33 : Chris's comments, adjust asserts for slimming paint. #

Patch Set 34 : LayoutFrame => LayoutPart to make paint throttling work. #

Patch Set 35 : Fixed a layout test crash caused by Part not having a Widget. #

Patch Set 36 : Spun commit notification to a separate patch. #

Patch Set 37 : Initial set of tests. #

Patch Set 38 : Add layout tests. #

Total comments: 6

Patch Set 39 : Use Sim tests instead. #

Patch Set 40 : Rebased to post merge awesomeness. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+286 lines, -22 lines) Patch
M components/test_runner/web_test_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentLifecycle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 3 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentLifecycle.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +11 lines, -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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 8 chunks +40 lines, -3 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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 15 chunks +148 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +10 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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 chunks +16 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/page/PageAnimator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 3 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/DeprecatedPaintLayerPainterTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/ViewPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/web.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebWidget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (8 generated)
Sami
Hey Ojan, I've now got throttling more or less working for the entire rendering pipeline. ...
5 years, 3 months ago (2015-08-28 18:36:47 UTC) #2
ojan
This looks very close to me! So excited! \o/ Coincidentally, esprehn has been making a ...
5 years, 3 months ago (2015-09-01 19:56:48 UTC) #4
dstockwell
https://codereview.chromium.org/1246173002/diff/520001/Source/core/page/PageAnimator.cpp File Source/core/page/PageAnimator.cpp (right): https://codereview.chromium.org/1246173002/diff/520001/Source/core/page/PageAnimator.cpp#newcode46 Source/core/page/PageAnimator.cpp:46: continue; I think we might want to split out ...
5 years, 3 months ago (2015-09-01 23:52:24 UTC) #6
Sami
+esprehn +mkwst -- Could you check that the security origin check looks sane? https://codereview.chromium.org/1246173002/diff/520001/Source/core/frame/FrameView.cpp File ...
5 years, 3 months ago (2015-09-02 10:46:03 UTC) #10
Mike West
https://codereview.chromium.org/1246173002/diff/540001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/1246173002/diff/540001/Source/core/frame/FrameView.cpp#newcode4074 Source/core/frame/FrameView.cpp:4074: hasCrossedSecurityOrigin = !origin->canAccess(parentOrigin); This looks pretty reasonable. That said: ...
5 years, 3 months ago (2015-09-02 11:30:08 UTC) #11
ojan
mpb: FYI since this overlaps a lot with IntersectionObserver implementation and will likely use that ...
5 years, 3 months ago (2015-09-02 11:33:27 UTC) #12
chrishtr
https://codereview.chromium.org/1246173002/diff/520001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/1246173002/diff/520001/Source/core/frame/FrameView.cpp#newcode4045 Source/core/frame/FrameView.cpp:4045: // TODO(skyostil): Expand the viewport to make it less ...
5 years, 3 months ago (2015-09-02 17:42:47 UTC) #14
ojan
On 2015/09/02 at 17:42:47, chrishtr wrote: > https://codereview.chromium.org/1246173002/diff/520001/Source/core/frame/FrameView.cpp > File Source/core/frame/FrameView.cpp (right): > > https://codereview.chromium.org/1246173002/diff/520001/Source/core/frame/FrameView.cpp#newcode4045 ...
5 years, 3 months ago (2015-09-02 18:05:59 UTC) #15
esprehn
https://codereview.chromium.org/1246173002/diff/540001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/1246173002/diff/540001/Source/core/frame/FrameView.cpp#newcode1324 Source/core/frame/FrameView.cpp:1324: void FrameView::setLifecycleThrottlingModeRecursive(LifecycleThrottlingMode lifecycleThrottlingMode) This actually doesn't need to be ...
5 years, 3 months ago (2015-09-02 21:10:38 UTC) #16
dglazkov
https://codereview.chromium.org/1246173002/diff/540001/public/web/WebWidget.h File public/web/WebWidget.h (right): https://codereview.chromium.org/1246173002/diff/540001/public/web/WebWidget.h#newcode113 public/web/WebWidget.h:113: virtual void didCommitCompositorFrame() { } Can you help me ...
5 years, 3 months ago (2015-09-02 21:12:06 UTC) #18
ojan
https://codereview.chromium.org/1246173002/diff/540001/public/web/WebWidget.h File public/web/WebWidget.h (right): https://codereview.chromium.org/1246173002/diff/540001/public/web/WebWidget.h#newcode113 public/web/WebWidget.h:113: virtual void didCommitCompositorFrame() { } On 2015/09/02 at 21:12:06, ...
5 years, 3 months ago (2015-09-02 21:17:12 UTC) #19
Sami
Thanks for all the great feedback everyone. I'll respond bit by bit as I go ...
5 years, 3 months ago (2015-09-03 14:07:56 UTC) #20
dglazkov
https://codereview.chromium.org/1246173002/diff/520001/Source/web/WebViewImpl.cpp File Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1246173002/diff/520001/Source/web/WebViewImpl.cpp#newcode1942 Source/web/WebViewImpl.cpp:1942: view->updateThrottling(); On 2015/09/02 at 11:33:27, ojan wrote: > On ...
5 years, 3 months ago (2015-09-03 16:51:28 UTC) #21
Sami
On 2015/09/03 16:51:28, dglazkov wrote: > I am still a little bit confused, please forgive ...
5 years, 3 months ago (2015-09-03 17:09:27 UTC) #22
Sami
https://codereview.chromium.org/1246173002/diff/540001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/1246173002/diff/540001/Source/core/frame/FrameView.cpp#newcode1324 Source/core/frame/FrameView.cpp:1324: void FrameView::setLifecycleThrottlingModeRecursive(LifecycleThrottlingMode lifecycleThrottlingMode) On 2015/09/02 21:10:37, esprehn wrote: > ...
5 years, 3 months ago (2015-09-03 17:23:20 UTC) #23
chrishtr
On 2015/09/03 at 17:09:27, skyostil wrote: > On 2015/09/03 16:51:28, dglazkov wrote: > > I ...
5 years, 3 months ago (2015-09-03 17:39:51 UTC) #24
Sami
On 2015/09/02 18:05:59, ojan wrote: > > What you will need to do is make ...
5 years, 3 months ago (2015-09-03 17:42:21 UTC) #25
chrishtr
On 2015/09/02 at 18:05:59, ojan wrote: > On 2015/09/02 at 17:42:47, chrishtr wrote: > > ...
5 years, 3 months ago (2015-09-03 17:44:36 UTC) #26
Sami
Thanks for expanding on that Chris -- I was being opaque. On 2015/09/03 17:39:51, chrishtr ...
5 years, 3 months ago (2015-09-03 17:46:04 UTC) #27
chrishtr
https://codereview.chromium.org/1246173002/diff/560001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/1246173002/diff/560001/Source/core/frame/FrameView.cpp#newcode3807 Source/core/frame/FrameView.cpp:3807: if (shouldThrottleRenderingPipeline()) This is not the right place. Instead ...
5 years, 3 months ago (2015-09-03 18:03:58 UTC) #28
chrishtr
On 2015/09/03 at 18:03:58, chrishtr wrote: > https://codereview.chromium.org/1246173002/diff/560001/Source/core/frame/FrameView.cpp > File Source/core/frame/FrameView.cpp (right): > > https://codereview.chromium.org/1246173002/diff/560001/Source/core/frame/FrameView.cpp#newcode3807 ...
5 years, 3 months ago (2015-09-03 18:06:57 UTC) #29
Sami
https://codereview.chromium.org/1246173002/diff/520001/Source/web/WebViewImpl.cpp File Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1246173002/diff/520001/Source/web/WebViewImpl.cpp#newcode1942 Source/web/WebViewImpl.cpp:1942: view->updateThrottling(); > Ah right. Doing it synchronously in updateLifecyclePhasesInternal ...
5 years, 3 months ago (2015-09-03 19:29:10 UTC) #30
dglazkov
On 2015/09/03 at 18:06:57, chrishtr wrote: > On 2015/09/03 at 18:03:58, chrishtr wrote: > > ...
5 years, 3 months ago (2015-09-03 20:50:36 UTC) #31
chrishtr
On 2015/09/03 at 20:50:36, dglazkov wrote: > On 2015/09/03 at 18:06:57, chrishtr wrote: > > ...
5 years, 3 months ago (2015-09-03 20:54:54 UTC) #32
Sami
Painting: Chris and I talked about the different paint throttling options here and agreed that ...
5 years, 3 months ago (2015-09-04 16:59:20 UTC) #33
chrishtr
On 2015/09/04 at 16:59:20, skyostil wrote: > Painting: > > Chris and I talked about ...
5 years, 3 months ago (2015-09-04 17:30:46 UTC) #34
chrishtr
https://codereview.chromium.org/1246173002/diff/600001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/1246173002/diff/600001/Source/core/frame/FrameView.cpp#newcode3799 Source/core/frame/FrameView.cpp:3799: if (shouldThrottleRenderingPipeline()) Add a TODO to get rid of ...
5 years, 3 months ago (2015-09-04 17:32:04 UTC) #35
Sami
Thanks Chris, I've added some TODOs. I think the last remaining architectural issue here is ...
5 years, 3 months ago (2015-09-07 17:27:17 UTC) #36
esprehn
https://codereview.chromium.org/1246173002/diff/720001/LayoutTests/fast/repaint/resources/ensure-no-repaints.js File LayoutTests/fast/repaint/resources/ensure-no-repaints.js (right): https://codereview.chromium.org/1246173002/diff/720001/LayoutTests/fast/repaint/resources/ensure-no-repaints.js#newcode8 LayoutTests/fast/repaint/resources/ensure-no-repaints.js:8: var frameCount = 10; This is racy, we don't ...
5 years, 3 months ago (2015-09-21 21:27:21 UTC) #37
Sami
Thanks for the sim test suggestion Elliott. I've merged the layout and unit tests into ...
5 years, 3 months ago (2015-09-23 18:31:07 UTC) #38
Sami
5 years, 3 months ago (2015-09-24 15:58:23 UTC) #39
Turns out you can't change the base url of an issue, so I've migrated to over to
https://codereview.chromium.org/1364063007/.

Powered by Google App Engine
This is Rietveld 408576698