Bug 1738926 Part 2: Stop enqueueing video when the layer gets overwhelmed. r=gfx...
commit22c350103dc2be48fdd45ea11b077c5d45dd0e15
authorBrad Werth <bwerth@mozilla.com>
Thu, 13 Jan 2022 19:42:37 +0000 (13 19:42 +0000)
committerBrad Werth <bwerth@mozilla.com>
Thu, 13 Jan 2022 19:42:37 +0000 (13 19:42 +0000)
tree6d2a4dd6250762245d48035daf7114410e80a2c7
parente4407de1adb2be5a1f88c49cf783de9a1da3ed29
Bug 1738926 Part 2: Stop enqueueing video when the layer gets overwhelmed. r=gfx-reviewers,mstange

There's no point in preparing a video sample when the layer can't accept it.
Limiting the enqueing in this case seems to prevent the macOS WindowServer
from maxxing out the CPU. Instead, the frame will get displayed using the
non-video method of directly setting the layer contents. The user will not
experience an interruption, but the layer will *never* hit detached mode
again. That's an acceptable outcome given that they layer was already
failing to handle the incoming frames and so detached mode was not
being achieved anyway.

Differential Revision: https://phabricator.services.mozilla.com/D135536
gfx/layers/NativeLayerCA.mm