Skip to content

Commit

Permalink
Reland "Refactor JSNumber.toDart and Object.toJS"
Browse files Browse the repository at this point in the history
This reverts commit dce75ab.

This also makes some small changes to make onBenchmark a
JSExportedDartFunction instead of a JSBoxedDartObject and
updates new invocations of JSNumber.toDart.
  • Loading branch information
srujzs committed Jul 11, 2023
1 parent 188c35b commit 99d62b0
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 179 deletions.
144 changes: 72 additions & 72 deletions lib/web_ui/lib/src/engine/canvaskit/canvaskit_api.dart

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/canvaskit/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ Future<Uint8List> readChunked(HttpFetchPayload payload, int contentLength, WebOn
int position = 0;
int cumulativeBytesLoaded = 0;
await payload.read<JSUint8Array1>((JSUint8Array1 chunk) {
cumulativeBytesLoaded += chunk.length.toDart.toInt();
cumulativeBytesLoaded += chunk.length.toDartInt;
chunkCallback(cumulativeBytesLoaded, contentLength);
result.set(chunk, position.toJS);
position += chunk.length.toDart.toInt();
position += chunk.length.toDartInt;
});
return result.toDart;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ extension JsFlutterConfigurationExtension on JsFlutterConfiguration {

@JS('canvasKitMaximumSurfaces')
external JSNumber? get _canvasKitMaximumSurfaces;
double? get canvasKitMaximumSurfaces => _canvasKitMaximumSurfaces?.toDart;
double? get canvasKitMaximumSurfaces => _canvasKitMaximumSurfaces?.toDartDouble;

@JS('debugShowSemanticsNodes')
external JSBoolean? get _debugShowSemanticsNodes;
Expand Down
Loading

0 comments on commit 99d62b0

Please sign in to comment.