1357 Commits

Author SHA1 Message Date
Chris Bracken
92c63e848a
Ensure trailing newline before EOF in C++ sources (#11489)
In generated text fixture location lookup code:
When the second argument to write_file() is a list, it is written one
item per line to the path specified by the first argument. This ensures
that we emit a trailing newline at EOF to comply with -Wnewline-eof.

Elsewhere:
Lack of a newline at EOF was undefined behaviour prior to C++11. The
Fuchsia tree sets -Wnewline-eof in its buildroot, so we plan to do the
same. This cleans up remaining first-party C++ sources that don't
include a trailing newline.
2019-08-27 00:13:00 -07:00
xster
fd25f80a1d
make it possible to disable debug symbols stripping (#11265) 2019-08-26 16:53:00 -07:00
Tong Mu
ba1a303ae2
Patch buttons for chromebook touchpad (#11420)
Changes irregular events of touchpad scrolling on Chromebook to have buttons: 1.
2019-08-26 11:49:55 -07:00
Amir Hardon
a34f9a811c
Skip empty platform view overlays. (#11427)
This change sets up a "spying canvas" to try and detect empty canvases.
When using platform views with a custom embedder, if a platform view
overlay canvas is known to be empty we skip creating a compositor layer
for that overlay.
2019-08-26 11:40:49 -07:00
Qxyat
11e3ade157 Release _ongoingTouches when FlutterViewController dealloc (#11049) 2019-08-26 10:49:54 -07:00
Dan Field
d4932ba714
update method for skia (#11436) 2019-08-25 20:06:12 -07:00
Dan Field
66636eaded
Platform View implemenation for Metal (#11070) 2019-08-23 16:15:41 -07:00
Chinmay Garde
139a9a799c
Avoid root surface acquisition during custom composition with software renderer. (#11394)
Uses the same technique used during OpenGL composition to elide root surface access. The refactoring of this approach is tracked in https://github.com/flutter/flutter/issues/38466

Fixes https://github.com/flutter/flutter/issues/39009.
2019-08-23 13:52:06 -07:00
Chinmay Garde
b7d03138ed
Remove deprecated ThreadTest::GetThreadTaskRunner and use the newer CreateNewThread API. (#11395)
We will end up creating fewer threads in tests.
2019-08-23 12:21:46 -07:00
Kaushik Iska
1e828b2326
Ios simulator unittests seem to not consider the full compilation unit (#11413)
They only reference the headers, so temporarily declaring and defining
in the header
2019-08-23 09:32:00 -07:00
Chinmay Garde
fcc158fd3f
Wire up software rendering in the test compositor. (#11392) 2019-08-22 20:27:34 -07:00
stuartmorgan
4f6f390b51
Allow overriding the GLFW pixel ratio (#11388)
Allows a client to set a specific pixel ratio rather than using one
computed based on the screen details.

Fixes https://github.com/flutter/flutter/issues/37620
2019-08-22 16:49:23 -07:00
stuartmorgan
6f911ab372
Allow non-resizable windows in GLFW embedding (#11386)
Adds a flag to create non-resizeable windows.

Since the number of parameters is getting awkward, extracts
window-related parameters and engine-related parameters into structs for
clarity. This also removes some duplication in method signatures.

The window parameters struct change is also made to the C++ wrapper,
making this a breaking change for the runners.

Fixes https://github.com/flutter/flutter/issues/37623
2019-08-22 16:48:22 -07:00
stuartmorgan
fa161274fb
Switch to an incremental runloop for GLFW (#11368)
Rather than running the runloop forever, have the API expose an incremental runloop. This allows clients to do other processing if they need it.

This allows for removing the odd construction of having knowledge of GTK event handling built into the library even though nothing in the library uses it; instead runner applications that use GTK plugins (such as FDE's testbed) can do that processing at the application level instead.
2019-08-22 11:39:00 -07:00
stuartmorgan
5f03c7e35d
Use of App.framework in macOS FlutterDartProject (#11380)
Adds initial use of App.framework in the macOS project configuration,
using that rather than the main bundle as the default Dart bundle, and
expecting flutter_resources to be located there.

This is an incremental step toward aligning with the behvaior of the iOS
version of this class.

Fixes https://github.com/flutter/flutter/issues/38363
2019-08-22 10:40:18 -07:00
Amir Hardon
0345967a19
Include Java stack trace in method channel invocations (#11361) 2019-08-22 09:02:31 -07:00
Chinmay Garde
ccf5d619b5
Dry up fixture comparison in embedder unit-tests. (#11359)
No functional change. Just makes testing with fixture images easier. Adding a
whole lot more tests that use this path for the embedder surface rotation
patches. Want to land stuff in smaller chunks.
2019-08-21 16:03:38 -07:00
Tamir Duberstein
29469f39c1 [lsc] Remove fuchsia.net.SocketProvider (#11316)
fuchsia.net.SocketProvider has been replaced with fuchsia.net.NameLookup
and fuchsia.posix.socket.Provider.
2019-08-21 07:38:25 -07:00
Emmanuel Garcia
4f8b166905
Remove engine hash from the output artifact (#11330) 2019-08-21 13:27:55 +00:00
stuartmorgan
9f8b1d223e
Clean up Windows and Linux build output (#11324)
Final portion of reworking the names of the Linux and Windows desktop build outputs.

See flutter/flutter#38589
2019-08-21 05:53:38 -07:00
stuartmorgan
a9b47638a7
Fix change_install_name.py to be GN-friendly (#11309)
change_install_name.py was operating on framework library files
in-place, which breaks GN's timestamp analysis handling since a file
can't be both an input and output of an action. As a result no-op builds
on macOS were not actually no-ops.

This changes the script to operate on an output copy, both fixing the
no-op build issue, and simplifying the GN framework construction scripts
by combining the copy step and the install-name step.

Fixes https://github.com/flutter/flutter/issues/33465
2019-08-20 21:15:42 -07:00
Chinmay Garde
51bdf83420
Migrate Embedder API documentation to Doxygen format. (#11255)
Fixes https://github.com/flutter/flutter/issues/38870
2019-08-20 20:20:06 -07:00
Chinmay Garde
9b1f6d37a7
When using a custom compositor, ensure the root canvas is flushed. (#11310)
The root canvas is managed by the external view embedder when using a custom
compositor. Due to this, frame submission on the surface will not end up
flushing the same (because the surface doesn’t have it to begin with). Fixed
with tests.
2019-08-20 17:06:57 -07:00
Francisco Magdaleno
a79a31a627
[glfw] Send the glfw key data to the framework. (#9386) 2019-08-20 15:55:51 -07:00
stuartmorgan
f310ec580e
Set FlutterMacOS podspec min version to 10.11 (#11306)
The framework is built using 10.11 as the deployment version; update the
podspec accordingly.

See https://github.com/flutter/flutter/issues/33200
2019-08-20 14:51:16 -07:00
Jason Simmons
0e90cb4082
Fix a segfault in EmbedderTest.CanSpecifyCustomTaskRunner (#11305)
This test queues tasks to a custom task runner that runs the tasks on the
platform thread.  After shutting down the engine, the test must wait until
these tasks are drained before the test exits.
2019-08-20 14:11:45 -07:00
Matt Carroll
df178fd936
Remove dart entrypoint Intent parameter from FlutterActivity. (#38713) (#11239) 2019-08-19 17:21:21 -07:00
Chinmay Garde
99ee3c2b0d
Provide a placeholder queue ID for the custom embedder task runner. (#11062)
This issue would only manifest when a custom task runner was being used with
a custom compositor. Both were tested separately but not together. A new
test has been added for this. We still create the GPU thread merger
unnecessarily but I can patch that later. I also cleaned up the existing
custom task runner test to not submit tasks on a dead engine as they just
log errors unnecessarily.

Filed new: https://github.com/flutter/flutter/issues/38844
2019-08-19 15:56:58 -07:00
Matt Carroll
4003fbc3ed
Notify framework to clear input connection when app is backgrounded (#35054) (#9498) 2019-08-19 14:12:45 -07:00
Chinmay Garde
84bd736656
Update metal layer drawable size on relayout. (#11224)
This makes it so that the texture obtained by the next frame has the same dimensions as the frame being renderered.

Fixes https://github.com/flutter/flutter/issues/38754
2019-08-19 13:01:11 -07:00
Kaushik Iska
21ae92651a
[b/139487101] Dont present session twice (#11222) 2019-08-19 12:03:06 -07:00
Kaushik Iska
2897917b45
[dynamic_thread_merging] Resubmit only on the frame where the merge (#11075)
fixes https://github.com/flutter/flutter/issues/38735
2019-08-17 01:48:28 -07:00
Michael Klimushyn
e23a2e22ec
More updates to the Robolectric test harness (#11068)
Previously the test wasn't correctly re-building the engine when its
files changed on multiple runs of `testing/run_tests.py`. It looks like
this is because the test build target wasn't depending on the entire
engine Android dependency, so some code changes were being ignored.
Update the build.
2019-08-16 17:09:09 -07:00
Shi-Hao Hong
014ab76ad0
Pass Android Q insets.systemGestureInsets to Window (#10413)
* Pass Android Q system gesture inset information from insets.systemGestureInsets to Window.systemGestureInsets
2019-08-16 13:42:56 -04:00
Jason Simmons
8569edc551
Disable a deprecation warning for use of a TaskDescription constructor for older platforms (#11029) 2019-08-15 15:22:37 -07:00
Matt Carroll
5bb144ca8b
Re-lands platform brightness support on iOS, plus platform contrast (#10791) 2019-08-15 14:51:07 -07:00
stuartmorgan
f1560e6c6e
Add _glfw versions of the GLFW desktop libraries (#11024)
Part of restructuring the artifacts to support transitioning away from
GLFW embeddings on desktop.

https://github.com/flutter/flutter/issues/38589
2019-08-15 14:41:15 -07:00
Dan Field
f062ac44b0
Fix first frame logic (#11027) 2019-08-15 14:38:43 -07:00
Jason Simmons
cf6648313d
Remove the output directory prefix from the Android engine JAR filename (#11015) 2019-08-15 09:42:19 -07:00
inthroxify
2e8e6932a6 Fix flutter/flutter #34791 (#9977)
This is a fix for [flutter/flutter issue #34791](https://github.com/flutter/flutter/issues/34791).

PR #8048 in flutter/engine produced a bug/regression (flutter/flutter #34791) in flutter for Android that doesn't permit the Recents app bar color to be changed. This restores the original arguments to the function found in the previous version (2f4a38dbd3/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java) of PlatformPlugin.java while preserving the enhancements for the linter.

I've compiled and tested this fix locally. The bar changes color again.
2019-08-15 09:20:30 -07:00
Chinmay Garde
4c4c999778
On iOS report the preferred frames per second to tools via service protocol. (#11006) 2019-08-14 16:47:57 -07:00
xster
5e155c6c2d
some drive-by docs while I was reading the embedding classes (#9341) 2019-08-14 16:35:50 -07:00
stuartmorgan
c3e9c14586
Rename macOS FLE* classes to Flutter* (#11010)
Renames all FLE* classes in the macOS embedding to Flutter*. With the exception
of -[FlutterDartProject engineSwitches], which is very clearly called out in the
comment, the APIs should be stable at this point, so the marker prefix is no
longer needed.

This is a breaking change for macOS embedders, but going forward breaking
changes at the source level for the macOS API should now be rare.

Some of these classes will likely merge with the iOS versions in the future (e.g.,
FlutterDartProject), but that will be an implementation detail that will not affect
clients.

Fixes flutter/flutter#31735
2019-08-14 15:53:17 -07:00
James Clarke
ff484d4f69 [Windows] Alternative Windows shell platform implementation (#9835)
Start work on flutter/flutter#30726 by adding an alternative win32 shell platform implementation for Windows that is not based on GLFW and that uses LIBANGLE for rendering and native win32 windowing and input. This change does not replace the GLFW implementation but rather runs side by side with it producing a secondary flutter_windows_win32.dll artifact. The following items must be added to attain parity with the GLFW implementation:
- Custom task scheduling
- Support for keyboard modifier keys
- Async texture uploads
- Correct high DPI handling on Windows versions < 1703
and will be added in subsequent changes.
2019-08-14 15:52:52 -07:00
Dan Field
90656d8824
Add isDisplayingFlutterUI to FlutterViewController (#10816) 2019-08-14 09:10:22 -07:00
Chinmay Garde
e8f954409d
Allow embedder controlled composition of Flutter layers. (#10195)
This patch allows embedders to split the Flutter layer tree into multiple
chunks. These chunks are meant to be composed one on top of another. This gives
embedders a chance to interleave their own contents between these chunks.

The Flutter embedder API already provides hooks for the specification of
textures for the Flutter engine to compose within its own hierarchy (for camera
feeds, video, etc..). However, not all embedders can render the contents of such
sources into textures the Flutter engine can accept. Moreover, this composition
model may have overheads that are non-trivial for certain use cases. In such
cases, the embedder may choose to specify multiple render target for Flutter to
render into instead of just one.

The use of this API allows embedders to perform composition very similar to the
iOS embedder. This composition model is used on that platform for the embedding
of UIKit view such and web view and map views within the Flutter hierarchy.
However, do note that iOS also has threading configurations that are currently
not available to custom embedders.

The embedder API updates in this patch are ABI stable and existing embedders
will continue to work are normal. For embedders that want to enable this
composition mode, the API is designed to make it easy to opt into the same in an
incremental manner.

Rendering of contents into the “root” rendering surface remains unchanged.
However, now the application can push “platform views” via a scene builder.
These platform views need to handled by a FlutterCompositor specified in a new
field at the end of the FlutterProjectArgs struct.

When a new platform view in introduced within the layer tree, the compositor
will ask the embedder to create a new render target for that platform view.
Render targets can currently be OpenGL framebuffers, OpenGL textures or software
buffers. The type of the render target returned by the embedder must be
compatible with the root render surface. That is, if the root render surface is
an OpenGL framebuffer, the render target for each platform view must either be a
texture or a framebuffer in the same OpenGL context. New render target types as
well as root renderers for newer APIs like Metal & Vulkan can and will be added
in the future. The addition of these APIs will be done in an ABI & API stable
manner.

As Flutter renders frames, it gives the embedder a callback with information
about the position of the various platform views in the effective hierarchy.
The embedder is then meant to put the contents of the render targets that it
setup and had previously given to the engine onto the screen (of course
interleaving the contents of the platform views).

Unit-tests have been added that test not only the structure and properties of
layer hierarchy given to the compositor, but also the contents of the texels
rendered by a test compositor using both the OpenGL and software rendering
backends.

Fixes b/132812775
Fixes flutter/flutter#35410
2019-08-13 14:53:19 -07:00
Dan Field
e22893966a
Expose isolateId for engine (#10823) 2019-08-12 21:20:59 -07:00
Jim Graham
6a4dfa7aad
include zx::clock from new location to fix Fuchsia autoroll. (#10968) 2019-08-12 17:50:16 -07:00
Michael Klimushyn
ed88d0a44d
Change SemanticsNode#children lists to be non-null (#10952)
Prevents NPEs and simplifies the code needed to handle these collections. There doesn't seem to have been a meaningful difference between null and empty collection here. The specific crash was happening when `object.scrollChildren > 0` while `object.childrenInHitTestOrder == null`, which looks like it may be a bug on its own and probably needs further investigation.
2019-08-12 17:16:59 -07:00
Kaushik Iska
a438469aa1
Fix format (#10955) 2019-08-12 14:23:27 -07:00