зеркало из https://github.com/mozilla/gecko-dev.git
d19566e09c
All animated images on a page are currently registered with the refresh driver and advance with the tick refresh. These animations may not even be in view, and if they are large and thus cause redecoding, cause a marked increase in CPU usage for no benefit to the user. This patch adds an additional flag, mCompositedFrameRequested, to the AnimationState used by FrameAnimator. It is set to true each time the current animated image frame is requested via FrameAnimator::GetCompositedFrame. It is set to false each time the frame is advanced in FrameAnimator::AdvanceFrame (via FrameAnimator::RequestRefresh). If it is true when FrameAnimator::RequestRefresh is called, then it will advance the animation according to the normal rules. If it is false, then it will set the current animation time to the current time instead of advancing. This should not cause the animation to fall behind anymore or skip frames more than it does today. This is because if FrameAnimator::GetCompositedFrame is not called, then the internal state of the animation is advancing ahead of what the user sees. Once it is called, the new frame is far ahead of the previously displayed frame. The only difference now is that we will display the previous frame for slightly longer until the next refresh tick. Note that if an animated image is layerized (should not happen today) or otherwise uses an ImageContainer, this optimization fails. While we know whether or not we have an image container, we do not know if anything is actively using it. |
||
---|---|---|
.. | ||
2d | ||
angle | ||
cairo | ||
config | ||
doc | ||
docs | ||
gl | ||
graphite2 | ||
harfbuzz | ||
ipc | ||
layers | ||
ots | ||
qcms | ||
sfntly | ||
skia | ||
src | ||
tests | ||
thebes | ||
vr | ||
webrender | ||
webrender_api | ||
webrender_bindings | ||
wrench | ||
ycbcr | ||
moz.build |