1813 Commits

Author SHA1 Message Date
Emmanuel Garcia
70f6d18bfa
Revert "Implement unobstructed Platform Views on iOS (#17049)" (#17233)
This reverts commit 2627634be807a28f4d56c5d7cd878c3ff6ce07ac.
2020-03-20 14:46:09 -07:00
Emmanuel Garcia
2627634be8
Implement unobstructed Platform Views on iOS (#17049) 2020-03-20 12:38:58 -07:00
stuartmorgan
373ebe6430
Fix copy/paste mistake in GLFW asset path resolution (#17208)
Fixes a regression from #16944
2020-03-19 11:04:43 -07:00
George Wright
498dc77361
Truncate error messages for the crash reporter to the maximum length permitted by the FIDL call (#17189) 2020-03-18 13:08:54 -07:00
Wu Zhong
3a2cc95533
Fixes comments typo in FlutterPlatformViews (#17094) 2020-03-17 21:38:53 -07:00
stuartmorgan
710f738dd6
Allow relative resource paths in GLFW embedding (#16944)
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++
2020-03-17 19:04:18 -07:00
Chinmay Garde
d8e45f9c14
Update the Metal backend selection to use iOS 10.0 and A7 as the version floor. (#17162)
Fixes https://github.com/flutter/flutter/issues/52356
2020-03-15 14:35:48 -07:00
Emmanuel Garcia
025e2d82dd
Migrate embedding to AndroidX (#17075) 2020-03-13 21:19:24 -07:00
Chinmay Garde
cedddb7075
Document texture registry threading requirements. (#17149) 2020-03-13 18:55:58 -07:00
xster
1ff81bc117
Make a pass through all the embedding javadocs (#17109) 2020-03-13 16:34:34 -07:00
Emmanuel Garcia
25cded5742
Fix link in readme (#17119) 2020-03-12 13:59:31 -07:00
Emmanuel Garcia
cbc8713fdd
Define embedding dependencies in Gradle (#17116) 2020-03-12 13:49:46 -07:00
Chinmay Garde
3f287ab58e
Remove the unused method on iOS surface to make the resource context current. (#17084) 2020-03-11 00:46:02 -07:00
Chinmay Garde
a0010512df
Disable Embedder11yTest::A11yTreeIsConsistent to unblock LUCI. (#17081)
See https://github.com/flutter/flutter/issues/52372
2020-03-10 18:48:23 -07:00
Chinmay Garde
17e07c537e
Implement asynchronous texture uploads when using the Metal backend on iOS. (#17046)
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]: 1194ba2b21/shell/platform/darwin/ios/ios_surface_metal.mm (L55)
[opengl]: 1194ba2b21/shell/platform/darwin/ios/ios_surface_gl.mm (L95)
[software]: 1194ba2b21/shell/platform/darwin/ios/ios_surface_software.mm (L146)
2020-03-10 16:01:53 -07:00
Chinmay Garde
bcefcdb880
Use the ELF loader to setup AOT symbols in benchmark runner. (#17051)
We no longer package AOT artifacts as discrete blobs. The portable ELF loader
from the testing library may be used instead.

Fixes https://github.com/flutter/flutter/issues/52263
2020-03-10 12:28:24 -07:00
gaaclarke
d323bace5f
doxygen tooling updates and doxygen for FlutterCodecs.h (#16947)
- added tools to help us document Flutter.framework for iOS
- filled in FlutterCodecs.h's missing documentation
2020-03-06 16:06:06 -08:00
gaaclarke
c15f239c1e
documented fluttertexture.h (#16950) 2020-03-06 14:28:56 -08:00
Duong Nguyen
fe051e08ac
Fix issue viewdidload call while init FlutterViewController (#16672)
Co-authored-by: Aaron Clarke <aaclarke@google.com>
2020-03-06 09:35:40 -08:00
Felipe Archondo
98f9941843
[fuchsia] fix broken flows when under high load (#16834) 2020-03-06 11:33:31 -05:00
gaaclarke
ec68bd6ec4
Fixed FlutterPlugin.h doxygen. (#16945) 2020-03-05 10:04:13 -08:00
Kirill Nikolaev
7381ca8ddf
Avoid generating VSYNC trace events from Flutter common code. (#16248)
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.
2020-03-05 16:59:43 +01:00
Greg Spencer
8ff6948e23
Make GetDefaultFontFamilies return a vector<string> instead of… (#16928)
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.
2020-03-05 00:45:53 +01:00
Matt Carroll
482155b3c6
Fixed splash screen crash when bringing Android app back to foreground after being evicted from memory. (#47635) (#16916) 2020-03-04 11:27:12 -08:00
gaaclarke
59b4d9b3b8
Fixed the ability to scroll to the top on iOS 13 (#16820) 2020-03-04 10:53:11 -08:00
Flutter GitHub Bot
3362c5fa9e
Remove debug log (#16932) 2020-03-04 10:36:03 -08:00
stuartmorgan
e2b74ab80e
Request EGL in GLFW window creation (#16924)
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
2020-03-04 14:00:44 +01:00
Edman P. Anjos
9beac71a2e
Add support for software text editing controls (#15560)
* 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
2020-02-28 20:18:04 +01:00
Kaushik Iska
a16d97e507
Revert "fuchsia: remove use of replace_as_executable (#16690)" (#16829)
This reverts commit ff921cd608efaf3aecd3e3e0feb14bb540cc22ed.
2020-02-27 10:13:26 -08:00
Kaushik Iska
060a7733a6
Roll fuchsia/sdk/core/linux-amd64 from QU3ft... to 94el1... (#16821) 2020-02-26 15:44:59 -08:00
stuartmorgan
52070e3df7
Fix handler unregistration in C++ channels (#16794)
MethodChannel and BasicMessageChannel in the C++ wrapper didn't have the
expected semantics that passing a null handler would remove any existing
handler. This was inconsistent with other platforms and with the
lower-level object APIs in this wrapper, and made unregistration in
cases where that's desirable more difficult due to needing to keep other
object references.

Adds tests for this functionality, and some backfill of missing tests
for basic handler behavior.

See https://github.com/flutter/flutter/issues/51207
2020-02-25 14:09:58 -08:00
Drew Fisher
ff921cd608
fuchsia: remove use of replace_as_executable (#16690)
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
should be 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).

Test: verified locally that this works on Astro on a _user build with
the runtime allowlist tightened.
2020-02-25 13:24:07 -08:00
Dan Field
888a62cf22
Revert "Enable lazy-async-stacks by-default in all modes (#16556)" (#16781)
This reverts commit fdabcaddf45deaf93a5238c99c2acbeb25a3a027.
2020-02-24 20:04:40 -08:00
Chinmay Garde
92abb22c64
Reland "Lift restriction that embedders may not trample the render thread OpenGL context in composition callbacks." (#16711)
This reverts commit ef9e7b1a1365c07ab0df2e2016c4442c3963c2c7 with the following changes to accommodate an embedder for whom the original optimizations caused issues:

* Ensure stable order in the backing stores presented to the embedder. This is a pessimization that will be reverted when the embedder migrates. Tracked in  https://github.com/flutter/flutter/issues/51228
* Forego the optimization where the unused layers would be collected before allocation of new layers needs to happen. This is a pessimization that will be reverted when the embedder migrates. Tracked in  https://github.com/flutter/flutter/issues/51229

More context in b/146142979.
2020-02-24 11:48:32 -08:00
Filip Filmar
38dc2ea67c
[i18n] Deprecates fuchsia.timezone.Timezone (#16700)
The FIDL interface `fuchsia.timezone.Timezone` does not exist for quite
a while now.  Instead, a transitional `fuchsia.timezone.Timezone` should
be used.

Fixes flutter/flutter#51087
2020-02-24 11:44:30 -08:00
Chris Bracken
1aef7a4369
Delete FlutterAppDelegate_Internal.h (#16772) 2020-02-24 11:11:03 -08:00
Miguel Beltran
d0c2418dfe
Add support for Increase Contrast on iOS (#15343) 2020-02-22 14:04:04 -08:00
Ryan Macnak
930a80ac86
Fix some compiler warnings in newer versions of Clang. (#16733) 2020-02-21 12:57:06 -08:00
Justin McCandless
02aa865da3
Fix the newline on some keyboards (#16560) 2020-02-20 10:36:03 -08:00
Martin Kustermann
fdabcaddf4
Enable lazy-async-stacks by-default in all modes (#16556)
This was already enabled by-default in AOT mode in [0] - which made the
gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks".

See go/dart-10x-faster-async for more information.

[0] https://github.com/flutter/flutter/commit/347823234fd
2020-02-20 18:31:26 +01:00
xster
1b73784945
fix param (#16694) 2020-02-19 15:06:06 -08:00
Chinmay Garde
ef9e7b1a13
Revert "Lift restriction that embedders may not trample the render thread OpenGL context in composition callbacks. (#16653)" (#16674)
This reverts commit 110c1c9adf0f580d16c8252e3b37992af93e9cea.
2020-02-18 18:59:21 -08:00
Chinmay Garde
110c1c9adf
Lift restriction that embedders may not trample the render thread OpenGL context in composition callbacks. (#16653)
During the implementation of custom compositor integration, the embedder gets
callbacks on the render thread to prepare render targets (framebuffers,
textures, etc) for the engine to render into, callbacks to present these render
targets along with platform managed contents, and, callbacks to collect render
targets once they can no longer be recycled by the engine in subsequent frames.
During these callbacks, the engine mandates the OpenGL state on the render
thread be preserved. This restriction has been the source of hard to isolate
issues where the embedder trampled on the OpenGL bindings state in the callback
but failed to restore state before control went back to the engine. Due to the
nature of the OpenGL API, such errors are easy to make and overlook. This patch
lifts the restriction from the embedder. Embedders may now freely work with the
OpenGL state in custom compositor callbacks and the engine will make sure to
disregard OpenGL bindings when control flows back to it.

Disregarding current OpenGL state has a certain performance penalty and the
majority of this patch handles refactoring various engine embedder components
such that this happens only once per frame. The most trivial version of this
patch would reset context bindings on every transition of control flow from the
embedder to the engine. However, that naive approach would have necessitated
more than 50 binding resets in existing unit-test cases (depending on the number
of platform view interleaving levels and render target recycling hit rates). In
this implementation, bindings will be reset only once per frame and this does
not depend on the number of platform views in the scene.

The majority of this patch is a refactoring of engine subsystems used in
`ExternalViewEmbedder::SubmitFrame` which is thoroughly documented with each
opportunity for the embedder to invalidate OpenGL state tagged.

The refactoring also enables the implementation of the following optimizations
to engine behavior which should aid in reducing the memory needed for the
creation of render targets. These optimization include:
* The engine will only ask the embedder for render targets in which it expects
  to render into. This was a quirk in the way in which root and non-root render
  targets were handled. The engine could require the embedder to create a render
  target but then realize it didn’t have anything to render into it. In the
  presentation callback, it would skip that render target. But the embedder
  still had to allocate that extra render target. This will no longer be the
  case and should reduce memory use.
* The engine may now skip always realizing (via the embedder render target
  creation callback) and presenting the root render target. This was also a side
  effect of the same quirk. Previously, the engine would always ask the embedder
  to present the root render target even if it was empty. Since this is no
  longer the case, few render targets should be allocated which will reduce
  memory consumption.
* The engine will now ask the embedder to collect unused render targets before
  it asks it to create new ones. The previous behavior was to ask the embedder
  for new targets and then collect old ones. This would cause spikes in memory
  use when the size of the render targets would change. These memory use spikes
  should now be troughs.
* The previous render target cache also considered the platform view ID in cache
  viability considerations (instead of just the size of the render target). This
  was a bug which has been fixed. This should lead to better cache utilization
  in some situations.

These optimizations are now codified in unit-tests and the updated test
expectations are a result of these optimizations now being in place.

* Fixes https://github.com/flutter/flutter/issues/50751
* Fixes https://github.com/flutter/flutter/issues/46911
* Fixes https://github.com/flutter/flutter/issues/43778
* Fixes b/146142979
2020-02-18 12:51:49 -08:00
Matt Carroll
f39bc73d6a
Exposes FlutterSurfaceView, and FlutterTextureView to FlutterActivity and FlutterFragment. (#41984, #47557) (#16552) 2020-02-12 19:21:00 -08:00
Gary Qian
c4c6ef6719
Samsung keyboard duplication workaround: updateSelection (#16547) 2020-02-12 19:51:40 -05:00
Michael Klimushyn
7c67573896
Fix multiline Javadoc code blocks (#16565)
The formatter didn't understand what was going on here and broke the
text. Changed these to use `<pre>{@code }</pre>` instead.
2020-02-12 15:07:16 -08:00
Chris Yang
5fb0116d62
iOS platform view gesture blocking policy. (#15940) 2020-02-11 15:34:59 -08:00
Matt Carroll
ca02b9197e
Prevent long flash when switching to Flutter app. (#47903) (#16527) 2020-02-11 15:26:27 -08:00
Matt Carroll
270421c103
Fix ensureInitializationCompleteAsync callback when already initialized. (#39675) (#16503) 2020-02-11 15:25:58 -08:00
Gityuan
5041ff1b1e
support endless trace buffer (#16520) 2020-02-11 15:08:03 -08:00