close() returns a nonzero in case of an error. Old code had it log
only when *no* error happens on close, which is exactly the opposite
of what we want.
On Fuchsia, we can now get executable VMOs from trusted backing
filesystems. This allows us to remove the use of replace_as_executable
in favor of opening files with `fdio_open_fd_at` with the
`OPEN_RIGHT_EXECUTABLE` flag and getting VMOs by calling
`fdio_get_vmo_exec`.
By moving the responsibility for executability into the filesystem, we
are able to remove `deprecated-ambient-replace-as-executable` from
component manifests for non-JIT runners (the JIT runners still call
replace_as_executable in Dart's allocator). It wasn't abundantly clear
whether .cmx files for tests were used purely in AOT runtime
environments or also saw JIT usage, so I left those as-is.
For context: this is a second attempt at #16690, which was reverted
because it broke the Dart JIT runner. The primary difference is that
this time around, we correctly handle absolute vs relative paths,
depending on whether library loading bottoms out in `fdio_open_fd` or
`fdio_open_fd_at`. I've added additional assertions to help ensure any
new usages use the correct shape of path.
Testing: I verified locally that the flutter product runner works on
Astro, and also successfully ran the Dart JIT example test (which was
the thing blocking the google3 roll with the previous attempt at this
patchset).
Co-authored-by: Drew Fisher <zarvox@google.com>
This lets us measure stats on when the frame was
scheduled to be rendered vs when it finished rasterizing.
Note: This isn't propagated to the FrameTimings struct yet,
that is to be followed.
* [fuchsia] Add labels to Scenic nodes.
* [fuchsia] Skip creating Scenic nodes for identity Transforms.
* [fuchsia] Assign elevation to Scenic nodes based on paint order.
* [fuchsia] Create Scenic OpacityNodes at leaf nodes.
* [fuchsia] Composite PhysicalShapeLayers using Skia, except when they need to float above child views.
In that case, they will still need to be pulled
into separate Scenic nodes to be composited on top
of the child view[s].
* [fuchsia] Add tests for Fuchsia-specific layer behavior.
Inspect commands going to Scenic and make sure
they match what is expected.
Also, restructure code to need less member variables,
and other cleanups based on review feedback.
This is a step toward aligning the API with macOS, and will make it easier to add the precompiled library later for release mode (since it can just be added to the project directory, without any code changes required for wrapper clients).
At the C API, uses a struct instead of individual arguments, mirroring a change that was already made on the Linux side to make the C API cleaner.
Functional changes in addition to the restructuring:
adds relative path support, as was recently added for GLFW
Uses wstring, rather than string, for paths; the conversion to UTF-8 is actually a potential problem on Windows, so pushing it into the embedding allows us the possibility of removing it later (if we can figure out a good solution at the embedder.h layer) without API breakage.
The old APIs used by the standard runner are left in place for now to avoid breaking the template on an engine roll. Once the framework template has been updated, the old API paths will be removed.
All Metal layers have their presentsWithTransaction property set to true.
However, when an external view embedder is not present, there is no mechanism to
ensure that the command buffer commit is within transaction scope. This works in
most cases as there there is usually an implicit (possibly nested) transaction
in place during rendering. However, when there isn’t, rendering will look paused
at an incorrect size. This code now works similar to OpenGL but will be
refactored for ease of understanding and consistency between the various
backends.
Currently every Linux runner has this code to allow relative resource paths; this moves it into the framework so that any embedder can get this behavior without that code needing to be in the template.
Rolls buildroot to pick up std::filesystem support in our libc++
Fuchsia benchmarks depend the name being precisely "vsync callback".
Since this is causing immediate build issues, change it back to "vsync
callback" on Fuchsia. Stronger testing for this in the long run is
currently under discussion.
b/150902962
This moves the Metal `GrContext` creation utilities from `GPUSurfaceMetal` into
a separate `IOSContext` object subclass. An analogue of this object was used in
the GL regime for the management of onscreen and offscreen contexts that were
not tied to the lifecycle of the `GPUSurface`. This pattern has now been
generalized for use with all backends that need a resource context
(`IOSContextGL` and `IOContextMetal`).
The platform views controller management in the `ExternalViewEmbedder` interface
implementation was repeated three times for [Metal][metal], [OpenGL](opengl) and
[Software](software) rendering. This repetition has been removed and a single
implementation present in the base `IOSSurface` and used on all platforms.
Addition of new client rendering APIs should not affect how the engine renders
into the platform view interleaving levels.
All rendering API selection logic has been moved into a single set of utilities
in `rendering_api_selection.h`. This enables the removal of a lot of code blocks
guarded by `FLUTTER_SHELL_ENABLE_METAL`. The remaining uses of this will be
removed when unified builds are enabled.
The Metal backend now also adds traces similar to the GL backend.
The `IOGLContext` has been renamed to `IOContextGL` to be more in line with the
convention used in this library.
Fixes https://github.com/flutter/flutter/issues/41827
Adds https://github.com/flutter/flutter/issues/52150
[metal]: 46dbf3a761/shell/platform/darwin/ios/ios_surface_metal.mm (L55)
[opengl]: 46dbf3a761/shell/platform/darwin/ios/ios_surface_gl.mm (L95)
[software]: 46dbf3a761/shell/platform/darwin/ios/ios_surface_software.mm (L146)
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). Ideally VSYNC events are generated by the host system at their source. System VSYNC events are indeed present in full-system systraces. Flutter-level traces (as seen in Observatory/Flutter devtools) do not contain the system VSYNC events, so we rely on the engine to generate them (as close to where they would be generated by the system ideally).
Currently the common (platform-independent code) generates VSYNC events at the time when the UI thread starts processing a frame. This has two drawbacks:
1. The traces are generated with a delay (we wait for the callback to be have been scheduled on the UI thread instead of tracing as soon as the system notified us.
2. When inspecting system-wide traces we'll have both the system and the Flutter app (or potentially multiple Flutter apps) generate VSYNC events at the same time. This confuses both the developers and the trace viewer.
This change moves the VSYNC event generation to the platform-specific embedder implementations:
1. On Android/iOS we always generate the VSYNC event since Android/iOS developers use Flutter tools to debug the apps.
2. On Fuchsia we do not generate VSYNC events since the systraces always contain them.
3. In the Embedder wrapper we don not generate VSYNC events and rely on the actual embedder to do this in a way appropriate for the target system.
On Linux, there is rarely just one default font that can reasonably be expected to be on the platform. This PR changes the GetDefaultFontFamily call to be GetDefaultFontFamilies, and it now returns a vector<string> so that the font collection code can look up all of them, and if any of them exist, add them to the fallback list.
For Linux, I supplied the list "Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", and "Arial", which should cover a large proportion of linux machines. For the other platforms, I supplied a list of length one, containing the one fallback font that used to be defined. On Windows, I added "Segoe UI" as a default, since that is the default system font on newer Windows.
The goal of this function is to provide at least one font family that is installed, since otherwise linux (or any platform) will just have no font at all if the default font isn't found.
Skia expects an EGL context, but GLFW was defaulting to non-EGL, which
causes eglGetCurrentDisplay to fail--since the context wasn't made
current via EGL--with new versions of libglvnd. (It may have worked only
by accident with previous versions).
Fixes https://github.com/flutter/flutter/issues/47954
* Add support for software text editing controls
Includes selection, copy, cut, paste, as well as partial support for up
and down movement.
Text editing controls can be accessed in GBoard by:
top-left arrow > three dots menu > text editing
Partial fix for flutter/flutter#9419 and flutter/flutter#37371.
* Introduce InputConnectionAdaptor tests
Run with:
testing/run_tests.py --type=java --java-filter=io.flutter.plugin.editing.InputConnectionAdaptorTest
* Fix BUILD.gn comment on run_tests.py --java-filter flag