429 Commits

Author SHA1 Message Date
Felipe Archondo
573fe3dd0b [fuchsia] fix race in DefaultSessionConnection (flutter/engine#27377)
DefaultSessionConnection can run on two threads - the UI and raster
threads. This change ensures that all variables they both touch is
guarded by the mutex.

Fixes: fxbug.dev/80625
2021-07-14 22:10:15 -04:00
Kaushik Iska
45cf4e9ab1 [fuchsia] Use FFI to get System clockMonotonic (flutter/engine#27353) 2021-07-14 11:01:58 -07:00
Jason Simmons
6d0433831e Do not use the centralized graphics context options for Fuchsia Vulkan contexts (flutter/engine#27347) 2021-07-13 07:41:02 -07:00
Martin Kustermann
91ff075a74 Make dart wrappable classes use only one native field (flutter/engine#27350)
* Make dart wrappable classes use only one native field

It appears like the second native field is never really used for
anything: It is set, cleared and verified it was cleared, but that is
it.

=> The only native field that is necessary is the `this` pointer of the
   equivalent C++ object.
=> The [DartWrapperInfo] object which was stored as second native field
   is always accessible via the virtual `GetDartWrapperInfo()` method on
   `this`.
2021-07-13 16:39:22 +02:00
Kaushik Iska
12750e2e95 [fuchsia] Cleanup unused method in dart:zircon handle (flutter/engine#27330) 2021-07-12 11:40:42 -07:00
Chase Latta
d7a4148d62 [fuchsia] make dart_runner work with cfv2 (flutter/engine#27226)
Adds support for running the dart runner as a CFv2 component.
The runner has been refactored to launch in both a v1 environemnt
as well as a v2 environment.
2021-07-08 15:19:21 -07:00
David Worsham
32cded5dcd fuchsia: Handle clips on platform views (flutter/engine#27149) 2021-07-06 13:00:05 -07:00
Hunter Freyer
34b8a2b930 Replace flutter_runner::Thread with fml::Thread (flutter/engine#26783)
* Move task_observers.{cc,h} into fml.

This is a preparatory CL. The next CL will cause task_observers.h to
be included from both shell/platform/fuchsia _and_
fml/platform/fuchsia. I imagine it might be gauche for a single file
to be used from both those directories, but it seems way worse for fml
to depend on shell, rather than the other way around.

* Replace flutter_runner::Thread with fml::Thread.

This CL makes the treading logic in Fuchsia's flutter_runner more
consistent with fml expectations, but it still has quirks. Notably:

- Not all async work get posted to a fml::TaskRunner. Some work done
  by Fuchsia libraries gets posted directly to
  async_get_default_dispatcher(). This work doesn't trigger the
  fml::MessageLoop's task observers. As a result, we continue to have
  Fuchsia-specific task observers which fire for all async work,
  regardless of which way it was posted.

- There's awkwardness when trying to run Fuchsia code on a specific
  fml::TaskRunner if that fuchsia code accepts an
  async_dispatcher_t. Since you can no longer get an
  async_dispatcher_t for a given thread, you instead must post a
  closure to the fml::TaskRunner that calls
  async_get_default_dispatcher(), and then calls the fuchsia library
  with the default dispatcher.

- Some tests still use task_runner_adapter.h because async::Loop
  offers more control in unit tests than fml::MessageLoop does.

- If this successfully lands, there will be some cosmetic follow-up
  changes to make, like using ThreadHost instead of an array of
  fml::Threads.

* Increase stack size in flutter runner.

The previous change removes our custom 1MiB limit on the stack of
newly created threads, so these threads revert to the Fuchsia
default. google-internal tests were failing (without any particular
error in the logs) after this change, so here we just set the default
stack size to 1MiB.

Co-authored-by: Hunter Freyer <hjfreyer@google.com>
2021-07-06 10:04:08 -07:00
Darren Chan
cc3f93e26d Prepare for cfv2 unittests. (flutter/engine#27036) 2021-07-01 13:11:01 -07:00
Dan Field
72d7ac4ba4 Remove unnecessary experiment flag (flutter/engine#27072)
* Remove unnecessary experiment flag

* add explicit --no-sound-null-safety
2021-07-01 12:27:42 -07:00
David Worsham
5e5fe01dd2 Reland "fuchsia: Delete all the legacy code! (#26422)" (flutter/engine#27075)
This reverts commit bb3c49a9c3edf931a5601f0245faa85f5e077cb4.
2021-06-30 15:43:21 -07:00
Darren Chan
19e8b949e4 Fix use-after-free. (flutter/engine#27053)
Switch from `fml::NonOwnedMapping` to `fml::DataMapping`.

All other uses of `fml::NonOwnedMapping` are not in `PlatformView` and do not access data after references are out of scope.

This fixes https://fxbug.dev/77924.
2021-06-29 19:42:52 -04:00
Darren Chan
9e3b487842 [refactor] Migrate to View.focus.*. (flutter/engine#27005) 2021-06-29 09:41:01 -07:00
Darren Chan
a554250813 Always complete platform message requests. (flutter/engine#26994)
Functions/methods registered in `platform_message_handlers_` should return true or false, indicating whether the response was handled by them.
This makes it more explicit whether a platform message handler will asynchronously complete a response, versus if there was malformed/invalid request.

If the response was not handled, `CompleteEmpty` in `PlatformView::HandlePlatformMessage` to avoid hanging `Future`s in dart.

This fixes https://fxbug.dev/79056.
2021-06-29 09:58:31 -04:00
Chinmay Garde
7cfb375a5e Configure contexts to reduce shader variations. (flutter/engine#27016)
Context creation options for each backend were spread across multiple
translation units. This makes setting options common across all backends hard to
configure. I have moved the creation of such common options into a separate
translation unit.

Fixes https://github.com/flutter/flutter/issues/84213
2021-06-28 15:37:14 -07:00
Chase Latta
38cc5181d8 Allow fuchsia_archive to accept a cml file and cmx file (flutter/engine#27012)
This adds support for adding a cml file to a fuchsia package. The
cml file will be compiled to a cm file and included in the archive.
2021-06-28 13:48:21 -07:00
Dan Field
844fa85973 Fix Fuchsia build on Mac (flutter/engine#27007) 2021-06-28 10:36:01 -07:00
Darren Chan
7a203330e1 Emit viewRefFocused events in the flutter runner. (flutter/engine#26791)
Fulfill HostView.getCurrentFocusState and HostView.getNextFocusState platform message requests to deliver focus-related events to dart code.

Consolidate focus functionality (including requestFocus handling) to a new "FocusDelegate" class.

See https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.views/view_ref_focused.fidl for details about focus state transitions and their meanings.

See https://fxbug.dev/77481.
2021-06-24 14:48:10 -04:00
Martin Kustermann
fde57f1f1d Remove usages of --no-causal-async-stacks (flutter/engine#26877)
Passing the --causal-async-stacks flag to the VM will cause it to error
on VM startup. The VM will remove the flag entirely, but before doing so
we'll have to remove usages of the negated version of the flag, namely
--no-causal-async-stacks.
2021-06-23 14:30:26 +02:00
Adlai Holler
3aaa10d762 Disable Skia reduceOpsTaskSplitting option (flutter/engine#26568)
This option will be the default in Skia soon. Per discussion in #26067, let’s be explicit about disabling it for the time being, and we can revisit the flag in the future if desirable.
2021-06-17 13:11:40 -07:00
Ren You
7d14b58d2d Revert "Replace flutter_runner::Thread with fml::Thread. (#26193)" (flutter/engine#26717) 2021-06-11 15:09:02 -07:00
David Worsham
bad9b71a01 Revert "fuchsia: Delete all the legacy code! (#26422)" (flutter/engine#26637)
This reverts commit 9afd7d6af8a0d023c0db67d24c55eb6c08c48aba.
2021-06-08 12:47:44 -07:00
David Worsham
9afd7d6af8 fuchsia: Delete all the legacy code! (flutter/engine#26422) 2021-06-07 17:29:39 -07:00
David Worsham
90b1f10ab7 fuchsia: Delete unused compilation_trace code (flutter/engine#20535) 2021-06-03 15:44:01 -07:00
Hunter Freyer
84d62201b6 Replace flutter_runner::Thread with fml::Thread. (flutter/engine#26193) 2021-06-03 14:39:04 -07:00
Darren Chan
f41e276f91 Migrate flutter_runner to Scenic.CreateSessionT. (flutter/engine#26536) 2021-06-03 08:49:02 -07:00
freiling
0067ff89de [fuchsia] Migrate shader warmup to be triggered by Dart code. (flutter/engine#26114) 2021-06-02 16:45:17 -07:00
Darren Chan
8dc11f638c Cache Handle.koid(). (flutter/engine#26506) 2021-06-02 10:09:02 -07:00
Darren Chan
d7ed065392 Add todo to handle_test. (flutter/engine#26453) 2021-05-27 13:19:02 -07:00
Darren Chan
8f8f34ad04 Add Handle.replace(int rights). (flutter/engine#26408)
Add support for zx_handle_replace.

This is related to https://fxbug.dev/68600.

handle_test has been updated and tested in fuchsia.git locally. Additional tests are added for Handle.duplicate.
2021-05-25 19:04:33 -04:00
Darren Chan
a18e76809f Remove build timestamp from build_info.h. (flutter/engine#26403)
Remove build timestamp as it is not updating correctly and it would mark
the build as dirty, triggering a rebuild.

Bug: https://fxbug.dev/73263
2021-05-25 14:43:46 -04:00
David Worsham
efff0a7bb1 fuchsia: Fix View create vs render race (flutter/engine#26368) 2021-05-24 17:46:23 -07:00
Naud Ghebre
cf2ff1193d [vm_service] Add vm service port to inspect. (flutter/engine#26295)
fxb/75455
2021-05-24 13:39:17 -04:00
lucasradaelli
757d7c0d03 [fuchsia][a11y] Adds inspect data to the a11y bridge. (flutter/engine#25868)
This change adds inspect data to the a11y bridge, which can be requested
via the command line.

Inspect nodes are lazy computed, meaning that they are only processed
when invoked, so no extra space is used during normal use.

Bug: fxbug.dev/75100

Test: AccessibilityBridgeTest.InspectData
2021-05-21 14:21:22 -07:00
Darren Chan
d67fdf5256 Provide the following information to the inspect tree: (flutter/engine#26179) 2021-05-21 11:09:02 -07:00
Felipe Archondo
75a3755481 Fix VsyncWaiter (flutter/engine#25551)
This PR accomplishes many things:
- Unblocks input resampling on Fuchsia
- Fixes 2 frame scheduling issues resulting in wasted work and missed frames
- Removes the now-defunct VsyncRecorder class
- Prepares the VsyncWaiter class for the Embedder API by moving all logic out of it
- Adds hundreds of lines of unittests for Fuchsia scheduling logic to validate the performance and correctness benefits
2021-05-20 15:50:58 -04:00
David Worsham
9061c700c6 fuchsia: Fix occlusion_hint handling (flutter/engine#26208) 2021-05-18 09:15:50 -07:00
David Worsham
19c353f785 fuchsia: Improve checking/logging for composition (flutter/engine#26166) 2021-05-17 09:45:02 -07:00
chandarrengoog
4d05199f5b Add support for System.channelWriteEtc and System.channelQueryAndReadEtc. (flutter/engine#26050) 2021-05-13 15:34:02 -07:00
Felipe Archondo
2043d0839a [fuchsia] rename SessionConnection to DefaultSessionConnection (flutter/engine#26104)
In preparation for #25551, rename SessionConnection to
DefaultSessionConnection. The plan is to have SessionConnection be an
interface we can create a fake of for testing purposes.
2021-05-13 17:59:16 -04:00
gaaclarke
4d98fd9744 Switch PlatformMessages to hold data in Mappings (flutter/engine#25867) 2021-05-13 10:28:25 -07:00
David Worsham
d77416d365 fuchsia: Fix first_layer handling (flutter/engine#26085) 2021-05-11 23:10:54 -07:00
Kaushik Iska
2fead370b3 Streamline frame timings recording (flutter/engine#25892) 2021-05-07 12:14:01 -07:00
David Worsham
1e82ae9b8e fuchsia: Fix multi-views fallout (flutter/engine#25984) 2021-05-07 10:53:07 -07:00
gaaclarke
1734ce7f8a Moved PlatformMessage's to unique_ptrs (flutter/engine#25860) 2021-05-06 20:19:01 -07:00
David Worsham
e5f652a8af fuchsia: Reliably forward View insets (flutter/engine#25381) 2021-04-30 16:24:06 -07:00
David Worsham
abc36a2363 fuchsia: Fix bad syntax in viewStateConnected msg (flutter/engine#25853) 2021-04-30 09:34:11 -07:00
David Worsham
8b52e92f15 fuchsia: Handle multiple views in platformViews path (flutter/engine#25343) 2021-04-28 23:57:30 -07:00
Kaushik Iska
30e0472687 Pause dart microtasks while UI thread is processing frame workloads (flutter/engine#25789) 2021-04-28 12:39:42 -07:00
Jody Sankey
2b4b5aefbf [fuchsia] Remove now unsed wrapper for zx_clock_get (flutter/engine#25750) 2021-04-27 12:24:02 -07:00