Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@harryterkelsen
Copy link
Contributor

@harryterkelsen harryterkelsen commented Apr 7, 2022

Builds CanvasKit in the Flutter engine using the Emscripten toolchain.

Building CanvasKit will allow us to customize and iterate faster.

Fixes flutter/flutter#52588

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Apr 7, 2022
@harryterkelsen
Copy link
Contributor Author

/cc @eyebrowsoffire

@flutter-dashboard
Copy link

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.

@harryterkelsen harryterkelsen changed the title WIP cross compile wasm Build CanvasKit in the Flutter Engine Sep 13, 2022
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

DEPS Outdated
# which do not build for the web. This toolchain is needed to build CanvasKit
# for the web engine.
'download_emsdk': False,
'download_emsdk': True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even need it anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could be useful to disable for some builders

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely useful to avoid extra work for builders that don't need it.

I'm curious if this is the right time to default it to true. People working on this can add the varaible to their .gclient file for now to make sure they get it. If we flip this it will increase CI time across the board for engine builds without some recipe changes (unless that's already landed somewhere?).

tools/gn Outdated
gn_args['skia_canvaskit_enable_webgl'] = True
gn_args['skia_canvaskit_enable_webgpu'] = False
gn_args['skia_canvaskit_profile_build'
] = args.runtime_mode == 'profile' or args.runtime_mode == 'debug'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: some strange formatting on this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

return gn_args


def to_gn_wasm_args(args, gn_args):
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment explaining this function could be useful in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@harryterkelsen harryterkelsen merged commit c2a78b4 into flutter:main Sep 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 14, 2022
itsjustkevin pushed a commit to itsjustkevin/engine that referenced this pull request Sep 21, 2022
itsjustkevin added a commit that referenced this pull request Sep 21, 2022
* Add `Radius.clamp` and `Radius.clampValues` (#36106)

* Build CanvasKit in the Flutter Engine (#32510)

* Clamp `RRect` radii when deflating, assert on negative radii (#36062)

Co-authored-by: Greg Spencer <[email protected]>
Co-authored-by: Harry Terkelsen <[email protected]>
Oleh-Sv pushed a commit to Oleh-Sv/engine that referenced this pull request Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs tests platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build CanvasKit as part of the web engine

4 participants