Bug 1618325 - Check IsContextLost in ReadPixels. r=lsalzman

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Gilbert 2020-03-05 15:54:13 +00:00
Родитель 8ffc35b01e
Коммит 744ecc654e
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -3980,6 +3980,8 @@ void ClientWebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
bool ClientWebGLContext::ReadPixels_SharedPrecheck(
CallerType aCallerType, ErrorResult& out_error) const {
if (IsContextLost()) return false;
if (mCanvasElement && mCanvasElement->IsWriteOnly() &&
aCallerType != CallerType::System) {
JsWarning("readPixels: Not allowed");