When using the CoreAnimation present path, use opaque layers for opaque parts of the window
Categories
(Core :: Widget: Cocoa, enhancement, P2)
Tracking
()
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(3 files)
Updated•6 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D40553
Assignee | ||
Comment 3•5 years ago
|
||
This can be verified by starting Firefox with the environment variables
CA_LAYER_SURFACE=0 CA_COLOR_OPAQUE=1
Transparent parts of the window will be red, and opaque parts will be green.
With this patch, the main browser window will be opaque except for the vibrant
areas, i.e. the tab bar and any open sidebars, which will be transparent.
Full screen video will be opaque.
Depends on D40554
Assignee | ||
Comment 4•5 years ago
|
||
On my 2013 Macbook Pro, the patches in this bug reduce power usage of a 60fps compositor animation by 3 Watts in a window with a vibrant tab bar. If I switch to the dark theme, which does not use vibrancy in the tab bar, overall power usage is reduced by 7 Watts.
Testcase, run on 10.14.5: data:text/html,<style>div { margin: 100px; width: 200px; height: 200px; background: blue; animation: 1s rotate linear infinite; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }</style><div></div>
Before, with CoreAnimation:
Overall 19.5 W, GPU share: 6.9 W
After, default theme (vibrant tab bar):
Overall: 16.8 W, GPU share: 4.5 W
After, dark theme (no vibrancy):
Overall: 12.3 W, GPU share: 3.0 W
Without CoreAnimation, transparent context:
Overall: 19.0 W, GPU share: 7.9 W
Without CoreAnimation, opaque context:
Overall: 10.4 W, GPU share: 2.6 W
The next step will be to set things up in such a way that the transparent layers don't need to be refreshed for web content animations. This will require creating separate NativeLayerCA objects for the different parts of the window and teaching CompositorOGL and BasicCompositor to draw into those smaller layers separately.
Assignee | ||
Comment 5•5 years ago
|
||
On pages where the compositing is heavy enough that the GPU stays busy at all times anyway, the patch does not make a difference to power usage.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7e25fc7daf50
https://hg.mozilla.org/mozilla-central/rev/1d0a11d0acd1
https://hg.mozilla.org/mozilla-central/rev/9905ea1c2739
Updated•5 years ago
|
Description
•