Skip to content

Web/Canvaskit renderer shouldn't abandon gl context on window resize. #117803

@jonahwilliams

Description

@jonahwilliams

The current implementation of the canvaskit renderer abandons the current gl context and creates a new one when resizing the window. This is an expensive operation, and causes the loss of all GPU backed textures associated with the previous context. At least part of the issue in #117786 is due to using a separate context, which I think is due partially to needing to deal with this on resize.

I don't think this should be necessary, its fairly straightforward to resize a canvas using webgl/webgl2 (see https://webgl2fundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html ). If we're missing APIs in Skia/Canvaskit then we should get those added instead of working around the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions