1328 Commits

Author SHA1 Message Date
Chinmay Garde
ea84fb80da Update metal layer drawable size on relayout. (flutter/engine#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
d43a5a5346 [b/139487101] Dont present session twice (flutter/engine#11222) 2019-08-19 12:03:06 -07:00
Kaushik Iska
a8139b6786 [dynamic_thread_merging] Resubmit only on the frame where the merge (flutter/engine#11075)
fixes https://github.com/flutter/flutter/issues/38735
2019-08-17 01:48:28 -07:00
Michael Klimushyn
fe1797c17e More updates to the Robolectric test harness (flutter/engine#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
cb707fb34a Pass Android Q insets.systemGestureInsets to Window (flutter/engine#10413)
* Pass Android Q system gesture inset information from insets.systemGestureInsets to Window.systemGestureInsets
2019-08-16 13:42:56 -04:00
Jason Simmons
d3d9f509eb Disable a deprecation warning for use of a TaskDescription constructor for older platforms (flutter/engine#11029) 2019-08-15 15:22:37 -07:00
Matt Carroll
b4d4a675d4 Re-lands platform brightness support on iOS, plus platform contrast (flutter/engine#10791) 2019-08-15 14:51:07 -07:00
stuartmorgan
3746a89cb2 Add _glfw versions of the GLFW desktop libraries (flutter/engine#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
748fef82a9 Fix first frame logic (flutter/engine#11027) 2019-08-15 14:38:43 -07:00
Jason Simmons
d471afafe4 Remove the output directory prefix from the Android engine JAR filename (flutter/engine#11015) 2019-08-15 09:42:19 -07:00
inthroxify
beff0828ed Fix flutter/flutter #34791 (flutter/engine#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 (7187e271f2/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
3ad272ccda On iOS report the preferred frames per second to tools via service protocol. (flutter/engine#11006) 2019-08-14 16:47:57 -07:00
xster
afab9f34b1 some drive-by docs while I was reading the embedding classes (flutter/engine#9341) 2019-08-14 16:35:50 -07:00
stuartmorgan
b0f5aaaa32 Rename macOS FLE* classes to Flutter* (flutter/engine#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
7dccb1596a [Windows] Alternative Windows shell platform implementation (flutter/engine#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
16c2058bf2 Add isDisplayingFlutterUI to FlutterViewController (flutter/engine#10816) 2019-08-14 09:10:22 -07:00
Chinmay Garde
591f55b39d Allow embedder controlled composition of Flutter layers. (flutter/engine#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
4ea3a6b031 Expose isolateId for engine (flutter/engine#10823) 2019-08-12 21:20:59 -07:00
Jim Graham
155dd891db include zx::clock from new location to fix Fuchsia autoroll. (flutter/engine#10968) 2019-08-12 17:50:16 -07:00
Michael Klimushyn
28ffead8a5 Change SemanticsNode#children lists to be non-null (flutter/engine#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
22c7c6422f Fix format (flutter/engine#10955) 2019-08-12 14:23:27 -07:00
Kaushik Iska
3519a8bfdf Fix iOS references to PostPrerollResult (flutter/engine#10949) 2019-08-12 13:01:11 -07:00
Kaushik Iska
de1c728dab Allow for dynamic thread merging on IOS for embedded view mutations (flutter/engine#9819)
After pre-roll we know if there have been any mutations made to the IOS embedded UIViews. If there are any mutations and the thread configuration is such chat the mutations will be committed on an illegal thread (GPU thread), we merge the threads and keep them merged until the lease expires. The lease is currently set to expire after 10 frames of no mutations. If there are any mutations in the interim we extend the lease.

TaskRunnerMerger will ultimately be responsible for enforcing the correct thread configurations.

This configuration will be inactive even after this change since still use the same thread when we create the iOS engine. That is slated to change in the coming PRs.
2019-08-12 12:32:38 -07:00
Michael Klimushyn
7f6d60a1b4 Report JUnit test failures (flutter/engine#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
Qxyat
7e04a02d0b Fix iOS keyboard crash (flutter/engine#10656)
Fixes an iOS crash on physical devices in `-[__NSCFString substringWithRange:]`: range out of bounds. According to Apple's docs for `UITextInput` method `positionFromPosition:(UITextPosition*)position offset:(NSInteger)offset`, this method should return:

A custom UITextPosition object that represents the location in a document that is at the specified offset from position. Return nil if the computed text position is less than 0 or greater than the length of the backing string.
2019-08-12 11:35:35 -07:00
Jerry Zhou
f3311522d0 Bump local podspec's iOS deployment target from 7.0 to 8.0 (flutter/engine#10662) 2019-08-12 11:15:24 -07:00
Kaushik Iska
3a5d1d388e [dart:zircon] Porting Cache re-usable handle wait objects (flutter/engine#10809)
Change-Id: I230601acf5de24765737ad81b595fef2c154134c
2019-08-09 12:46:23 -07:00
Konstantin Pozin
22bcb322dd [fuchsia] Migrate from custom FuchsiaFontManager to SkFontMgr_fuchsia (flutter/engine#10700)
Use Skia's own implementation of SkFontMgr for Fuchsia, for consistency with
other Skia clients on Fuchsia.

FL-290
2019-08-09 11:04:43 -07:00
Emmanuel Garcia
9c5fdeacbd Rename flutter_java.jar and flutter_engine.jar so they match the Maven comvention (flutter/engine#10797) 2019-08-09 10:14:33 -07:00
Chinmay Garde
ae4cefbdcf When setting up AOT snapshots from symbol references, make buffer sizes optional. (flutter/engine#10674) 2019-08-08 20:31:23 -07:00
Emmanuel Garcia
f9058d748c Include Maven dependency in files.json (flutter/engine#10719) 2019-08-08 18:59:22 -07:00
Jason Simmons
5cb02d643f Build JARs containing the Android embedding sources and the engine native library (flutter/engine#10778) 2019-08-08 18:11:29 -07:00
Kaushik Iska
8ec5f976ae [flutter_runner] Improve frame scheduling (flutter/engine#10780)
* [flutter_runner] Reland "[flutter_runner] Improve frame scheduling"

This is a reland of e28c8beaca82998396aacbd37a03942892654e2b

Original change's description:
> [flutter_runner] Improve frame scheduling
>
> FL-233 #comment
>
> This allows the paint tasks for the next frame to execute in parallel
> with presentation of last frame but still provides back-pressure to
> prevent us from queuing up even more work.
>
> Vsync would be disabled whenever a presentation callback was pending
> prior to this change. That had the outcome of causing us to almost
> always miss one vsync interval. By not turning off vsync until
> another Present call is pending we avoid this problem.
>
> Test: fx shell run fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx --base_shell=fuchsia-pkg://fuchsia.com/spinning_cube#meta/spinning_cube.cmx
> Test: topaz input latency benchmarks
> Test: end-2-end tests
> Change-Id: I46440052cd4f98cb0992ec5027584be80f4fb9d3

Change-Id: I1904683d0dfa509ef28482c4b751c28931ab7647

* fix stuff
2019-08-08 18:09:16 -07:00
Kaushik Iska
6c97d0384f [flutter] Create the compositor context on the GPU task runner. (flutter/engine#10781)
The compositor context owns the session connection. The creation of the
session connection also does the initial present to clear the node
hierarchy. This present was happening perviously on the platform task
runner while all subsequent presents were on the GPU task runner. This
has now been rectified so all presents are on the GPU task runner.

BUG: FL-288
Change-Id: Ib294666ffb3b4575f93ad0b02a5d0fda71bfa0a8
2019-08-08 18:08:57 -07:00
Chinmay Garde
158315caf9 Revert "Forwards iOS dark mode trait to the Flutter framework (#34441). (#9722)" (flutter/engine#10789)
This reverts commit 51904fc4bda988cb0719fcf19efada85d844fc86.
2019-08-08 17:15:06 -07:00
Matt Carroll
51904fc4bd Forwards iOS dark mode trait to the Flutter framework (#34441). (flutter/engine#9722) 2019-08-08 16:22:45 -07:00
Jason Simmons
56208b0de7 Remove use of the deprecated AccessibilityNodeInfo boundsInParent API (flutter/engine#10773) 2019-08-08 15:25:56 -07:00
Michael Goderbauer
f9e3a16668 Fix empty composing range on iOS (flutter/engine#10381) 2019-08-07 09:22:40 -07:00
Chinmay Garde
d7dfe2cb03 Allow embedders to control Dart VM lifecycle on engine shutdown. (flutter/engine#10652)
This exposes the `Settings::leak_vm` flag to custom embedders. All embedder
unit-tests now shut down the VM on the shutdown of the last engine in the
process. The mechanics of VM shutdown are already tested in the Shell unit-tests
harness in the DartLifecycleUnittests set of of assertions. This just exposes
that functionality to custom embedders. Since it is part of the public stable
API, I also switched the name of the field to be something less snarky than the
field in private shell settings.
2019-08-06 16:15:37 -07:00
Matt Carroll
a8b3374cf3 Android embedding refactor pr40 add static engine cache (flutter/engine#10481) 2019-08-06 16:15:21 -07:00
Chris Bracken
f173e72e06 Migrate Fuchsia runners to SDK tracing API (flutter/engine#10478)
Migrates the Fuchsia Flutter and Dart runners off the internal tracing
APIs and onto the public SDK.
2019-08-06 11:26:34 -07:00
Qxyat
6452493115 reset platformViewsController in engine.destroyContext when allowHeadlessExecution = false (flutter/engine#10629) 2019-08-05 17:36:58 -07:00
Kaushik Iska
67bc84721a [flutter_runner] Port: Add connectToService, wrapping fdio_ns_connect. (flutter/engine#10644)
Use fdio_ns_connect to connect to services in a namespace. For pure
persistant fidl services the old path of creating a file descriptor and
then opening a channel to that file descriptor doesn't work.

We should provide a way to directly connect to a service without first
treating it as a file.

Test:
* workstation.frank, reboot button on main menu works.
* astro, device_settings "erase user data" reboot works.

Change-Id: I725ba9350547309bebb5530aa44236f841d88f99
2019-08-05 16:36:59 -07:00
Nathan Rogers
436b76d9fe Use Fuchsia trace macros when targeting Fuchsia SDK (flutter/engine#10634)
When |OS_FUCHSIA| is defined (even when |FUCHSIA_SDK| is defined as
well), use the Fuchsia SDK trace macros rather than the Dart timeline.

Reasons for doing this include:

Fuchsia's trace macros support categories.  This allows one to
distinguish between (e.g.) "flutter" and "skia" trace events for trace
recording and trace visualization.

Fuchsia has existing in tree benchmarks that depend on finding certain
events under category "flutter".

See the Fuchsia performance mailing list discussion for more context.
2019-08-05 12:52:36 -07:00
Kaushik Iska
fcfa19d97a [fuchsia] CloneChannelFromFD fix for system.cc (flutter/engine#10635)
This is a utils method currently not exposed from fuchsia.
Ported over from [garnet
fd.cc](https://fuchsia.googlesource.com/fuchsia/+/master/garnet/public/lib/fsl/io/fd.cc).
2019-08-05 12:05:20 -07:00
Chris Bracken
5fa8fd302a Add #else, #endif condition comments (flutter/engine#10477)
Adds a few missing condition hints on some preprocessor conditionals.
2019-08-02 15:45:07 -07:00
Jason Simmons
1bc372a594 Fix deprecation warnings in the Android embedding (flutter/engine#10424) 2019-08-01 18:13:27 -07:00
Kaushik Iska
7523d23275 Make kernel compiler use host toolchain (flutter/engine#10419) 2019-08-01 12:57:03 -07:00
Kaushik Iska
527e254893 [fuchsia] Kernel compiler is now ready (flutter/engine#10309)
Also fixes the architecture of the bundled SO files.
2019-07-31 20:41:11 -07:00
Francisco Magdaleno
a05057aede [glfw] Enables replies on binary messenger in glfw embedder (flutter/engine#9948) 2019-07-31 14:27:46 -07:00