Skip to content

[web] CanvasKit image decoders start animated images from second frame #95281

@yjbanov

Description

@yjbanov

When using CanvasKit-bundled image decoders Flutter Web decodes animated images starting from the second frame rather than from the first frame. The issue is that CanvasKit.MakeAnimatedImageFromEncoded advances to the first frame automatically, but Flutter doesn't know the duration of the first frame. So we have to call decodeNextFrame at least once to get the duration (repro). This was recently fixed in CanvasKit (google/skia@44c81d1#diff-a40c963d58980093361179fa6b6c9832abf234df8d3ff257bebaa5d7704f37d0), so we can now fix it in Flutter Web too.

flutter/engine#30224 added a test that covers this behavior, so when this is fixed that test needs to be updated.

Metadata

Metadata

Assignees

Labels

P1High-priority issues 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.platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions