Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 78bbea0

Browse files
[web] dont look up webgl params if no GPU is available (#38948)
1 parent a0e3c14 commit 78bbea0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/web_ui/lib/src/engine/canvaskit/surface.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ class Surface {
336336
majorVersion: webGLVersion.toDouble(),
337337
),
338338
).toInt();
339-
if (_sampleCount == -1 || _stencilBits == -1) {
340-
_initWebglParams();
341-
}
342339

343340
_glContext = glContext;
344341

@@ -348,6 +345,9 @@ class Surface {
348345
throw CanvasKitError('Failed to initialize CanvasKit. '
349346
'CanvasKit.MakeGrContext returned null.');
350347
}
348+
if (_sampleCount == -1 || _stencilBits == -1) {
349+
_initWebglParams();
350+
}
351351
// Set the cache byte limit for this grContext, if not specified it will
352352
// use CanvasKit's default.
353353
_syncCacheBytes();

0 commit comments

Comments
 (0)