Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Prev Previous commit
Next Next commit
++
  • Loading branch information
jonahwilliams committed Jan 24, 2023
commit b86e621172f80822b2c078876e3d70f645f9ec6f
5 changes: 5 additions & 0 deletions lib/web_ui/lib/src/engine/canvaskit/surface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ class Surface {
// Or at least cache the estimated window size.
createOrUpdateSurface(const ui.Size(1, 1));
}
// No context means software rendering.
if (_grContext == null) {
return _makeSoftwareCanvasSurface(
htmlCanvas!, 'Failed to initialize WebGL surface');
}
final SkSurface? skSurface = canvasKit.MakeRenderTarget(
_grContext!,
size.width.ceil(),
Expand Down