Harry Terkelsen
b28f8f5c42
[canvaskit] Round physical size to nearest whole number pixels ( flutter/engine#52467 )
...
The physical size is computed by multiplying the browser's `innerWidth`
and `innerHeight` by the `devicePixelRatio`. The physical size should be
an integer number of pixels. However, there may be some imprecision and
the result of the multiplication is not quite an integer. This change
rounds the physical size to integers before using them for drawing the
scene.
Fixes https://github.com/flutter/flutter/issues/144869
## 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.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-05-02 16:16:50 -07:00
Juanjo Tugores
3ec84538ca
Put the view focus functionality behind a (disabled by default) flag ( flutter/engine#52527 )
...
Put the view focus functionality behind a (disabled by default) flag
Should unblock https://github.com/flutter/flutter/pull/143259
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-02 21:27:23 +00:00
Alexander Aprelev
8bd9e60267
Use new Dart_PortEx api to ensure SendPort can be rebuild properly. ( flutter/engine#52498 )
...
Currently used Dart API can not be reliably used to rebuild dart
SendPort object, [new API was introduced in dart sdk
](https://dart.googlesource.com/sdk/+/de4029ee1ba3bc89d839ae7d2fd0706d29abae58 )
and this PR moves flutter engine to use that new API.
BUG: https://github.com/flutter/flutter/issues/147469
2024-05-02 09:06:38 -07:00
Ian Hickson
8966c48831
Remove rasterizerTracingThreshold, checkerboardRasterCacheImages, and checkerboardOffscreenLayers, etc ( flutter/engine#52446 )
2024-05-02 04:35:04 +00:00
David Iglesias
829ae71a50
[web] Expose browser_detection through ui_web. ( flutter/engine#52380 )
...
This PR moves the core of `browser_detection.dart` to a location in `dart:ui_web` so it can be used by apps and plugins.
In order for the code to be a little bit tidier in ui_web, it's encapsulated in a singleton instance that can be accessed through `BrowserDetection.instance` or a top level global `browser` in `dart:ui_web`.
## Issues
* Needed to fix: https://github.com/flutter/flutter/issues/128943
* Needed to land: https://github.com/flutter/flutter/pull/147346
## Tests
Updated affected tests. Mostly the update was to call the methods from `web_ui.browser.methodName` rather than a global scope. Also split the tests for this module in two files:
* `engine_browser_detect_test.dart` - with the tests specific to the engine (capability detection, etc...)
* `browser_detect_test.dart` - only the tests pertaining to the "core" of the library.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-02 01:20:10 +00:00
Jackson Gardner
bd471f7a8a
[skwasm] Don't mark the backend texture as mipmapped, since it isn't. ( flutter/engine#52501 )
...
We don't actually produce mipmaps for any of the textures generated through the `TextureSourceImageGenerator`, even if it is requested of us. So we shouldn't mark the texture as mipmapped in this case. This will allow rendering mechanisms to fall back to a non-mipmapped rendering strategy as needed.
2024-05-02 00:08:05 +00:00
gaaclarke
4429b2f2fe
[Impeller] Implements retry for Picture.toImage ( flutter/engine#52470 )
...
fixes https://github.com/flutter/flutter/issues/146990
## 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.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-05-01 08:53:54 -07:00
Jackson Gardner
0d496c4a9e
[skwasm] Change default FilterQuality to None for image shaders. ( flutter/engine#52468 )
...
This brings the behavior in line with the CanvasKit renderer, which also uses `None` for the default image shader quality.
I added a few unit tests to cover different filter qualities. It turns out, there is a skia issue that manifests both in CanvasKit and Skwasm when a lazy image is rendered with medium quality. See https://g-issues.skia.org/issues/338095525
2024-05-01 00:07:22 +00:00
Kaylee Lubick
b763678f03
Make SkUnicode explicitly instead of relying on SkParagraph to make it for us ( flutter/engine#52086 )
...
In https://skia-review.googlesource.com/c/skia/+/838417 Skia staged the
removal of automatically creating an SkUnicode as part of the effort to
make Skia more modular. Clients will now have to construct and SkUnicode
and pass it to SkParagraph to provide the appropriate data. Flutter
sometimes uses ICU and sometimes uses a "client" SkUnicode which makes
use of the browser APIs to get the data.
We should come back to the skwasm code especially, because right now
skwasm gets the data necessary to make an SkUnicode::Client, but stores
it in the ParagraphBuilder, just to take it out again later to make the
SkUnicode::Client and pass that back into the ParagraphBuilder. skwasm
should just create the SkUnicode::Client directly and pass it to the
ParagraphBuilder::make().
## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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 `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-04-29 11:59:33 -04:00
Jonah Williams
8f21d27541
[Impeller] fix GLES image upload. ( flutter/engine#52430 )
...
TLDR: this was a load bearing closure.
See https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20complex_layout_scroll_perf_impeller_gles__timeline_summary/1492/overview
2024-04-29 14:24:21 +00:00
Jonah Williams
584a0394aa
[Impeller] remove image upload from IO thread, limit concurrent worker threads. ( flutter/engine#52423 )
...
Fixes https://github.com/flutter/flutter/issues/123058
Fixes https://github.com/flutter/flutter/issues/135443
We're currently using the IO thread to bottleneck image uploads. Instead, just use fewer concurrent worker threads - and cap the limit at something small. For a Pixel device, this should use about 2 threads maximum, instead of 5 (4 worker and 1 IO).
2024-04-28 17:22:15 +00:00
Tong Mu
94448fc97f
Move PointerDataPacketConverter from PlatformView to RuntimeController ( flutter/engine#51952 )
...
This is a refactor that moves the `PointerDataPacketConverter` from `PlatformView` to `RuntimeController`.
This change is made for the following reasons:
- Currently, the pointer data conversion contains no platform specific logic (because the current converter's only responsibility is to make the event sequence conform Flutter's protocol). Therefore these logics should reside in a platform-independent place.
- The converter typically converts one event to many. It's better to have this conversion later than earlier.
- It removes a member from `PlatformView`, making it closer to a pure virtual class.
The reason to choose `RuntimeController` as the destination is because `RuntimeController` manages a map for views, which is required for the converter to implement a later patch https://github.com/flutter/engine/pull/51925 .
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-26 23:45:21 +00:00
Jonah Williams
5935f48862
[Impeller] while we still have benchmarks, see if we're efficient enough for this to be faster. ( flutter/engine#52398 )
...
We don't need to decode images to a malloc'd buffer, but this benchmarked as faster because we did so much allocation during the frame. Maybe this is better now? Lets run the benchmarks
2024-04-25 21:12:10 +00:00
Jonah Williams
9dbe934a9b
[Impeller] kick off registration and initial PSO compilation of runtime effect earlier. ( flutter/engine#52381 )
...
I thought about changing this API so that it blocks on compilation, but I think that isn't necesasary as the workload can happen while the UI thread is building. Plus, even blocking on shader completion does not guarantee that we won't need to compile a variant anyway.
While I was at it I moved the descriptor sets computation to the runtime effect constructor.
With this change the pipleine variant used during the frame is produced much faster than the initial 12ms compilation.

Fixes https://github.com/flutter/flutter/issues/113719
Fixes https://github.com/flutter/flutter/issues/141222
2024-04-25 20:23:56 +00:00
Ian Hickson
b7117adf38
Document the new binding hooks for SceneBuilder, PictureRecorder, Canvas ( flutter/engine#52374 )
...
See https://github.com/flutter/flutter/pull/147271 for context.
Do not land until https://github.com/flutter/flutter/pull/147271 has landed.
2024-04-25 03:05:20 +00:00
Yegor
20e2de3a37
[web:tests] switch to new HTML DOM matcher ( flutter/engine#52354 )
...
Remove the over-architected and under-utilized `canonicalizeHtml` and `HtmlComparisonMode`. Replace with a new `hasHtml` matcher.
The new matcher produces considerably better error messages when matching fails (see `matchers_test.dart` for multiple examples). It also allows focusing on particular parts of the DOM rather than looking for a full match. This way a test can test just the functionality it cares about, and it can skip specifying what unrelated parts should look like (i.e. it prevents over-testing). For example, let's say you want to test that an `<flt-semantics>` element has an `aria-label` attribute. You can use a DOM pattern that specified just that:
```
expect(
element,
hasHtml('<flt-semantics aria-label="hello"></flt-semantics>'),
)
```
This will check for the existence of `<flt-semantics>` and `aria-label="hello"`. It will ignore everything else that's unrelated to ARIA labels. For example, the element may have its geometry specified in the `style` attribute, an `id` attribute, and many other things, but if the test doesn't care, it doesn't need to specify those things (it can, if needs to though). This also applies to `style` properties. See more examples in the `matchers_test.dart` file.
2024-04-24 20:40:06 +00:00
Jackson Gardner
7b6f8eae5e
[skwasm] Fix sampling options for low filter quality to match CanvasKit. ( flutter/engine#52331 )
...
These sampling options didn't match up with what CanvasKit was using. I also changed the tests to render images in all four image qualities on a golden.
2024-04-23 19:58:17 +00:00
Kaylee Lubick
17a78534c6
[skia] Remove no-op GN flag ( flutter/engine#52121 )
...
After <https://skia-review.googlesource.com/c/skia/+/826440 > this flag
does nothing.
## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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 `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-04-23 07:57:59 -04:00
hellohuanlin
cabd4fcacd
[ios_edit_menu]add native edit menu ( flutter/engine#50095 )
...
Support native edit menu on the engine side.
Design doc: https://docs.google.com/document/d/16-8kn58h_oD902e7vPSh6W20aHRBJKyNOdSe5rbAe_g/edit?resourcekey=0-gVdJ3fbOybV70ZKeHU7fkQ&tab=t.0
*List which issues are fixed by this PR. You must list at least one issue.*
https://github.com/flutter/flutter/issues/103163
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-22 23:36:18 +00:00
Harry Terkelsen
37db59763d
[canvaskit] Add configuration for maximum canvases ( flutter/engine#51735 )
...
Allows developers to customize the maximum amount of overlay canvases.
Fixes https://github.com/flutter/flutter/issues/144589
## 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.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-04-22 10:56:26 -07:00
PurplePolyhedron
2ae24d260d
Fix link in BlendMode.saturation ( flutter/engine#52156 )
...
Fix typo in the document of `BlendMode.saturation`. It has a link to image https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_hue.png , while it should be `blend_mode_saturation.png`
https://github.com/flutter/flutter/issues/146820
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-22 17:48:26 +00:00
Michael Goderbauer
9d5b33fff8
Fix docs for SemanticsAction ( flutter/engine#52229 )
...
The old rendering:

This changes uses markdown syntax introduced in 5fab3a7bc8
Fixes https://github.com/flutter/flutter/issues/94494 .
2024-04-18 18:32:03 +00:00
Jason Simmons
faf78247cb
Fix CkBrowserImageDecoder conversion of images to ImageByteFormat.rawRgba and rawStraightRgba ( flutter/engine#52089 )
...
VideoFrames of decoded images typically contain BGRA format. The CkBrowserImageDecoder implementation of toByteData needs to convert that into RGBA format. If the output format is rawRgba then it also needs to apply premultipled alpha.
Also fixes an issue where _bgrToRgba was not converting all pixels in the image.
Fixes https://github.com/flutter/flutter/issues/135409
Fixes https://github.com/flutter/flutter/issues/144770
2024-04-17 21:44:47 +00:00
Yegor
2affc5230f
[web] move AccessibilityAnnouncements into SemanticsOwner ( flutter/engine#52138 )
...
Move `AccessibilityAnnouncements` into `SemanticsOwner`, effectively making it a singleton (because `SemanticsOwner` is).
Fixes https://github.com/flutter/flutter/issues/139272
2024-04-17 16:49:07 +00:00
Jason Simmons
50771f3ad4
Roll reclient, libpng, and zlib ( flutter/engine#52072 )
...
Based on https://github.com/flutter/engine/pull/52067
2024-04-16 18:31:30 +00:00
gaaclarke
e359708723
Relands "[Impeller] moved to bgra10_xr ( #52019 )" ( flutter/engine#52142 )
...
relands https://github.com/flutter/engine/pull/52019
Patch addresses the compilation problem noted in https://github.com/flutter/engine/pull/52019#issuecomment-2058006113
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-16 00:59:09 +00:00
auto-submit[bot]
b4bad7f256
Reverts "[Impeller] moved to bgra10_xr ( #52019 )" ( flutter/engine#52140 )
...
Reverts: flutter/engine#52019
Initiated by: jonahwilliams
Reason for reverting: I believe the tree failures are due to changes in the build configuration this file introduced.
Original PR Author: gaaclarke
Reviewed By: {jonahwilliams}
This change reverts the following previous change:
fixes https://github.com/flutter/flutter/issues/145933
This required that we moved the golden image tests to arm64 since the wide gamut tests would now require BGRA10_XR and that's only available to arm64.
tests: in framework repo https://github.com/flutter/flutter/tree/master/dev/integration_tests/wide_gamut_test . There was a test added to that suite specifically for this case when we turned off BGRA10_XR the first time.
This has a dependency on https://github.com/flutter/engine/pull/51998 which includes the necessary skia change.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-15 22:50:46 +00:00
gaaclarke
47ad73b01c
[Impeller] moved to bgra10_xr ( flutter/engine#52019 )
...
fixes https://github.com/flutter/flutter/issues/145933
This required that we moved the golden image tests to arm64 since the wide gamut tests would now require BGRA10_XR and that's only available to arm64.
tests: in framework repo https://github.com/flutter/flutter/tree/master/dev/integration_tests/wide_gamut_test . There was a test added to that suite specifically for this case when we turned off BGRA10_XR the first time.
This has a dependency on https://github.com/flutter/engine/pull/51998 which includes the necessary skia change.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-15 18:03:51 +00:00
Jackson Gardner
5b8107e9c2
[skwasm] Reify the SkPicture pointer as the right type. ( flutter/engine#51991 )
...
When recreating this `unique_ptr`, we need to ensure it matches the type in `Surface::renderPictures` which is released. See here:
```
std::unique_ptr<sk_sp<SkPicture>[]> picturePointers =
std::make_unique<sk_sp<SkPicture>[]>(count);
for (int i = 0; i < count; i++) {
picturePointers[i] = sk_ref_sp(pictures[i]);
}
// Releasing picturePointers here and will recreate the unique_ptr on the
// other thread See surface_renderPicturesOnWorker
skwasm_dispatchRenderPictures(_thread, this, picturePointers.release(), count,
callbackId);
```
2024-04-09 17:25:18 +00:00
Jason Simmons
f745408809
Move the Dart SDK to //flutter/third_party/dart ( flutter/engine#51917 )
2024-04-09 12:48:09 +00:00
Kallen Tu
86f00c760a
Add missing_code_block_language_in_doc_comment lint to flutter/engine. ( flutter/engine#51944 )
...
Adds this Dartdoc-related lint to the flutter repository, in replacement
of the Dartdoc warning (`missingCodeBlockLanguage`) because it will be
deprecated and removed soon.
flutter/flutter already has this lint as well.
Lint Proposal: https://github.com/dart-lang/linter/issues/4904
## 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.
- [X] I added new tests to check the change I am making or feature I am
adding, or 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].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-04-08 11:57:12 -07:00
Jackson Gardner
228c22e017
Be slightly more lenient about the assertion, as it differs on different backends. ( flutter/engine#51877 )
...
We shouldn't assume the exact format of the assertion string here, as the exact output is slightly different on dart2js vs ddc vs dart2wasm. They should all contain the message text, however.
2024-04-03 20:15:07 +00:00
Zachary Anderson
9404f5112e
Revert "Prevent solo: true from being committed" ( flutter/engine#51858 )
...
Reverts flutter/engine#51712
Reason for revert: As discussed in
https://github.com/flutter/flutter/issues/143312 , and in
https://discord.com/channels/608014603317936148/1224499330824802375 . I
apologize if this seems hasty and not fully justified, but it is
important that the engine repo follows policies like this to make it
easier for our various teams to work together.
2024-04-02 20:19:12 -07:00
Michael Goderbauer
b71942aadb
Remove outdated deprecated_member_use ignores ( flutter/engine#51836 )
...
These are obsolete with https://github.com/flutter/engine/pull/50575 .
2024-04-03 02:28:51 +00:00
Jason Simmons
296d677a7c
Add an engine switch that controls whether the platform isolate API is available. ( flutter/engine#51784 )
...
Platform isolates are currently supported only on Android and iOS.
See https://github.com/flutter/flutter/issues/136314
2024-04-02 22:47:04 +00:00
Jackson Gardner
fea11e834d
[skwasm] Fix Paragraph.getLineBoundary ( flutter/engine#51846 )
...
The Skia APIs I was previously using were returning `-1` for `paragraphGetLineNumberAt` when querying at the end of the string. I changed the implementation to be identical to what CanvasKit and the native Paragraph object are doing.
2024-04-02 20:31:56 +00:00
Jackson Gardner
adfd52167c
[Skwasm] Forward text height from paragraph height to default text style ( flutter/engine#51819 )
...
We need to apply the paragraph style's height to the initial default text style on the stack. I also added a `toString` method for `StrutStyle` so that things are a bit easier to debug.
2024-04-01 21:20:28 +00:00
Matan Lurey
61573f8d69
Implement Paint.from(other) for dart:ui. ( flutter/engine#51110 )
...
(Tenatively) Closes https://github.com/flutter/flutter/issues/142871 .
I personally think this is a reasonable request, and we (framework authors) can make some users happy in a fairly simple way (https://github.com/flutter/flutter/issues/142871 , https://github.com/flutter/flutter/issues/40497 ).
Some questions:
1. Is the web implementation good enough or would we want to "ship" with an optimized impl?
2. Can folks imagine other edge cases to test beyond correctness and deep/immutable copies?
2024-03-29 21:46:05 +00:00
LongCatIsLooong
cddc8f5910
Turn struct half leading in canvaskit kitchensink test back on ( flutter/engine#50707 )
...
Undo https://github.com/flutter/engine/pull/50617
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-29 18:50:35 +00:00
Mouad Debbar
01ea911472
[web] Use viewId for text editing ( flutter/engine#51099 )
...
Handle `viewId` for text fields.
Part of https://github.com/flutter/flutter/issues/137344
2024-03-29 16:50:01 +00:00
Jackson Gardner
b27ae53b79
[skwasm] Fix toString methods on Paint and ImageFilter/ColorFilter ( flutter/engine#51766 )
...
This fixes https://github.com/flutter/flutter/issues/141639
Most of this was previously unimplemented. It turns out the reason for the hang described in the github issue was that there was a typo in the name of the `getMiterLimit` C function, so if the client actually called that method the Wasm module failed to compile, as it couldn't find an import with the misspelled name.
2024-03-29 02:06:18 +00:00
Loïc Sharma
a01206ad39
Add completion callback to Shell::AddView ( flutter/engine#51659 )
...
In the future, `FlutterEngineAddView` will be added to the embedder API to allow embedders to add views. `FlutterEngineAddView` will accept a callback that notifies the embedder once the view has been added.
This embedder API will be powered by `Shell::AddView`. This change adds a completion callback to `Shell::AddView` to prepare for the embedder API.
Design doc: https://flutter.dev/go/multi-view-embedder-apis
Part of https://github.com/flutter/flutter/issues/144806
Part of https://github.com/flutter/flutter/issues/142845
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-03-29 00:39:10 +00:00
Jackson Gardner
6741217138
[skwasm] Use text position affinity when calculating word boundaries. ( flutter/engine#51753 )
...
I had failed to take position affinity into account when calculating word boundaries on skwasm. This brings skwasm's behavior in line with canvaskit's.
2024-03-28 19:54:12 +00:00
Mouad Debbar
b0300e2fc2
Prevent solo: true from being committed ( flutter/engine#51712 )
...
At some point, we inherited a change from the repo-level `analysis_options.yaml` that [allowed deprecated](https://github.com/flutter/engine/pull/50575 ) members to be used. We rely on that analyzer error to prevent `solo: true` from being committed in our tests ([example](c935c3ba36/lib/web_ui/test/ui/line_metrics_test.dart (L179) ) of one that slipped recently).
This PR overrides the `deprecated_member_use` error to enable it inside the web engine.
2024-03-28 19:31:14 +00:00
Jackson Gardner
601cb5058f
[Skwasm] Correctly handle paragraphs with empty text. ( flutter/engine#51695 )
...
Instead of just returning, if our paragraph builder has empty text, we still need to generate a set of line breaks for skia to use. Otherwise, it will actually cause subtle memory access errors.
2024-03-27 20:18:57 +00:00
Harry Terkelsen
a2f2c59db0
[canvaskit] Fix color filter for dst and dstIn ( flutter/engine#51693 )
...
When CanvasKit returns `null` for a ColorFilter, it indicates the
ColorFilter is a no-op, not that an error has occurred. This fixes the
engine to correctly handle when CanvasKit returns a null ColorFilter.
Fixes https://github.com/flutter/flutter/issues/123537
## 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.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-03-27 11:07:55 -07:00
Jackson Gardner
af3d972f03
Pass the flutter test font by default. ( flutter/engine#51671 )
...
In the default case, where no fonts are specified, we should specify the flutter test font. This fixes a swath of framework tests in skwasm.
2024-03-26 18:16:58 +00:00
Srujan Gaddam
f55ed6aa70
Change JSBoxedDartObject to JSAny ( flutter/engine#51634 )
...
Closes https://github.com/dart-lang/sdk/issues/55256
d7ce346fba added code to avoid the less performant boxing of JSBoxedDartObject and instead use backend-specific logic to externalize and internalize the UniqueRef until we get a better solution from dart:js_interop. On the JS backends, this relied on casting to and from JSAny, as its representation type is just Object. However, this callback that takes in the UniqueRef as an arg is still typed as accepting JSBoxedDartObject, leading to a cast failure on the JS backends, since the representation type is JSObject.
The fix is to use JSAny. On dart2wasm, this makes no difference, as the underlying representation type does not change.
2024-03-26 15:41:23 +00:00
Harry Terkelsen
c94c54253a
[web] Add ability to customize font fallback download URL ( flutter/engine#51569 )
...
Gives developers the ability to change the base URL to download fallback
fonts from `fonts.gstatic.com` to a URL of their choosing.
Fixes https://github.com/flutter/flutter/issues/132689
## 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.
- [x] I added new tests to check the change I am making or feature I am
adding, or 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].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-03-22 14:58:39 -07:00
Jackson Gardner
047ea1efd4
[skwasm] Use test fonts while in debugEmulateFlutterTesterEnvironment mode ( flutter/engine#51630 )
...
This brings the behavior in line with the other renderers. The framework sets this bit to make sure we render only using the Ahem font.
2024-03-22 21:56:53 +00:00