-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Currently, the Flutter engine enables the JPEG, WEBP, GIF, ICO, BMP and WBMP codecs on all supported platforms. This allows us to guarantee being able to decode/encode (not all encoders are available to the framework) these formats. We need to ship libraries for these formats in the engine. This has worked out well so far for the following reasons:
- Easy to guarantee whether a given format can be decoded by the engine.
- Easy to build and package the libraries in the engine.
- The Skia team monitors contributions to these projects and ensures that performance enhancing patches are immediately applied.
The downsides to this approach are:
- Adds to the overall size of the engine (about 7% of the size of the engine is codecs).
- The Flutter team needs to update dependencies regularly.
- The latest codecs available on the platform (for example HEIF) either need to be shipped in the engine and these dependencies need to be kept up to date by the Flutter team.
The Flutter team has investigated using platform codecs in the past. But, writing platform bindings was seen to be a significant enough undertaking to put this task lower in the list of priorities (not to mention losing some of the advantages mentioned above). The team was also not sure if these bindings should exist in the Flutter engine or Skia.
It is possible that a hybrid approach can be taken as well.