2104 Commits

Author SHA1 Message Date
Chinmay Garde
52e75cba16 Use the ELF loader to setup AOT symbols in benchmark runner. (flutter/engine#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
46c52ba051 doxygen tooling updates and doxygen for FlutterCodecs.h (flutter/engine#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
991d11ca02 documented fluttertexture.h (flutter/engine#16950) 2020-03-06 14:28:56 -08:00
Duong Nguyen
56309c96cf Fix issue viewdidload call while init FlutterViewController (flutter/engine#16672)
Co-authored-by: Aaron Clarke <aaclarke@google.com>
2020-03-06 09:35:40 -08:00
Felipe Archondo
64beefcc3a [fuchsia] fix broken flows when under high load (flutter/engine#16834) 2020-03-06 11:33:31 -05:00
gaaclarke
fc5784c61c Fixed FlutterPlugin.h doxygen. (flutter/engine#16945) 2020-03-05 10:04:13 -08:00
Kirill Nikolaev
810209faf5 Avoid generating VSYNC trace events from Flutter common code. (flutter/engine#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
6a2e36c37f Make GetDefaultFontFamilies return a vector<string> instead of… (flutter/engine#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
9c9898bc94 Fixed splash screen crash when bringing Android app back to foreground after being evicted from memory. (#47635) (flutter/engine#16916) 2020-03-04 11:27:12 -08:00
gaaclarke
f5761ab436 Fixed the ability to scroll to the top on iOS 13 (flutter/engine#16820) 2020-03-04 10:53:11 -08:00
Flutter GitHub Bot
7c5f697b32 Remove debug log (flutter/engine#16932) 2020-03-04 10:36:03 -08:00
stuartmorgan
d1c97282f2 Request EGL in GLFW window creation (flutter/engine#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
519eae37a0 Add support for software text editing controls (flutter/engine#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
8aa555d1ec Revert "fuchsia: remove use of replace_as_executable (#16690)" (flutter/engine#16829)
This reverts commit 94c31a6e2ac9c81fb1d155407745948214de5051.
2020-02-27 10:13:26 -08:00
Kaushik Iska
67a36c5e5d Roll fuchsia/sdk/core/linux-amd64 from QU3ft... to 94el1... (flutter/engine#16821) 2020-02-26 15:44:59 -08:00
stuartmorgan
b86b2a9bee Fix handler unregistration in C++ channels (flutter/engine#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
94c31a6e2a fuchsia: remove use of replace_as_executable (flutter/engine#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
0267c56245 Revert "Enable lazy-async-stacks by-default in all modes (#16556)" (flutter/engine#16781)
This reverts commit a39aad4a0305f2525479d055ecc3ddfbf45d303b.
2020-02-24 20:04:40 -08:00
Chinmay Garde
df4a467fad Reland "Lift restriction that embedders may not trample the render thread OpenGL context in composition callbacks." (flutter/engine#16711)
This reverts commit 79c230fc7b9aa3bb13dcf38cdfe213256c73028a 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
b38381174c [i18n] Deprecates fuchsia.timezone.Timezone (flutter/engine#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
b5f53219d9 Delete FlutterAppDelegate_Internal.h (flutter/engine#16772) 2020-02-24 11:11:03 -08:00
Miguel Beltran
0858707729 Add support for Increase Contrast on iOS (flutter/engine#15343) 2020-02-22 14:04:04 -08:00
Ryan Macnak
101b70147f Fix some compiler warnings in newer versions of Clang. (flutter/engine#16733) 2020-02-21 12:57:06 -08:00
George Wright
21f28db400 Flush the SkCanvas when submitting a frame in ShellTestPlatformViewVulkan::OffscreenSurface (flutter/engine#16717) 2020-02-20 15:18:36 -08:00
freiling
07bfcf19f1 [shell tests] Integrate Vulkan with Shell Tests (flutter/engine#16621)
This change creates a test only implementation of flutter::Surface backed by an
offscreen Vulkan GrContext. Much of the code in this test Surface was lifted
from flutter::VulkanWindow which I was unable to use without extricating it
from the VkSurface/VkSwapchain code which we do not want to use in offscreen
tests. I would recommend refactoring VulkanWindow to separate GrContext
creation and VkSwapchain creation in order to promote greater code reuse
between onscreen and offscreen vulkan paths.

This change is excersised thoroughly by the shell tests and was manually
tested against these tests on Fuchsia on Intel.
2020-02-20 11:37:00 -08:00
Justin McCandless
9c628f10d8 Fix the newline on some keyboards (flutter/engine#16560) 2020-02-20 10:36:03 -08:00
Martin Kustermann
a39aad4a03 Enable lazy-async-stacks by-default in all modes (flutter/engine#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
dbaba67232 fix param (flutter/engine#16694) 2020-02-19 15:06:06 -08:00
Chinmay Garde
79c230fc7b Revert "Lift restriction that embedders may not trample the render thread OpenGL context in composition callbacks. (#16653)" (flutter/engine#16674)
This reverts commit 277bc6c62bf686874e6e519a8bf5707a5d794cf3.
2020-02-18 18:59:21 -08:00
Chinmay Garde
277bc6c62b Lift restriction that embedders may not trample the render thread OpenGL context in composition callbacks. (flutter/engine#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
George Wright
f99b991c2b Revert "[shell tests] Integrate Vulkan with Shell Tests"
This reverts commit 57a8e04df9bd24b313ca4c309e7c8ba904559ea1.
2020-02-14 13:02:38 -08:00
Forrest Reiling
57a8e04df9 [shell tests] Integrate Vulkan with Shell Tests
This change creates a test only implementation of flutter::Surface backed by an
offscreen Vulkan GrContext. Much of the code in this test Surface was lifted
from flutter::VulkanWindow which I was unable to use without extricating it
from the VkSurface/VkSwapchain code which we do not want to use in offscreen
tests. I would recommend refactoring VulkanWindow to separate GrContext
creation and VkSwapchain creation in order to promote greater code reuse
between onscreen and offscreen vulkan paths.

This change is excersised thoroughly by the shell tests and was manually
tested against these tests on Fuchsia on Intel.
2020-02-14 12:56:16 -08:00
Matt Carroll
bd50ab762a Exposes FlutterSurfaceView, and FlutterTextureView to FlutterActivity and FlutterFragment. (#41984, #47557) (flutter/engine#16552) 2020-02-12 19:21:00 -08:00
Gary Qian
45f630128d Samsung keyboard duplication workaround: updateSelection (flutter/engine#16547) 2020-02-12 19:51:40 -05:00
Michael Klimushyn
771bdcccec Fix multiline Javadoc code blocks (flutter/engine#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
9016c390ee iOS platform view gesture blocking policy. (flutter/engine#15940) 2020-02-11 15:34:59 -08:00
Matt Carroll
d9dfa09e64 Prevent long flash when switching to Flutter app. (#47903) (flutter/engine#16527) 2020-02-11 15:26:27 -08:00
Matt Carroll
d7902954e9 Fix ensureInitializationCompleteAsync callback when already initialized. (#39675) (flutter/engine#16503) 2020-02-11 15:25:58 -08:00
Gityuan
520e35acb2 support endless trace buffer (flutter/engine#16520) 2020-02-11 15:08:03 -08:00
Francisco Magdaleno
a3722df46e Expose DPI helper functions for Runner apps to use (flutter/engine#16313) 2020-02-11 15:03:03 -08:00
Kaushik Iska
acd3965ba4 [fuchsia] Disable retained layers (flutter/engine#16548)
Retained surfaces are being prematurely recycled.
Temporarily disabling them until they are reworked.
2020-02-11 14:15:31 -08:00
George Wright
e2e15d08e4 Enable verbose logging for shell unittests on Fuchsia (flutter/engine#16526) 2020-02-10 14:39:03 -08:00
Dan Field
c8507b069f Apply lints from internal roll (flutter/engine#16509) 2020-02-10 13:53:04 -08:00
Michael Klimushyn
2ad0c2ebe7 Apply Google Java format (flutter/engine#16501)
This shouldn't result in any logical changes. I've done a quick smoke
test by building a local Android engine and running Flutter gallery, no
compile errors or other obvious issues.

Applied by running `/ci/format.sh | patch -p0` with the altered script
added in flutter/engine#16500. I did locally modify the script slightly
further so it would run against all Java files in the repo instead of
just modified ones.
2020-02-07 16:10:46 -08:00
Matt Carroll
7a8e698211 Fix safe area reporting with transparent FlutterActivitys. (#46060) (flutter/engine#16208) 2020-02-07 14:57:06 -08:00
Alexander Brusher
82ffcd8ee8 Update node fields fix (flutter/engine#16428)
* Modifies accessibility bridge to populate new node fields in semantics API.

* Adds additional UTs and fixes logic for breaking up updates for nodes with large values.

* Chaged tests to set node flags using bitwise-or instead of addition.

* Address bug in update size arithmetic.

* Fixes issue in TruncatesLargeValue unit test causing unexpected deletes.

* Fixes expected number of updates in BatchesLargeMessages unit test to reflect expected values now that node states are populated.
2020-02-07 13:24:36 -08:00
Chris Bracken
b9545c70c0 Fix unused import in Android embedder (flutter/engine#16494)
android.os.Parcelable was added in commit
177353d759452c998879b3ac7a05d9dc6e437466 but never used.
2020-02-07 12:26:50 -08:00
Dan Field
21f6cef10b Fix text range logic for a11y (flutter/engine#16496)
Make sure that a text range at the end of the string is still valid.
2020-02-07 12:20:30 -08:00
Francisco Magdaleno
40c7f488e9 Code cleanup on destructors (flutter/engine#16481) 2020-02-06 16:53:02 -08:00
George Wright
69e635c0fc Enable shell_unittests on Fuchsia with Vulkan dependencies. (flutter/engine#16376)
This also adds a dependency on SwiftShader's Vulkan frontend.
2020-02-06 15:07:01 -08:00