[web] dont look up webgl params if no GPU is available (flutter/engine#38948)

This commit is contained in:
Jonah Williams 2023-01-19 10:33:38 -08:00 committed by GitHub
parent 7ed656d596
commit 949d3d458b

View File

@ -336,9 +336,6 @@ class Surface {
majorVersion: webGLVersion.toDouble(),
),
).toInt();
if (_sampleCount == -1 || _stencilBits == -1) {
_initWebglParams();
}
_glContext = glContext;
@ -348,6 +345,9 @@ class Surface {
throw CanvasKitError('Failed to initialize CanvasKit. '
'CanvasKit.MakeGrContext returned null.');
}
if (_sampleCount == -1 || _stencilBits == -1) {
_initWebglParams();
}
// Set the cache byte limit for this grContext, if not specified it will
// use CanvasKit's default.
_syncCacheBytes();