-
Notifications
You must be signed in to change notification settings - Fork 6k
Use cached CanvasKit instance if available #26059
Use cached CanvasKit instance if available #26059
Conversation
This could be useful for hot restart or for DartPad.
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| @JS('window.flutterCanvasKit') | ||
| external set windowFlutterCanvasKit(CanvasKit value); | ||
| external CanvasKit? get windowFlutterCanvasKit; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
* 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)
* 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
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

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
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.