Bug 1731748 - React to GL_OUT_OF_MEMORY errors. r=gfx-reviewers,lsalzman
Bug 1731748 - React to GL_OUT_OF_MEMORY errors. r=gfx-reviewers,lsalzman

This patch checks glGetError after updating the texture cache and at the end of the frame looking for out-of-memory errors, in which case the frame is cancelled and a memory pressure event is triggered. If we fail to render too many times in succession due to OOM, trigger a crash.

Differential Revision: https://phabricator.services.mozilla.com/D126201

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/a5f509c40b9e2ccab258cb41611a8e05f7f48322

servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender