Skip to content

[web] Remove image codecs from canvaskit_chromium#178133

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
mdebbar:no_decoders
May 22, 2026
Merged

[web] Remove image codecs from canvaskit_chromium#178133
auto-submit[bot] merged 10 commits into
flutter:masterfrom
mdebbar:no_decoders

Conversation

@mdebbar
Copy link
Copy Markdown
Contributor

@mdebbar mdebbar commented Nov 6, 2025

Fixes #122331

Build with image codecs (before) without image codecs (after) Difference %
canvaskit_chromium 1.54 MB 1.45 MB $${\color{green}9\%}$$
canvaskit_webparagraph 1.12 MB 1.01 MB $${\color{green}10\%}$$

@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Nov 6, 2025
@github-actions github-actions Bot added the platform-web Web applications specifically label Nov 7, 2025
@kevmoo
Copy link
Copy Markdown
Contributor

kevmoo commented Nov 7, 2025

This makes uploaded bits smaller, right? By how much?
Have we confirmed on older Chrome builds? When was this fixed?

@mdebbar
Copy link
Copy Markdown
Contributor Author

mdebbar commented Nov 7, 2025

This makes uploaded bits smaller, right? By how much?

Yes, added the numbers to the PR description. It's ±100KB smaller.

Have we confirmed on older Chrome builds? When was this fixed?

This PR is a no-op for apps (other than making CanvasKit's size smaller). The web engine has been using the browser ImageDecoder exclusively on Chrome for quite a while now. There was one remaining edge case that required Skia decoders, but that was addressed in flutter/engine#53201 more than a year ago.

TL;DR: Flutter web apps today in Chrome are already not using the Skia decoders. This PR is removing the unused decoders to save size.

@mdebbar mdebbar marked this pull request as ready for review November 12, 2025 20:40
harryterkelsen
harryterkelsen previously approved these changes Nov 19, 2025
Copy link
Copy Markdown
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit


void _imageTests() {
test('MakeAnimatedImageFromEncoded makes a non-animated image', () {
if (configuration.canvasKitVariant == CanvasKitVariant.chromium) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use skip: instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the first thing I tried :)

It doesn't work because the configuration object is initialized after skip is evaluated. The configuration value is initialized in a setUpAll callback, so the only reliable place to get the correct value of configuration.canvasKitVariant is inside the test body.

@flutter-dashboard
Copy link
Copy Markdown

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Piinks
Copy link
Copy Markdown
Contributor

Piinks commented Feb 23, 2026

Greetings from stale PR triage! 👋
Is this change still on your radar?

@yjbanov
Copy link
Copy Markdown
Contributor

yjbanov commented Apr 28, 2026

This is in our backlog to complete soon. Should we land this?

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 18, 2026
harryterkelsen
harryterkelsen previously approved these changes May 18, 2026
Copy link
Copy Markdown
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions github-actions Bot removed the CICD Run CI/CD label May 19, 2026
@mdebbar mdebbar added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels May 19, 2026
@mdebbar mdebbar requested a review from harryterkelsen May 22, 2026 18:17
Copy link
Copy Markdown
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@auto-submit auto-submit Bot added this pull request to the merge queue May 22, 2026
Merged via the queue into flutter:master with commit 3b97cd4 May 22, 2026
200 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 22, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request May 26, 2026
Roll Flutter from e03b91f1fe34 to f3a4b9897834 (63 revisions)

flutter/flutter@e03b91f...f3a4b98

2026-05-26 47866232+chunhtai@users.noreply.github.com Update batch release doc to reflect latest workflow (flutter/flutter#186979)
2026-05-26 engine-flutter-autoroll@skia.org Roll Skia from 0442274cc696 to 27a819894f7c (5 revisions) (flutter/flutter#187094)
2026-05-26 bkonyi@google.com [Tool Robustness] Gracefully handle asynchronous subprocess crashes and connection timeouts (flutter/flutter#186964)
2026-05-26 bkonyi@google.com [pubspec] Bump Dart SDK constraint to ^3.13.0 (flutter/flutter#186957)
2026-05-26 engine-flutter-autoroll@skia.org Roll Dart SDK from 7eb54169841d to 00e625453c43 (1 revision) (flutter/flutter#187086)
2026-05-26 bdero@google.com [Impeller] Retire Y-coord-scale plumbing by flipping GLES at the vertex stage (flutter/flutter#186556)
2026-05-26 engine-flutter-autoroll@skia.org Roll Skia from f4f294bdf98d to 0442274cc696 (2 revisions) (flutter/flutter#187079)
2026-05-26 kevmoo@users.noreply.github.com [flutter_tools] Fix version cache poisoning from git environment variables (flutter/flutter#186595)
2026-05-26 bkonyi@google.com [Tool] Handle DTD connection failures gracefully in widget-preview (flutter/flutter#186952)
2026-05-25 engine-flutter-autoroll@skia.org Roll Skia from 9d1adb5f2427 to f4f294bdf98d (1 revision) (flutter/flutter#187056)
2026-05-25 engine-flutter-autoroll@skia.org Roll Skia from 4dd78179e6ec to 9d1adb5f2427 (1 revision) (flutter/flutter#187048)
2026-05-25 engine-flutter-autoroll@skia.org Roll Skia from 1f26101197bf to 4dd78179e6ec (4 revisions) (flutter/flutter#187044)
2026-05-24 engine-flutter-autoroll@skia.org Roll Skia from bbe9ccc2bdbf to 1f26101197bf (1 revision) (flutter/flutter#187016)
2026-05-24 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from nsgcNDlZOuweOvy3Q... to Itd2Jq_ZIABH2rW7B... (flutter/flutter#187032)
2026-05-23 engine-flutter-autoroll@skia.org Roll Dart SDK from 7e0f28eb5315 to 7eb54169841d (1 revision) (flutter/flutter#187005)
2026-05-23 engine-flutter-autoroll@skia.org Roll Dart SDK from 90e55fa88456 to 7e0f28eb5315 (1 revision) (flutter/flutter#186990)
2026-05-23 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 6T6BY9PTftoG3vP_1... to nsgcNDlZOuweOvy3Q... (flutter/flutter#186984)
2026-05-23 chris@bracken.jp iOS] Migrate VSyncClient to a pure Obj-C implementation (#186166) (flutter/flutter#186935)
2026-05-23 30870216+gaaclarke@users.noreply.github.com Disables embedder_tests.cm for fuchsia (flutter/flutter#186969)
2026-05-23 engine-flutter-autoroll@skia.org Roll Dart SDK from b8414c46f6c7 to 90e55fa88456 (2 revisions) (flutter/flutter#186977)
2026-05-22 engine-flutter-autoroll@skia.org Roll Skia from 6fdb013d1953 to bbe9ccc2bdbf (1 revision) (flutter/flutter#186980)
2026-05-22 mdebbar@google.com [web] Fix cutoff text in WebParagraph (flutter/flutter#186819)
2026-05-22 1961493+harryterkelsen@users.noreply.github.com fix(web): Removes the iterative downscaling hack (flutter/flutter#186914)
2026-05-22 30870216+gaaclarke@users.noreply.github.com opts the linux embedder into sdf rendering (flutter/flutter#186909)
2026-05-22 engine-flutter-autoroll@skia.org Roll Skia from dae8778ca40d to 6fdb013d1953 (5 revisions) (flutter/flutter#186970)
2026-05-22 dacoharkes@google.com Fix hooks inputs outputs rebuilt (flutter/flutter#186701)
2026-05-22 30870216+gaaclarke@users.noreply.github.com adds linux impeller integration test for external textures (flutter/flutter#186759)
2026-05-22 kevmoo@users.noreply.github.com fix(flutter_tools): defensively catch DWDS unregistered service extension errors (flutter/flutter#186896)
2026-05-22 bdero@google.com [Impeller] Add golden harness support to the renderer test layer (flutter/flutter#186735)
2026-05-22 mdebbar@google.com [web] Remove image codecs from canvaskit_chromium (flutter/flutter#178133)
2026-05-22 30870216+gaaclarke@users.noreply.github.com opts all macos into wide gamut (flutter/flutter#186277)
2026-05-22 engine-flutter-autoroll@skia.org Roll Skia from 356185490a75 to dae8778ca40d (9 revisions) (flutter/flutter#186949)
2026-05-22 1598289+lukemmtt@users.noreply.github.com Filter out SwiftPM schemes when fetching schemes (flutter/flutter#186006)
2026-05-22 engine-flutter-autoroll@skia.org Roll Packages from 3754d04 to 69cf959 (1 revision) (flutter/flutter#186950)
2026-05-22 engine-flutter-autoroll@skia.org Roll Dart SDK from eca46bec956d to b8414c46f6c7 (2 revisions) (flutter/flutter#186944)
2026-05-22 30870216+gaaclarke@users.noreply.github.com Saves a DeviceHolderVK with the CommandPoolVK (flutter/flutter#186749)
2026-05-22 engine-flutter-autoroll@skia.org Roll Dart SDK from e0d509fd676e to eca46bec956d (1 revision) (flutter/flutter#186922)
2026-05-22 bkonyi@google.com [ Tool ] Stop generating widget preview scaffold under $TMP (flutter/flutter#186476)
2026-05-21 737941+loic-sharma@users.noreply.github.com Fix typo in StretchingOverscrollIndicator docs (flutter/flutter#186897)
2026-05-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 28c7cb5a8e8d to e0d509fd676e (1 revision) (flutter/flutter#186903)
2026-05-21 jason-simmons@users.noreply.github.com Fix some issues in the integration between EmbedderExternalViewEmbedder and Impeller (flutter/flutter#184905)
2026-05-21 jason-simmons@users.noreply.github.com Fix a potential buffer overflow in the animated PNG decoder when parsing malformed fdAT chunks (flutter/flutter#186700)
2026-05-21 engine-flutter-autoroll@skia.org Roll Skia from 2ff20950975d to 356185490a75 (5 revisions) (flutter/flutter#186892)
2026-05-21 flar@google.com Add primitive shadows to rendering benchmark (flutter/flutter#186779)
2026-05-21 15619084+vashworth@users.noreply.github.com Move prefetchSwiftPackages to be per platform (flutter/flutter#186468)
2026-05-21 okorohelijah@google.com Upgrade iOS version (flutter/flutter#186889)
...
@mdebbar mdebbar deleted the no_decoders branch May 26, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Remove image codecs from CanvasKit Chromium

6 participants