Battery: Don't trigger composites on out-of-viewport native texture image updates
Categories
(Core :: Graphics: WebRender, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: bholley, Assigned: sotaro)
References
()
Details
(Whiteboard: [wr-amvp][wr-q2])
Attachments
(1 file, 5 obsolete files)
I noticed that a small video near the top of the page on cnn.com causes us to continue compositing after the video has been scrolled out of view. This is bad for battery on mobile.
STR:
(1) Enable the WR profiler overlay (compact is fine).
(2) Load http://fiddle.jshell.net/ovdjseLm/show/light/ , click play.
(3) Scroll down, and watch the FPS counter.
Presumably, WebRenderImageHost::UseTextureHost could check whether the texture is in view before scheduling composition.
Reporter | ||
Comment 1•6 years ago
|
||
Sotaro, would this be straightforward to fix?
Assignee | ||
Comment 2•6 years ago
|
||
It seems possible to pause/resume video's ScheduleComposition() by using result of build frame.
video's ScheduleComposition() is triggered in WebRenderImageHost::UseTextureHost() and WebRenderBridgeParent::MaybeGenerateFrame().
https://searchfox.org/mozilla-central/rev/78b2129696eaad2162fd26256b5a19a2b0d9840a/gfx/layers/wr/WebRenderImageHost.cpp#75
https://searchfox.org/mozilla-central/rev/78b2129696eaad2162fd26256b5a19a2b0d9840a/gfx/layers/wr/WebRenderBridgeParent.cpp#1203
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 3•6 years ago
•
|
||
Gecko has 2 mechanisms to suppress video rendering
[1] Skip Composite at LayerManagerComposite::UpdateAndRender(), since invalid. region is empty.
[2] Suspend video playback by element visibility at MediaDecoder::UpdateVideoDecodeMode()
At STR in comment 0 with Compositor, [1] was suppressed, but [2] still happened.
Assignee | ||
Comment 4•6 years ago
|
||
WebRender is going to handle [1] in comment 3. It makes WebRender to similar situation to compositor.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Assignee | ||
Comment 8•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
Link to a discussion on IRC.
https://mozilla.logbot.info/gfx/20190607#c16375960
Assignee | ||
Comment 11•6 years ago
|
||
Implementation seems to become simpler if we use a list of used external image ids than Attachment 9068648 [details] as we discussed in Comment 10.
Updated•6 years ago
|
Assignee | ||
Comment 12•6 years ago
|
||
WebRenderTextureHostWrapper updates its data outside of WebRender. If WebRenderTextureHostWrapper's update is the only resource update, Webrender does not need to re-build frame for rendering. In this case, WebRender just does rendering. If an Image of the WebRenderTextureHostWrapper's update is not visible, WebRender does not need rendering.
During frame build, Document detects if it has an visible Image that might be update outside of WebRender(async image). invalidate_async_image() invalidates WebRender's rendered frame if there is visible async image.
Assignee | ||
Comment 13•6 years ago
•
|
||
Attachment 9070899 [details] does not have necessary change around WebRenderBridgeParent::RecvEmptyTransaction()
Assignee | ||
Comment 14•6 years ago
•
|
||
Attachment 9070899 [details] needs to be updated by Bug 1558106 and Bug 1559284
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 15•6 years ago
|
||
Hmm, Attachment 9070899 [details] caused timeout failure on talos g1.
https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=252763516&revision=c7d72ab0d17b31913be4cefb46bb83b6643dbd90
Assignee | ||
Comment 16•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 17•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 19•6 years ago
|
||
Assignee | ||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
bugherder |
Assignee | ||
Updated•6 years ago
|
Description
•