diff --git a/lib/web_ui/lib/src/engine/canvaskit/surface.dart b/lib/web_ui/lib/src/engine/canvaskit/surface.dart index 91ba89d53fd15..f0e8a149574e0 100644 --- a/lib/web_ui/lib/src/engine/canvaskit/surface.dart +++ b/lib/web_ui/lib/src/engine/canvaskit/surface.dart @@ -138,9 +138,7 @@ class Surface { /// Creates a and SkSurface for the given [size]. CkSurface createOrUpdateSurface(ui.Size size) { if (useH5vccCanvasKit) { - if (_surface == null) { - _surface = CkSurface(canvasKit.getH5vccSkSurface(), null); - } + _surface ??= CkSurface(canvasKit.getH5vccSkSurface(), null); return _surface!; }