352 Commits

Author SHA1 Message Date
Chinmay Garde
56052c70af
Rename the shell namespace to flutter. (#8520) 2019-04-09 17:10:46 -07:00
Chinmay Garde
eec74e5c92
Rename the blink namespace to flutter. (#8517)
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
2019-04-09 12:44:42 -07:00
KyleWong
0bf708ee1a Refactor ios play input sound logic. (#7783)
As there are extra requirement to use playInputClick in iOS, use AudioServicesPlaySystemSound instead to play input sound.
2019-04-08 11:31:23 -07:00
xster
8b74cba20b
Make sure FlutterViewController flushs all pending touches when no longer active (#8400) 2019-04-04 16:22:37 -07:00
Chris Yang
cfe8675ff5
Delay platform view removal to submitFrame. (#8380)
Remove platform views inside OnDispose might cause issue if it happens before SubmitFrame and the active_composition_order has not been updated.
We will be left at a situation where the active_composition_order still contains the old view, but the view is actually removed from the UIView hierarchy.

We now cache the views need to be removed in OnDispose and actually remove them in SubmitFrame. At the same time, we remove stop detaching the subviews if they were disposed. 

As a side effect, this update will also fix flutter/flutter#30220
2019-04-01 17:06:32 -07:00
Dan Field
40eb74c50b
Make the resource context primary on iOS (#8387)
* Make resource context primary on iOS
2019-04-01 12:46:28 -07:00
Chris Yang
fd7d7fa5a0
Add a11y support for embedded iOS platform view (#8156)
Follow up the framework change in flutter/flutter#29304.
Inject the accessibility element tree in the semantic node if the node is for platform views.

flutter/flutter#29302
2019-03-26 16:04:42 -07:00
Kaushik Iska
a1dcb2ea98
[ios] Set contentsScale before we commit CATransaction (#8218)
Layout occurs after [CATransaction commit]. layoutSubviews was where we set the contentsScale on the CALayer. This meant that for one frame, we would see content on the overlay view which was did not have the correct content scale.

This change makes it so that we initialize the FlutterOverlayView with the correct contentsScale.

This also updates the overlay_gr_context_ when we first create the overlay_view. This is an artifact of #8175.

This manifests as jank as seen in: flutter/flutter#29573
2019-03-19 16:36:11 -07:00
Chris Yang
6980a83563
[platform_view] iOSP platformView composition optimize. (#8202)
Optimize the performance of the platform view composition.
When recomposition is required, we previously remove all the platform view related views (intercepting view, platform view) and re-add them for each frame. This is mentioned in flutter/flutter#23793.
This PR enhanced the performance by re-arrange the existing UIViews and only add the newly created Views.

As a result, it would also fix flutter/flutter#29427
2019-03-18 15:38:40 -07:00
Amir Hardon
629072277d
Merge only gpu and platform threads for platform views, fix deadlock. (#8045)
The reason we didn't merge just the gpu and platform threads from the get go was a deadlock in Shell:OnPlatformViewCreated and Shell:OnPlatformViewDestroyed.

The deadlock was caused by the platform thread starting a thread-hopping flow that ends ends up with the gpu thread releasing a latch that the platform thread is waiting on just after starting the cross-thread dance.
If the platform and gpu threads are the same, that last task that is posted to the gpu thread will never get executed as the gpu/platform thread is blocked on a latch.

This works around the deadlock by having a special case in the code for the scenario where the gpu and platform threads are the same.

Fixes: flutter/flutter#23974
2019-03-18 14:13:30 -07:00
Kaushik Iska
cad97fe746
Update overlays_gr_context_ correctly (#8175)
There can be cases where SubmitFrame gets called
before overlays are a part of the frame, in these
cases, we should not update the GRContext ahead of time.

This commit makes it so we will update it only when
the frame really shows the overlay.

This addresses: https://github.com/flutter/flutter/issues/28920
2019-03-15 08:35:48 -07:00
Core
260669c65e Fix deleting text when the last character is some special characters on IOS (#7982) 2019-03-08 10:47:06 -08:00
Dan Field
7426305f5d
Mark const extern (#8077)
* Mark const extern

* fix build
2019-03-07 16:10:03 -08:00
Dan Field
a93d99db98
A11y callback (#8005)
* implement callback for a11y readiness
* use FlutterSemanticsUpdateNotification from header, move to VC header
2019-03-06 16:53:14 -08:00
Chris Yang
effee2f80e
remove extra statement (#8041)
Remove an extra statement introduced in 36ca5740c7
2019-03-05 11:12:00 -08:00
Chris Yang
36ca5740c7
[platform_views] Fix duplicated touch event pass down to flutter view from platform view. (#8026)
Fix for flutter/flutter#27700 and flutter/flutter#24207

There are 2 fixes included in this PR.

The intercepting views sometime pass up the touches events to flutter view, even after the forward gesture recognizer pass the event to the flutter view. We only want the event to be passed to the flutter view once. So we let the intercepting view 'consumes' the event in this PR to fix the problem.

When a touch sequence has multiple touch points participated(e.g. Pinch gesture), the touchesBegan and touchesEnded can be triggered multiple times if the touches do not happen simultaneously. One example would be: when performing a pinch gesture with 2 fingers, I put down one finger, keep the finger on the screen, then put down another finger, perform pinch, lift up both finger at the same time. In this sequence, touchesBegan is called twice with each touch in one of the calls and touchesEnded is called once and has 2 touches in the callback. To handle this issue, we added a count to count the touches in one touch sequence. We only set the state to fail when the count reaches 0(That is all the touches has began in the current sequence is ended).
2019-03-04 15:55:32 -08:00
Dan Field
13064aec87
Add overloads for lookup that lets you specify a bundle (#8007)
* Add overloads for lookup that lets you specify a bundle

* check bundle with defaultBundleIdentifier before main bundle
2019-03-02 10:01:51 -08:00
Ben Konyi
fb1c543dd4
Link dart:* sources into engine for debugger source support (#7908)
Link dart:* sources into engine for debugger source support

Currently, dart:* libraries appear to have no source in
debuggers like Observatory. With this change, these sources will be
available in debug mode applications. Sources for dart:* libraries are
lazily loaded on a script-by-script basis.

Refer to https://dart-review.googlesource.com/c/sdk/+/93375 for the Dart
SDK change.
2019-02-26 13:28:04 -08:00
Gary Qian
a8aa1ee060
Track flow id (#7826)
(Authored by @nathanrogersgoogle )
2019-02-14 12:30:29 -08:00
KyleWong
90569e8416
Provide public api to allow FlutterEngine related context to be destoryed (#7610)
Provide public api to allow FlutterEngine related context  to be destoryed.
2019-02-09 17:13:04 +08:00
Dan Field
31c7917179
Fix #26966 (#7566) 2019-01-24 12:36:23 -08:00
Qxyat
450c3e4d43 Don't accept gestures by ForwardingGestureRecognizer (#7558)
ForwardingGestureRecognizer was previously accepting the gesture when the touch sequence ended, this was causing some other gesture recognizers to not accept the gestures (e.g tapping on the my location button in a Google Map didn't work).
2019-01-23 09:28:55 -08:00
Dan Field
2123d3a569
Keep engine alive if VC is not deallocated (#7544) 2019-01-22 15:03:25 -08:00
Dan Field
05fee4eeee
Update default flutter_assets path for iOS embedding (#7518) 2019-01-21 13:43:01 -08:00
KyleWong
5a8b0f3dba When the instance method:init is unavailable, mark the class method:new unavailable. (#7532) 2019-01-20 14:36:13 -08:00
Dan Field
9004af1341
Allow FlutterViewController to be released when not initialized with an engine (#6879)
* Break cycle between FlutterViewController and FlutterEngine
2019-01-14 16:58:09 -08:00
Dan Field
9d206e2726
iOS A11y memory leak (#7244)
* fix memory leak in a11y bridge
2019-01-14 16:47:19 -08:00
Chris Bracken
d1d8b4d416
Stop pumping frames in applicationWillResignActive (#7450)
According to Apple's [OpenGL ES Programming guide][1], applications
should pause any animations in applicationWillResignActive. Any GL calls
after applicationDidEnterBackground will cause the app to be terminated
immedidately by iOS.

The surfaceUpdated:YES call is moved to the handler for the
applicationDidBecomeActive notification to handle cases where the
application becomes inactive then active again without being
backgrounded (e.g. home button double-tap then return to app directly).

[1]: https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html#//apple_ref/doc/uid/TP40008793-CH5-SW1
2019-01-12 09:14:23 -08:00
Justin McCandless
3f99878315
Match the ios number input type behavior to what is said in the docs (#7281) 2019-01-11 10:24:00 -08:00
木士羽
5272805f13 Fix settings.advisory_script_uri in iOS createShell (#7235) 2019-01-10 12:09:37 -08:00
Amir Hardon
f0dd6436c8
Recreate the overlay rendering surfaces if the GrContext was changed. (#7317)
When the app is sent to the background and then brought to the forward it is possible that the GrContext was changed.
This resulted in overlay surfaces not being updated after being backgrounded and foregrounded.

This change makes sure to re-create the overlay rendering surfaces if the GrContext for the main surface was changed.

fixes flutter/flutter#24900
2018-12-27 16:02:00 -08:00
Amir Hardon
245317a621
Reland "Only reject gestures to embedded UIViews when the framework sa… (#7315)
This re-lands commit cc9c670, with a few fixes:

  - Keep the DelayingGestureRecognizer a discrete gesture recognizer, when it was set to a began state embedded WkWebViews wasn't receiving touch events.
  - Fix a bug of not retaining the forwardRecognizer pointer when assigning it to a scoped_nsobject.
2018-12-27 13:23:36 -08:00
Amir Hardon
20ee4e3e9c
Revert "Only reject gestures to embedded UIViews when the framework says so. (#7307)" (#7313)
This reverts commit cc9c6702da5b8f0db4753c0e6a4a2002670941d6.
2018-12-27 10:22:51 -08:00
Amir Hardon
cc9c6702da
Only reject gestures to embedded UIViews when the framework says so. (#7307)
Previously the framework could only tell the engine to forward a touch
sequence to an embeded UIView between the time touches has started and
the time touches ended. This couldn't support gesture arena setups where
the gesture is recognized after the touch sequence is complete (e.g a
tap competing with a scroll).

This change makes it so that a touch gesture is only finally rejected by
a platform view when the framework invokes the `rejectGesture` method.
This allows the framework to resolve a gesture conflict after the touch
sequence was ended.
2018-12-26 22:11:10 -08:00
Jason Simmons
e8f4968d64
Update iOS unit test for the removal of hex string encoding of uint64 data (#7246) 2018-12-18 11:16:38 -08:00
Jason Simmons
42c62a944b
Fix destruction of the child object list in the iOS accessibility bridge (#7108)
Fixes https://github.com/flutter/flutter/issues/22206
2018-12-17 16:05:23 -08:00
Jason Simmons
8190e939f5
Simplify conversion of numeric types in the message codec on iOS (#7097)
Consistently handle Int32/Int64 types on both 32-bit and 64-bit versions
of iOS.  Drop usage of the obsolete hex string encoding for BigInt types.

Fixes https://github.com/flutter/flutter/issues/21313
2018-12-17 15:54:57 -08:00
jslavitz
1a2714bbef
Adds force cursor support (#6945)
* engine force cursor support
2018-12-13 18:45:38 -08:00
Justin McCandless
571f47457c
Update marked text before selection so textInRange is never called with (#6989)
invalid input
2018-12-12 15:32:36 -08:00
Chris Bracken
97d96bc9a5
Eliminate obsolete FlutterDartProject initializers (#6967)
Technically both of these are part of the public API exposed in
Flutter.framework. Neither is used within Flutter itself, and both have
been broken since the removal of Dart 1 support, so eliminating rather
than marking unavailable.
2018-12-10 17:07:00 -08:00
Chris Bracken
dcfae4e803
Eliminate main_dart_file_path, package_file_path (#6973)
These settings were specific to Dart 1 and are no longer used in the
engine. This eliminates them from the Settings class.
2018-12-10 09:12:10 -08:00
Gary Qian
72c7a75672
Prepend [NSLocale currentLocale] for first locale on iOS to ensure countryCode exists. Allow language-only locales. (#6995) 2018-11-28 12:59:57 -08:00
Dan Field
df2e9393a2
load default splash screen when not init with engine (#6925) 2018-11-21 15:06:08 -08:00
Dan Field
c02dd8f935
Don't load a splash screen by default (#6883) 2018-11-16 12:43:18 -08:00
Ben Konyi
f23862b259
Added delegate forwarding for didReceiveLocalNotification and willPresentNotification (#6858) 2018-11-14 11:39:47 -08:00
Dan Field
110a5f320c
Reset a11y bridge state on hot restart (#6857) 2018-11-14 11:13:39 -08:00
Dan Field
114d33d3ca
Set and unset accessibility flags even when re-entrant (#6853)
* Make sure to not unset a11y flags on reentrant calls to API
2018-11-13 23:54:45 -08:00
Dan Field
0d0287780e
Avoid a never-disappearing splash screen if the engine came from somewhere else on iOS (#6834)
* Ignore multiple attemps to set splash screen, print warning
2018-11-13 16:04:09 -08:00
Michael Goderbauer
09ef73ff6e
Fix code smells reported by chrome's clang plugin (#6833) 2018-11-12 19:59:29 -08:00
Dan Field
799ce8742d
fix log (#6817) 2018-11-09 16:46:49 -08:00