Bug 1662649 - Don't hard-assert IsSupported for pref-gated WebGL exts. r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D89176
This commit is contained in:
Jeff Gilbert 2020-09-02 17:13:53 +00:00
Родитель f852bf592b
Коммит 29b70b4e07
1 изменённых файлов: 14 добавлений и 2 удалений

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

@ -28,7 +28,13 @@ bool WebGLExtensionBlendMinMax::IsSupported(const WebGLContext* webgl) {
WebGLExtensionExplicitPresent::WebGLExtensionExplicitPresent(
WebGLContext* const webgl)
: WebGLExtensionBase(webgl) {
MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported.");
if (!IsSupported(webgl)) {
NS_WARNING(
"Constructing WebGLExtensionExplicitPresent but IsSupported() is "
"false!");
// This was previously an assert, but it seems like we get races against
// StaticPrefs changes/initialization?
}
}
bool WebGLExtensionExplicitPresent::IsSupported(
@ -102,7 +108,13 @@ bool WebGLExtensionTextureNorm16::IsSupported(const WebGLContext* const webgl) {
WebGLExtensionTextureNorm16::WebGLExtensionTextureNorm16(WebGLContext* webgl)
: WebGLExtensionBase(webgl) {
MOZ_ASSERT(IsSupported(webgl));
if (!IsSupported(webgl)) {
NS_WARNING(
"Constructing WebGLExtensionTextureNorm16 but IsSupported() is "
"false!");
// This was previously an assert, but it seems like we get races against
// StaticPrefs changes/initialization?
}
auto& fua = *webgl->mFormatUsage;