2838 Commits

Author SHA1 Message Date
Robert Ancell
516cbaee87
Explicitly make the X connection for EGL. (#21831)
Explicitly make the X connection for EGL.

EGL can mistakenly choose the GBM backend when using EGL_DEFAULT_DISPLAY.

Fixes https://github.com/flutter/flutter/issues/60429
2020-10-15 11:06:08 +13:00
Jason Simmons
c7e5d546f2
Prevent a race between SurfaceTexture.release and updateTexImage (#21777) 2020-10-14 15:02:02 -07:00
Kaushik Iska
df57e21529
[android] Refactor surface factory and wire in external view embedder (#21839) 2020-10-14 14:27:02 -07:00
egdaniel
d95a5dc6ad
Update flutter to pass Skia the VkImageUsageFlags and Samples (#21842)
Previously Skia did not require the clients to pass in the usage flags and Skia would just assumed they contained specific ones depending on how the client wrapped the VkImage. Now Skia allows the client to pass in the specific usage flags used so that Skia knows exactly what type of operations are legal without having to guess/assume what the client did.

Also update to set the sample count as well while I'm in here.
2020-10-14 13:55:09 -07:00
Felipe Archondo
8772365537
[fuchsia] add intercept_all_input flag support (#21821)
[fuchsia] add intercept_all_input flag support

This change also fixes an issue where FlutterRunnerProductConfiguration
crashes when a field is missing, when building with --unopt.

Test: Added unit tests
Bug: fxb/61466, fxb/61942
2020-10-13 22:11:24 -04:00
Jason Simmons
2e3f1326d2
Call PlatformView.dispose when removing hybrid composition platform views (#21790)
Also force disposal of all hybrid platform views when shutting down the
engine.

Fixes https://github.com/flutter/flutter/issues/66764
2020-10-13 18:40:55 -07:00
Kaushik Iska
279c1cffbe
[ios] Create a standalone external view embedder on iOS (#21798) 2020-10-13 17:56:31 -07:00
Emmanuel Garcia
9981026173
Allow TalkBack navigation while a platform view is rendered (#21719) 2020-10-13 17:52:02 -07:00
Dan Field
6ba6d81295
Ocmock dylib (#21786)
- Build OCMock as a dylib for iOS tests
- Set install_name for ios_flutter_test and ocmock dylibs
- Copy and sign dylibs during build process
2020-10-13 09:36:29 -07:00
Damian Wrobel
6634406889
Support Wayland only (without X11 support in gdk) (#21218)
Adds a support for compiling flutter engine when
gdk does not have X11 backend. In such a configuration
the generated gdkconfig.h header file looks like the following:

 /* gdkconfig.h
  *
  * This is a generated file.  Please modify `configure.ac'
  */

 #ifndef __GDKCONFIG_H__
 #define __GDKCONFIG_H__

 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
 #error "Only <gdk/gdk.h> can be included directly."
 #endif

 #include <glib.h>

 G_BEGIN_DECLS

 #define GDK_WINDOWING_WAYLAND

 G_END_DECLS

 #endif  /* __GDKCONFIG_H__ */

Additionally headers like <gdk/gdkx.h> are not available at all.

Above configuration can be found on the most of the embedded systems.

This patch enables compilation of X11 specific code only when gdk
defines GDK_WINDOWING_X11.

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2020-10-13 15:54:44 +13:00
J-P Nurmi
d9a24814c5
Add workaround for missing fl_method_xxx_response_get_type() symbols (#21405) 2020-10-12 19:32:02 -07:00
Yuqian Li
c2938d06b1
Revert "Migration to PlatformDispatcher and multi-window #20496" (#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit 931a04683d6eb49fc92059b2384ac5b1618d5422.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit 85b0031f73544e448354047dc6a236c0b0808252.
2020-10-12 19:26:41 -07:00
Chris Bracken
05d97932b3
Extract a TextRange class for selection (#21722)
Extracts a TextRange class with a base and extent, and start(), end(),
collapsed(), and length() getters.

The possibility of reversed base and extent in selections and composing
ranges makes reasoning about them complex and increases the chances of
errors in the code. This change migrates most uses of base and extent in
the text model to start()/end() or position(). The position() method is
intended purely as an aid to readability to indicate that a collapsed
selection is expected at the call site; it also enforces a debug-time
assertion that this is the case.
2020-10-12 17:50:11 -07:00
Yuqian Li
190fd8eb51
Reland "Create root isolate asynchronously (#20142)" (#21747)
This reverts commit 5585ed99039efb3705025e1c58170cdb86af111b.

Additionally, the following _flutter.runInView deadlock is fixed.

Previously, a deadlock would occur when service protocol
_flutter.runInView is used to restart the engine wihtout tearing down
the shell: the shared mutex of the service protocol will be locked
during the restart as it's in the middle of handling a service protocol
message; if ServiceProtocol::AddHandler is also called during the
restart, the deadlock happens as AddHandler also requires such lock.

test/integration.shard/background_isolate_test.dart would fail
without this fix.
2020-10-12 12:02:30 -07:00
gaaclarke
a2046aeb6c
Revert "fix On iOS, dialog titles are announced twice (#19826)" (#21714) 2020-10-09 19:57:04 -07:00
Alexander Markov
0d151816c3
Remove uses of Dart VM bytecode mode from Flutter engine (#21741) 2020-10-09 16:34:08 -07:00
Greg Spencer
85b0031f73
Migration to PlatformDispatcher and multi-window (#20496)
This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-09 16:29:16 -07:00
George Wright
11d756a62e
Add dart_entrypoint_argc/argv to the FlutterProjectArgs (#21737) 2020-10-09 16:17:02 -07:00
Kaushik Iska
5c1960284a
Fix filesystem access prior to macOS 10.15 (#21740) 2020-10-09 13:42:01 -07:00
Chris Bracken
48d837b7ee
Perform selection check in DeleteSelected (#21711)
At every call site for TextInputModel::DeleteSelected, we perform a
check for a collapsed selection. This moves that check into the method
itself.
2020-10-08 16:02:06 -07:00
Dan Field
48687ca3ca
Forbid android.util.Log (#21696) 2020-10-08 14:52:05 -07:00
J-P Nurmi
2ab369fca1
fl_method_response.cc: fix lint failures (#21406)
Fix lint issues caused by `google-readability-braces-around-statements`.
2020-10-08 14:47:07 -07:00
Hamdi Kahloun
b2ace0cccb
SecurityException: Permission Denial (#21290)
Fix `java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider`

Fixes flutter/flutter#66108

Co-authored-by: Dan Field <dfield@gmail.com>
2020-10-08 14:36:51 -07:00
Kaushik Iska
8b1799b616
[macOS] Fix docs for loadAOTData and minor refactor (#21699) 2020-10-08 11:34:02 -07:00
Kaushik Iska
75bc9360d9
[macOS] flutter_desktop_darwin_unittests can be enabled for all runtime modes (#21681) 2020-10-08 10:12:03 -07:00
Jason Simmons
b474a508a7
Remove dependencies on _product variants of libdart from the Fuchsia release mode build (#21668) 2020-10-08 09:55:43 -07:00
Jonah Williams
15c587404c
Preserve specified AssetResolvers when performing a hot restart or updating the asset directory (#21611)
Follow up from #21436 . That PR works for all embeddings except for Android, which creates a special JNI AssetResolver. Since the shell cannot recreate this resolver, update the logic to preserve existing resolvers instead.
2020-10-08 09:22:01 -07:00
Dan Field
4c6f2ad747
Skip flaky test (#21694) 2020-10-08 08:25:48 -07:00
Chris Bracken
21a6aa2c75
Make TextInputModel::selection_start/end const (#21685)
Neither of these methods mutate the state of the model.
2020-10-07 22:04:02 -07:00
Chris Bracken
fbe6859106
Store selection base/extent as integers (#21663)
Previously, the selection base and extent were stored internally as
iterators over text_. Since iterators must be treated as invalidated
whenever the underlying container changes, this requires that
selection_base_ and selection_extent_ be re-assigned after every change
to text_.

This is not currently particularly problematic, but once we add fields
to track the base and extent of the composing region for multi-step
input method support, as well as support for the sub-range within the
composing region to which edits/completions apply, we end up having to
regenerate a lot of iterators with each change, many of which are
logically unchanged in position.

A side benefit is that this simplifies inspection of these fields when
debugging.
2020-10-07 18:31:17 -07:00
Chinmay Garde
a068e459ae
Avoid leaking the FlutterEngineAOTData structure in FlutterEngineCollectAOTData. (#21680) 2020-10-07 17:57:04 -07:00
Pieter van Loon
85ed656722
Enabled metal on ios simulator (#17881) 2020-10-07 17:47:03 -07:00
Emmanuel Garcia
aab33c155a
Ensure JNI is not called from raster thread (#21665) 2020-10-07 16:37:02 -07:00
Kaushik Iska
15739917f3
[macOS] Allow loading of AOT snapshots and instructions from elf bundle (#21670) 2020-10-07 16:34:49 -07:00
Kaushik Iska
2eac514f26
Run desktop darwin tests in debug mode (#21660) 2020-10-07 16:32:01 -07:00
David Worsham
d5dddf32e7
fuchsia: Don't send ViewportMetrics w/ 0 DPR (#21392) 2020-10-06 17:57:28 -07:00
Justin McCandless
9a7b556f91
hasStrings Linux (#21388)
hasStrings method for clipboard status, Linux
2020-10-06 16:29:12 -07:00
George Wright
ea420db5fd
Use the gpu config for shell_unittests to declare SHELL_ENABLE_{GL,VULKAN} (#21603) 2020-10-06 12:47:02 -07:00
stuartmorgan
042c7f0422
[linux] Allow engine flags via environment vars (#21497)
Adds the ability to pass engine switches temporarily at runtime via
environment variables. Uses the same approach recently added to
Windows and macOS.

This is enabled only for debug/profile to avoid potential issues with
tampering with released applications, but if there is a need for that in
the future it could be added (potentially with a whitelist, as is
currently used for Dart VM flags).

Fixes flutter/flutter#60393
2020-10-06 11:17:19 -07:00
Chris Bracken
7e6191de07
Separate mutators for text and selection (#21612)
Previously, TextInputModel's SetEditingState method was a 1:1 mapping of
the underlying protocol used on the text input channel between the
framework and the engine. This breaks it up into two methods, which
allows the selection to be updated independently of the text, and avoids
tying the API the the underlying protocol.

This will become more important when we add additional state to support
composing regions for multi-step input methods such as those used for
Japanese.

SetText resets the selection rather than making a best-efforts attempt
to preserve it. This choice was primarily to keep the code simple and
make the API easier to reason about. An alternative would have been to
make a best-effort attempt to preserve the selection, potentially
clamping one or both to the end of the new string. In all cases where an
embedder resets the string, it is expected that they also have the
selection, so can call SetSelection with an updated selection if needed.
2020-10-06 11:07:21 -07:00
Sanjay Chouksey
bede93e532
Hookup view connected/disconnected events for platform view codepath (#21576)
This change adds support for forwarding scenic's viewConnected,
viewDisconnected and viewStateChanged events to flutter. The
corrensponding change on fuchsia side is at:
https://fuchsia-review.googlesource.com/c/topaz/+/434356

Test: Includes unittest to verify the events are forwarded.

Co-authored-by: Sanjay Chouksey <sanjayc@google.com>
2020-10-05 22:09:38 -07:00
Yuqian Li
e59e893d4e
Do not remove directories in purge (#21478)
Otherwise, the persistent cache may hold invalid directories and make
subsequent store fail.

The newly added unit tests would fail without the fix.
2020-10-05 20:05:00 -07:00
LongCatIsLooong
77d0760a32
Use absolute path in ios_test_flutter target (#21578) 2020-10-05 10:27:02 -07:00
Chris Yang
9ede9bfa43
iOS: only add explicit transactions when there are platform views (only on main threads) (#21526) 2020-10-02 14:57:01 -07:00
Sanjay Chouksey
af899d6529
Adds response to view requestFocus platformview message (#21550)
This change adds a response to the platform view message: requestFocus
This allows the caller to handle the case when the request fails with
an error value.

Co-authored-by: Sanjay Chouksey <sanjayc@google.com>
2020-10-02 14:20:50 -07:00
Jonah Williams
3c0da65c0c
Allow hot reload without syncing all asset files to devFS (#21436)
Always add the asset resolver from the configuration settings directory when restarting or recreating the asset manager
2020-10-02 14:09:07 -07:00
Justin McCandless
69cbb2bbb8
iOS Text Editing Infinite Loop (#20160)
Fixes an infinite loop by eliminating an unnecessary engine/framework message.
2020-10-02 13:51:50 -07:00
Jason Simmons
43828e86fa
Workaround for an Android emulator EGL bug that can cause inaccurate GL version strings (#21258) 2020-10-02 12:17:02 -07:00
Jason Simmons
88fd4cea43
Extract the WindowInsetsAnimation.Callback subclass into a separate class that will be lazily loaded (#21548)
WindowInsetsAnimation.Callback was introduced in API level 30.  This
PR moves the text input plugin's WindowInsetsAnimation.Callback subclass
into a class that will only be loaded if the embedding has checked for a
sufficient API level.

See https://github.com/flutter/flutter/issues/66908
2020-10-02 11:23:42 -07:00
David Worsham
2c3fc4aae0
embedder: Exclude GL code (#21544) 2020-10-01 12:20:10 -07:00