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

Commit feaadf8

Browse files
authored
Reland "Refactor JSNumber.toDart and Object.toJS" (#43363)
This reverts commit dce75ab. This also makes some small changes to make onBenchmark a JSExportedDartFunction instead of a JSBoxedDartObject. This is for changes in flutter/flutter#129436 and to account for the fact that flutter/packages provides an `allowInterop`'d function. Benchmarks tests pass with this CL. ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [X] 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. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I signed the [CLA]. - [ ] All existing and new tests are passing.
1 parent f55f087 commit feaadf8

File tree

11 files changed

+176
-179
lines changed

11 files changed

+176
-179
lines changed

lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart

Lines changed: 72 additions & 72 deletions
Large diffs are not rendered by default.

lib/web_ui/lib/src/engine/canvaskit/image.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ Future<Uint8List> readChunked(HttpFetchPayload payload, int contentLength, WebOn
205205
int position = 0;
206206
int cumulativeBytesLoaded = 0;
207207
await payload.read<JSUint8Array1>((JSUint8Array1 chunk) {
208-
cumulativeBytesLoaded += chunk.length.toDart.toInt();
208+
cumulativeBytesLoaded += chunk.length.toDartInt;
209209
chunkCallback(cumulativeBytesLoaded, contentLength);
210210
result.set(chunk, position.toJS);
211-
position += chunk.length.toDart.toInt();
211+
position += chunk.length.toDartInt;
212212
});
213213
return result.toDart;
214214
}

lib/web_ui/lib/src/engine/configuration.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ extension JsFlutterConfigurationExtension on JsFlutterConfiguration {
317317

318318
@JS('canvasKitMaximumSurfaces')
319319
external JSNumber? get _canvasKitMaximumSurfaces;
320-
double? get canvasKitMaximumSurfaces => _canvasKitMaximumSurfaces?.toDart;
320+
double? get canvasKitMaximumSurfaces => _canvasKitMaximumSurfaces?.toDartDouble;
321321

322322
@JS('debugShowSemanticsNodes')
323323
external JSBoolean? get _debugShowSemanticsNodes;

0 commit comments

Comments
 (0)