1257 Commits

Author SHA1 Message Date
stuartmorgan
10cbdd49d1
Add resize functions to GLFW shell (#8864)
Adds methods to get and set the window size, as well as to query the
window's scale factor. This is useful both for custom clients, and for
building a window resize plugin to prototype what will eventually likely
be a system channel.
2019-05-06 16:22:40 -04:00
stuartmorgan
62ab9c7b81
Provide access to GLFW window in plugins (#8806)
Plugins may need to be able to access functions affecting the GLFW
window (e.g., a plugin to resize the window). This restructures the API
to create a distinction at both the C and C++ level between the window
controller, which provides access to high-level behaviors driving the
Flutter application, and the window, which provides access to functions
to affect the UI state of the window (i.e., wrapped GLFWwindow
functions).

Also provides a PluginRegistrar extension for plugins that need access
to GLFW-specific functionality.
2019-05-06 15:37:02 -04:00
Dan Field
88e82d371a
Remove static leaks (#8825) 2019-05-03 16:57:04 -07:00
Matt Carroll
2c9e37c34e
Cause crash in FlutterJNI if invoked on non-main thread (#31263). (#8830) 2019-05-03 14:55:28 -07:00
Dan Field
7ce2666e54
Guard Android logs (#8824) 2019-05-03 14:32:29 -07:00
Jonah Williams
1bcbaf73a7
Add flutter settings channel and window brightness to macOS shell (#8810) 2019-05-02 20:42:51 -07:00
Dan Field
480844608c
Remove asserts and add BuildConfig (#8821) 2019-05-02 17:30:19 -07:00
Dan Field
39a950e5d1
remove legacy build deps (#8820)
* remove legacy build deps
2019-05-02 16:03:05 -07:00
Matt Carroll
30639ee7b6
Allow FlutterEngine to be used on back-to-back screens (#31264). (#8808) 2019-05-02 13:19:11 -07:00
Kaushik Iska
1219e5c7d2
Re-create texture from pixel buffer onGrContextCreate (#8792)
* Re-create texture from pixel buffer onGrContextCreate

OnGrContextDestroy we destroy the texture, this is because
we can not access it from the potentially new context that
we get on bringing the app back to foreground.

To show a valid texture on fg, we need to preserve the pixel
buffer, using which we will create the new texture.

* ensure texture cache exists

* only reset pixel buffer if not null.
2019-04-30 15:25:20 -07:00
Kaushik Iska
5aa5b6cbf4
VirtualDisplay size constraint - add a comment explaining the reason (#8780)
* VirtualDisplay size: add a comment explaining the reason

Address nits in: https://github.com/flutter/engine/pull/8704

* remove locale import
2019-04-29 17:19:05 -07:00
Dan Field
57bf1c0968
Fix crash when cursor ends up at invalid position (#8747) 2019-04-26 15:43:44 -07:00
Kaushik Iska
7471ddea46
Limit the size of VirtualDisplay we create in android (#8704)
- This can cause phones to restart as documented in https://github.com/flutter/flutter/issues/28978
2019-04-25 13:44:45 -07:00
Zachary Anderson
3a29e6a7a7
Plumb arguments from Settings to Dart main() (#8710) 2019-04-25 07:57:54 -07:00
Chris Bracken
fdd8fdbf40
Fix reflective ctor invocation in FlutterFragment (#8735)
Class.newInstance() propagates any exception thrown by the nullary
constructor, including a checked exception. This effectively bypasses
the compile-time exception checking that would otherwise be performed by
the compiler. The Constructor.newInstance method avoids this problem by
wrapping any exception thrown by the constructor in a (checked)
InvocationTargetException.
2019-04-24 17:50:19 -07:00
liyuqian
1c9457cedc
Revert "Only allow mappings for ICU initialization. (#8656)" (#8682)
This reverts commit bd8c5b135e4d41842d0d5d42ff4943a18b8f4f0c.

Reverts flutter/engine#8656

Reason:  https://github.com/flutter/engine/pull/8656 seems to break the framework windows tests and the engine roll (see https://cirrus-ci.com/task/4704667236827136 and https://github.com/flutter/flutter/pull/31330). The failure has been consistent for 7 consecutive engine-to-framework auto-rolls.

TBR: @chinmaygarde
2019-04-22 10:28:54 -07:00
Stanislav Baranov
8b5f77630f
Remove support for downloading dynamic patches. (#8663) 2019-04-22 09:05:06 -07:00
Chinmay Garde
2e4f0a4a72
Put the testing lib in the flutter namespace. (#8661) 2019-04-20 20:42:46 -07:00
Chinmay Garde
1239df96aa
Allow native bindings in secondary isolates. (#8658)
The callbacks can be wired in via the Settings object. Both runtime and shell unit-tests have been patched to test this.
2019-04-19 17:36:36 -07:00
Chinmay Garde
bd8c5b135e
Only allow mappings for ICU initialization. (#8656)
If the mapping callback is not set or it the callback returns invalid data, ICU initialization will be embedder responsibility.

This affects all embedders and the following have been audited:
* Android: Via a symbol mapping.
* iOS: Via a file mapping.
* Embedder: Via a file mapping.
* Fuchsia: Via a VMO mapping
* Test shells and Flutter tester: Via file mapping with ICU data needing to be next to the executable.
2019-04-19 15:01:40 -07:00
Chinmay Garde
1fe3279149
Cleanup references to FLX archives from the engine. (#8653) 2019-04-19 12:49:07 -07:00
Chinmay Garde
6257dfeb53
Add factory methods to FileMapping that make it easy to create common mappings. (#8652)
The GetMapping calls removed in this patch had the same code and had to be repeated across different test harnesses as well as in dart_snapshot.cc. Just make this a factory method so the code is less verbose.
2019-04-19 12:48:53 -07:00
Ben Konyi
ca31a7c57b
Disable auth codes for Observatory test (#8646) 2019-04-18 17:46:32 -07:00
Ben Konyi
3e597e1de3
Enable VM service authentication codes by default (#8594) 2019-04-18 14:17:25 -07:00
Ben Konyi
763bbca0cc
Add support for authentication codes via MDNS on iOS (#8625) 2019-04-18 12:12:29 -07:00
Chinmay Garde
57f8abb73f
Avoid leaking the VM in the shell unittests and assert VM state in existing tests. (#8628) 2019-04-18 11:32:33 -07:00
Shi-Hao Hong
d8aa6bca16
Fix typo in comment (#8617) 2019-04-17 15:03:50 -07:00
liyuqian
8ff631f3df
Rename flow namespace to flutter (#8615)
This follows our namespace change from shell to flutter: https://github.com/flutter/engine/pull/8520.
2019-04-17 14:38:45 -07:00
stuartmorgan
523a9a9add
Add FLEPluginRegistry for macOS (#8611)
Creates a minimal FLEPluginRegistry protocol, which is a subset of the
FlutterPluginRegistry.

This is a small step toward eventually merging the APIs, but allows
changing the example project structure to better reflect what a future
template will look like.
2019-04-17 10:53:59 -07:00
Michael Klimushyn
0e27e0fc38
Pipe Z bounds from ViewportMetrics to Flow (#8583)
This is the first step in making Flutter aware of and responsive to Z
bound overflow. On its own this patch shouldn't result in any changes in
behavior. This will need to be followed up with a patch in Fuchsia's
Flutter runner to set the Z bounds after this lands, and another patch
in the engine actually implementing the desired overflow behavior.

This Z bound info is routed through the engine itself to make sure the
bounds in flow are truly consistent from the Fuchsia runner. However
these values should eventually be exposed to the framework as well.
2019-04-17 09:56:46 -07:00
stuartmorgan
4266f8583f
Add desktop shell unittests to test script (#8600)
Builds the unit test on all platforms, and adds them to the aggregate test script.
2019-04-16 22:37:39 -07:00
stuartmorgan
4805d72a49
Implement StandardMethodCodec for C++ shells (#8598)
Adds StandardMethodCodec support to the C++ client wrapper. This makes it
substantially easier to add Windows and Linux support for existing plugins, as
StandardMethodCodec is the default plugin protocol.

Fixes flutter/flutter#30670

Does not include extensibility for the codec, which will be added later.
2019-04-16 19:49:09 -07:00
stuartmorgan
b819b62bed
Variant type for C++ client wrapper (#8592)
Adds a type that can hold any of the types corresponding to the Dart types
that are supported by the standard message channel codec. This provides
the foundation for adding standard message codec support for the C++
desktop shells (flutter/flutter#30670).
2019-04-16 16:33:07 -07:00
Qxyat
28a46d51a0 Composite Embedded Views with the correct GrContext
PaintRecorder Canvases are not associated with GrContexts.
2019-04-16 14:13:34 -07:00
Chris Bracken
7c7df0d58b
Add null check in FLETextInputPlugin (#8538)
Adds a guard on `_activeClientID` in `insertNewline:`. The conditional
around the `insertText:replacementRange:` call already catches this, but
we then unconditionally pack `_activeClientID` into an `NSArray`, which
disallows nil.
2019-04-12 21:10:23 -07:00
Kaushik Iska
7292d62ef8
Revert Versions API (#7828)
* Revert "Fix versions implementation (#7726)"

This reverts commit 3c38dd342f53d39603d1c5b138b5e4d36d93720f.

* Revert "Expose the Flutter engine, Dart and Skia versions to Dart. (#7634)"

This reverts commit b94e759b256819fb33cb9d2b41565fc137cac733.

* remove namespace shell stuff

* fix format

* fix licenses
2019-04-12 14:23:13 -07:00
Matt Carroll
23b0e02ec0
Android Embedding PR29: Improve FlutterFragment construction API + engine config API. (#8540) 2019-04-12 13:19:05 -07:00
Chris Bracken
1bb2c0cf06
Remove unused import in FlutterActivityDelegate (#8563)
android.app.UiModeManager is unused in FlutterActivityDelegate.
2019-04-12 11:17:57 -07:00
Diego Ballesteros Villamizar
ad04340e52 Add missing <memory> include to text_input_model.h (#8562)
text_input_model.h uses std::unique_ptr but does not include the memory header.
2019-04-12 10:48:11 -07:00
stuartmorgan
9aa7c9a48e
Export extern constants in embedder.h (#8550)
PR #8498 made these constants extern, but forgot to export them so they
would be public symbols.
2019-04-11 23:32:29 -07:00
Matt Carroll
d84d204c76
Android Embedding PR30: Make FlutterView focusable so that the keyboard can interact with it. (#8551) 2019-04-11 13:50:42 -07:00
Chris Bracken
f53e477a65
Correct nullability for FlutterStandardReader (#8537)
FlutterStandardReader's `readValueOfType:` method returns nil when
called with `FlutterStandardFieldNil`. By extension, `readValue` can
also return nil values.
2019-04-11 09:59:08 -07:00
Matt Carroll
892591da88
Android Embedding PR28: Report app is active to Flutter in FlutterFragment.onResume() instead of onPostResume() forwarded from Activity. (#8536) 2019-04-10 17:47:56 -07:00
Matt Carroll
330c6c168c
Use code cache dir for engine cache on API >= 21 (#14704). (#8534) 2019-04-10 15:32:31 -07:00
stuartmorgan
c10ae2be26
Add an option to build the GLFW shell on macOS (#8531)
Since the GLFW shell is likely to continue to exist in at least the
medium term, it is useful for maintenance to be able to build and use it
on any desktop platform.

Includes a buildroot roll to pick up the macOS build suppport for
third_party/glfw.
2019-04-10 15:18:34 -07:00
Ben Konyi
0a2869e5c3
Added support for authentication codes for the VM service (#8527) 2019-04-10 14:38:58 -07:00
stuartmorgan
72986c39ea
Move constant definitions out embedder.h (#8498) 2019-04-10 10:03:10 -07:00
Chinmay Garde
e356dbca2c
Merge flutter/synchronization contents into fml. (#8525)
When flutter/synchronization was first authored, we did not own fml (it was called fxl then). Now we do, so use a single spot for such utilities. The pipeline was meant to be a general purpose utility that was only ever used by the animator (it even has animator specific tracing), so move that to shell instead (where the animator resides).
2019-04-09 19:18:51 -07:00
Chinmay Garde
39e1d00f39
Remove redundant specification of the |flutter| namespace in the engine. (#8523) 2019-04-09 17:50:06 -07:00
Chinmay Garde
56052c70af
Rename the shell namespace to flutter. (#8520) 2019-04-09 17:10:46 -07:00