Skip to content

Commit

Permalink
[flutter_releases] Flutter stable 3.22.3 Engine Cherrypicks (#53686)
Browse files Browse the repository at this point in the history
# Flutter stable 3.22.3 Engine

## Scheduled Cherrypicks

- Roll dart revision: dart-lang/sdk@604651494
### Dart
- dart-lang/sdk#55979
- dart-lang/sdk#55943
### Engine
- flutter/flutter#149700
- flutter/flutter#149701
- flutter/flutter#149702
- flutter/flutter#149704
- flutter/flutter#149745
- flutter/flutter#149771
- #53183

---------

Co-authored-by: Martin Kustermann <[email protected]>
Co-authored-by: Jackson Gardner <[email protected]>
Co-authored-by: Christopher Fujino <[email protected]>
  • Loading branch information
4 people authored Jul 12, 2024
1 parent a3194fa commit a5180e4
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 83 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '1a849f91804e73a830844a5bf546a3f7027fc36d',
'dart_revision': '60465149414572c8ca189d8f65fdb39795c4b97d',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand Down
15 changes: 1 addition & 14 deletions ci/builders/mac_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,7 @@
"$flutter/osx_sdk": {
"sdk_version": "15a240d"
}
},
"tests": [
{
"language": "python3",
"name": "Impeller-golden, dart and engine tests for host_release",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"host_release",
"--type",
"dart,dart-host,engine,impeller-golden"
]
}
]
}
},
{
"archives": [
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: accf41e49999ccd363df249912f8747d
Signature: 552d859824fc2f0be0e5dbb43822a548

====================================================================================================
LIBRARY: dart
Expand Down
4 changes: 0 additions & 4 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -40602,7 +40602,6 @@ ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/shadow.dart + ../../../flutte
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/canvas.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/codecs.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/dart_js_conversion.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/filters.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/font_collection.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/image.dart + ../../../flutter/LICENSE
Expand Down Expand Up @@ -40639,7 +40638,6 @@ ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/shaders.da
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/surface.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/vertices.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_stub.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_stub/dart_js_conversion.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_stub/renderer.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/svg.dart + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/lib/web_ui/lib/src/engine/test_embedding.dart + ../../../flutter/LICENSE
Expand Down Expand Up @@ -43484,7 +43482,6 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/shadow.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/canvas.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/codecs.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/dart_js_conversion.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/filters.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/font_collection.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/image.dart
Expand Down Expand Up @@ -43521,7 +43518,6 @@ FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/shaders.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/surface.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/vertices.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_stub.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_stub/dart_js_conversion.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_stub/renderer.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/svg.dart
FILE: ../../../flutter/lib/web_ui/lib/src/engine/test_embedding.dart
Expand Down
4 changes: 1 addition & 3 deletions lib/web_ui/lib/src/engine/browser_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ bool get isFirefox => browserEngine == BrowserEngine.firefox;
bool get isEdge => domWindow.navigator.userAgent.contains('Edg/');

/// Whether we are running from a wasm module compiled with dart2wasm.
/// Note: Currently the ffi library is available from dart2wasm but not dart2js
/// or dartdevc.
bool get isWasm => const bool.fromEnvironment('dart.library.ffi');
bool get isWasm => !const bool.fromEnvironment('dart.library.html');

/// Use in tests to simulate the detection of iOS 15.
bool? debugIsIOS15;
Expand Down
6 changes: 3 additions & 3 deletions lib/web_ui/lib/src/engine/canvaskit/native_memory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import 'package:ui/src/engine.dart';
/// 5. The finalizer function is called with the SkPaint as the sole argument.
/// 6. We call `delete` on SkPaint.
DomFinalizationRegistry _finalizationRegistry = DomFinalizationRegistry(
(JSAny boxedUniq) {
final UniqueRef<Object> uniq = boxedUniq.fromJSWrapper as UniqueRef<Object>;
(ExternalDartReference boxedUniq) {
final UniqueRef<Object> uniq = boxedUniq.toDartObject as UniqueRef<Object>;
uniq.collect();
}.toJS
);
Expand All @@ -34,7 +34,7 @@ NativeMemoryFinalizationRegistry nativeMemoryFinalizationRegistry = NativeMemory
class NativeMemoryFinalizationRegistry {
void register(Object owner, UniqueRef<Object> ref) {
if (browserSupportsFinalizationRegistry) {
_finalizationRegistry.register(owner.toJSWrapper, ref.toJSWrapper);
_finalizationRegistry.register(owner.toExternalReference, ref.toExternalReference);
}
}
}
Expand Down
19 changes: 4 additions & 15 deletions lib/web_ui/lib/src/engine/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'dart:typed_data';

import 'package:js/js_util.dart' as js_util;
import 'package:meta/meta.dart';
import 'package:ui/src/engine/skwasm/skwasm_stub.dart' if (dart.library.ffi) 'package:ui/src/engine/skwasm/skwasm_impl.dart';

import 'browser_detection.dart';

Expand Down Expand Up @@ -38,13 +37,6 @@ import 'browser_detection.dart';
/// used carefully and only on types that are known to not contains `JSNull` and
/// `JSUndefined`.
extension ObjectToJSAnyExtension on Object {
// Once `Object.toJSBox` is faster (see
// https://github.com/dart-lang/sdk/issues/55183) we can remove this
// backend-specific workaround.
@pragma('wasm:prefer-inline')
@pragma('dart2js:tryInline')
JSAny get toJSWrapper => dartToJsWrapper(this);

@pragma('wasm:prefer-inline')
@pragma('dart2js:tryInline')
JSAny get toJSAnyShallow {
Expand All @@ -61,10 +53,6 @@ extension ObjectToJSAnyExtension on Object {
}

extension JSAnyToObjectExtension on JSAny {
@pragma('wasm:prefer-inline')
@pragma('dart2js:tryInline')
Object get fromJSWrapper => jsWrapperToDart(this);

@pragma('wasm:prefer-inline')
@pragma('dart2js:tryInline')
Object get toObjectShallow {
Expand Down Expand Up @@ -3674,13 +3662,14 @@ class DomFinalizationRegistry {

extension DomFinalizationRegistryExtension on DomFinalizationRegistry {
@JS('register')
external JSVoid register(JSAny target, JSAny value);
external JSVoid register(
ExternalDartReference target, ExternalDartReference value);

@JS('register')
external JSVoid registerWithToken(JSAny target, JSAny value, JSAny token);
external JSVoid registerWithToken(ExternalDartReference target, ExternalDartReference value, ExternalDartReference token);

@JS('unregister')
external JSVoid unregister(JSAny token);
external JSVoid unregister(ExternalDartReference token);
}

@JS('window.FinalizationRegistry')
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'dart:math' as math;
import 'dart:typed_data';

import 'package:ui/src/engine.dart';
import 'package:ui/src/engine/skwasm/skwasm_stub.dart' if (dart.library.ffi) 'package:ui/src/engine/skwasm/skwasm_impl.dart';
import 'package:ui/src/engine/skwasm/skwasm_impl.dart' if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
import 'package:ui/ui.dart' as ui;
import 'package:ui/ui_web/src/ui_web.dart' as ui_web;

Expand Down
1 change: 0 additions & 1 deletion lib/web_ui/lib/src/engine/skwasm/skwasm_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'dart:ffi';

export 'skwasm_impl/canvas.dart';
export 'skwasm_impl/codecs.dart';
export 'skwasm_impl/dart_js_conversion.dart';
export 'skwasm_impl/filters.dart';
export 'skwasm_impl/font_collection.dart';
export 'skwasm_impl/image.dart';
Expand Down

This file was deleted.

10 changes: 5 additions & 5 deletions lib/web_ui/lib/src/engine/skwasm/skwasm_impl/memory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ typedef DisposeFunction<T extends NativeType> = void Function(Pointer<T>);

class SkwasmFinalizationRegistry<T extends NativeType> {
SkwasmFinalizationRegistry(this.dispose)
: registry = DomFinalizationRegistry(((JSNumber address) =>
dispose(Pointer<T>.fromAddress(address.toDartDouble.toInt()))
: registry = DomFinalizationRegistry(((ExternalDartReference address) =>
dispose(Pointer<T>.fromAddress(address.toDartObject as int))
).toJS);

final DomFinalizationRegistry registry;
final DisposeFunction<T> dispose;

void register(SkwasmObjectWrapper<T> wrapper) {
final JSAny jsWrapper = wrapper.toJSWrapper;
final ExternalDartReference jsWrapper = wrapper.toExternalReference;
registry.registerWithToken(
jsWrapper, wrapper.handle.address.toJS, jsWrapper);
jsWrapper, wrapper.handle.address.toExternalReference, jsWrapper);
}

void evict(SkwasmObjectWrapper<T> wrapper) {
final JSAny jsWrapper = wrapper.toJSWrapper;
final ExternalDartReference jsWrapper = wrapper.toExternalReference;
registry.unregister(jsWrapper);
dispose(wrapper.handle);
}
Expand Down
1 change: 0 additions & 1 deletion lib/web_ui/lib/src/engine/skwasm/skwasm_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
// ignore: unnecessary_library_directive
library skwasm_stub;

export 'skwasm_stub/dart_js_conversion.dart';
export 'skwasm_stub/renderer.dart';

This file was deleted.

2 changes: 1 addition & 1 deletion lib/web_ui/test/canvaskit/canvaskit_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ void _paragraphTests() {
// So the test simply tests that a FinalizationRegistry can be constructed
// and its `register` method can be called.
final DomFinalizationRegistry registry = DomFinalizationRegistry((String arg) {}.toJS);
registry.register(Object().toJSWrapper, Object().toJSWrapper);
registry.register(Object().toExternalReference, Object().toExternalReference);
});
}

Expand Down
3 changes: 1 addition & 2 deletions lib/web_ui/test/ui/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import 'dart:async';

import 'package:ui/src/engine.dart';
import 'package:ui/src/engine/skwasm/skwasm_stub.dart'
if (dart.library.ffi) 'package:ui/src/engine/skwasm/skwasm_impl.dart';
import 'package:ui/src/engine/skwasm/skwasm_impl.dart' if (dart.library.html) 'package:ui/src/engine/skwasm/skwasm_stub.dart';
import 'package:ui/ui.dart';

import '../common/rendering.dart';
Expand Down
2 changes: 1 addition & 1 deletion web_sdk/sdk_rewriter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Set<String> rootLibraryNames = <String>{
};

final Map<Pattern, String> extraImportsMap = <Pattern, String>{
RegExp('skwasm_(stub|impl)'): "import 'dart:_skwasm_stub' if (dart.library.ffi) 'dart:_skwasm_impl';",
RegExp('skwasm_(stub|impl)'): "import 'dart:_skwasm_impl' if (dart.library.html) 'dart:_skwasm_stub';",
'ui_web': "import 'dart:ui_web' as ui_web;",
'engine': "import 'dart:_engine';",
'web_unicode': "import 'dart:_web_unicode';",
Expand Down
2 changes: 1 addition & 1 deletion web_sdk/test/sdk_rewriter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void printSomething() {
test('gets correct extra imports', () {
// Root libraries.
expect(getExtraImportsForLibrary('engine'), <String>[
"import 'dart:_skwasm_stub' if (dart.library.ffi) 'dart:_skwasm_impl';",
"import 'dart:_skwasm_impl' if (dart.library.html) 'dart:_skwasm_stub';",
"import 'dart:ui_web' as ui_web;",
"import 'dart:_web_unicode';",
"import 'dart:_web_test_fonts';",
Expand Down

0 comments on commit a5180e4

Please sign in to comment.