Commit Graph

700 Commits

Author SHA1 Message Date
xster 5e155c6c2d some drive-by docs while I was reading the embedding classes (#9341) 2019-08-14 16:35:50 -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
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
Michael Klimushyn c92a0d992a Report JUnit test failures (#10941)
Previously this script was not reporting any JUNit failures and somehow
ended up included a non-existent jar for Java tests to test against.

It looks like one of the JUnit tests is now failing. Disabling it for
now to turn on CI again as soon as possible, will fix and enable it in a
follow up.
2019-08-12 12:17:15 -07:00
Emmanuel Garcia 83b640d4b4 Rename flutter_java.jar and flutter_engine.jar so they match the Maven comvention (#10797) 2019-08-09 10:14:33 -07:00
Emmanuel Garcia 3103499019 Include Maven dependency in files.json (#10719) 2019-08-08 18:59:22 -07:00
Jason Simmons 622d67fb58 Build JARs containing the Android embedding sources and the engine native library (#10778) 2019-08-08 18:11:29 -07:00
Jason Simmons d9bbe37ce3 Remove use of the deprecated AccessibilityNodeInfo boundsInParent API (#10773) 2019-08-08 15:25:56 -07:00
Matt Carroll 735255f36a Android embedding refactor pr40 add static engine cache (#10481) 2019-08-06 16:15:21 -07:00
Jason Simmons 26368225b5 Fix deprecation warnings in the Android embedding (#10424) 2019-08-01 18:13:27 -07:00
Dan Field ed8e35c4cf Remove get engine (#9747) 2019-07-30 17:11:04 -07:00
Matt Carroll 4c6948a88a Android Embedding Refactor 38: Removed AssetManager from DartEntrypoint. (#10250) 2019-07-30 12:57:01 -07:00
Matt Carroll f336e05a69 Android Embedding PR37: Separated FlutterActivity and FlutterFragment via FlutterActivityAndFragmentDelegate (#9895) 2019-07-29 17:40:25 -07:00
Michael Klimushyn 839f9a2707 Deprecate FlutterView#enableTransparentBackground (#10235)
The API breaks accessibility highlighting because of
SurfaceView#setZOrderOnTop. Deprecate it since the underlying issue is
an Android SDK one that can't be worked around from within a
SurfaceView.
2019-07-29 12:46:26 -07:00
Michael Klimushyn 67524615be Add better CIPD docs. (#10185)
Also commits cipd.yaml to source.
2019-07-26 15:39:48 -07:00
Jonah Williams be9b245690 add suggested changes from flutter roll (#10176) 2019-07-26 12:56:08 -07:00
adazh ef99738baf Added a DartExecutor API for querying # of pending channel callbacks (#10021) 2019-07-23 13:11:03 -07:00
Michael Klimushyn 8ed5da8b65 Add working Robolectric tests (#9954)
`gclient sync` now grabs Robolectric, JUnit, and their transitive
runtime dependencies. They're being stored in a new CIPD package,
`flutter/android/robolectric_bundle`.

`shell/platform/android/BUILD.gn` has a new target for building the
tests, `robolectric_tests`. `testing/run_tests.py` has been extended to
build and run the new target. Runs the android tests under
"build_and_test_android" on CI.

This also adds some very simple sample tests to start with and a README
to the java tests directory.
2019-07-23 09:06:19 -07:00
Justin McCandless 4decc174ee Add support for Android's visible password input type (#9999)
For framework PR https://github.com/flutter/flutter/issues/31738
2019-07-23 07:57:39 -07:00
Matt Carroll 3aaeca3a57 Android Embedding Refactor PR36: Add splash screen support. (#9525) 2019-07-22 14:01:34 -07:00
Matt Carroll 9cf13568e2 Added hasRenderedFirstFrame() to old FlutterView for Espresso (#36211). (#9939) 2019-07-19 16:46:02 -07:00
Matt Carroll 649e025f70 Removed PlatformViewsController if-statements from TextInputPlugin (#34286). (#9938) 2019-07-19 13:52:45 -07:00
Mouad Debbar 8849d3092d Add multi-line flag to semantics (#9850) 2019-07-17 09:51:09 -07:00
Amir Hardon 7ae3c3e112 Preserve the alpha for VD content by setting a transparent background. (#9849)
The previous attempt to do this by setting the theme to
Theme_Translucent_NoTitleBar was reported to offsetting touch events on
specific Xiaomi devices.
2019-07-16 12:45:20 -07:00
Amir Hardon 74af88ba9f Make the virtual display's window translucent (#9828)
By default alpha is not preserved for the VD's contents.
We make the window translucent as a side effect of doing so is preserving alpha.
There should not be extra performance cost for setting the window to be translucent as there is only a single window within the VD.

Fixes flutter/flutter#33756
2019-07-15 16:51:36 -07:00