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

Conversation

@harryterkelsen
Copy link
Contributor

If we've already initialized CanvasKit, don't re-initialize it on hot restart.

Should help with dart-lang/dart-pad#1860

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.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

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 May 10, 2021
@harryterkelsen harryterkelsen requested a review from yjbanov May 10, 2021 23:15
@google-cla google-cla bot added the cla: yes label May 10, 2021
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm


@JS('window.flutterCanvasKit')
external set windowFlutterCanvasKit(CanvasKit value);
external CanvasKit? get windowFlutterCanvasKit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use a more generic name so this method is compatible with Cobalt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I purposely left it open because it's unknown if we will need to call CanvasKitInit on the Cobalt implementation. So far now this is flutter-specific because it should be an already-initialized CanvasKit instance. If it turns out that the native CanvasKit instance is already initialized, we can rename this to be the same as the native CanvasKit object.

@harryterkelsen harryterkelsen merged commit cba6c1e into flutter:master May 13, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2021
cbracken pushed a commit to flutter/flutter that referenced this pull request May 13, 2021
* 7adb8de Roll Skia from 6b719c25cade to ca9f6a855071 (3 revisions) (flutter/engine#26127)

* a1062aa [uwptool] Support lookup of full package name (flutter/engine#26121)

* 01ce6a1 Get android_lint deps using gclient rather than pub. (flutter/engine#26106)

* cba6c1e Use cached CanvasKit instance if available (flutter/engine#26059)

* b0bb8ea Switch PlatformMessages to hold data in Mappings (flutter/engine#25867)
johnpryan added a commit to dart-lang/dart-pad that referenced this pull request May 17, 2021
* remove duplicate canvaskit.js files

This is a workaround for #1860 until flutter/engine#26059
lands or we can switch to the HTML renderer in dart-services

* simplify removeCanvaskit function
johnpryan added a commit to dart-lang/dart-pad that referenced this pull request Nov 3, 2021
Engine commit: flutter/engine#26059
Flutter SDK commit: flutter/flutter@d9db3ea

Commit is available on stable:

arewethereyet d9db3ea6e6b1cccda5838b11c156595f109df68c
Commit is merged into:
  origin/master
  origin/dev
  origin/beta
  origin/stable
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants