884 Commits

Author SHA1 Message Date
Yuqian Li
c2938d06b1
Revert "Migration to PlatformDispatcher and multi-window #20496" (#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit 931a04683d6eb49fc92059b2384ac5b1618d5422.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit 85b0031f73544e448354047dc6a236c0b0808252.
2020-10-12 19:26:41 -07:00
Greg Spencer
931a04683d
Fix documentation build for window changes. (#21780)
* Fix documentation build for window changes.

* Add missing interfaces for web_ui
2020-10-12 16:04:05 -07:00
Greg Spencer
85b0031f73
Migration to PlatformDispatcher and multi-window (#20496)
This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-09 16:29:16 -07:00
David Worsham
d5dddf32e7
fuchsia: Don't send ViewportMetrics w/ 0 DPR (#21392) 2020-10-06 17:57:28 -07:00
Nolan Scobie
d92c42f349
Minor a11y documentation breadcrumbs (#20330)
Adds a reference to RenderObject.describeSemanticsClip to
`SemanticsFlag.isHidden` and a hint that lets readers know that the
`SemanticsNode` rect is specified in local coordinates.
2020-10-02 23:30:23 -07:00
Dan Field
08cf7256d8
Fix getNextFrame (#21422) 2020-09-25 17:26:59 -07:00
Alexander Brusher
de5f2b48fb
Revert "Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (#20936)" (#21367)
This reverts commit 96efe39272a2850092c9a1445dc5406dbe1fb645.
2020-09-25 11:07:10 -07:00
Dan Field
aa8d5d4b9b
Avoid sending a 0 DPR to framework (#21389)
* Avoid sending a 0 DPR to framework

* check width and height as well
2020-09-25 10:35:57 -07:00
Ian Hickson
ee71df706a
Revert "Make drain() consistently asynchronous. (#21062)" (#21391)
This reverts commit cdc631c4338455f292f68c110d584870753e0160.
2020-09-24 18:19:53 -07:00
Ian Hickson
cdc631c433
Make drain() consistently asynchronous. (#21062) 2020-09-23 22:17:02 -07:00
Dan Field
2ea7e5230b
isCloneOf for Image (#21371)
* isCloneOf for Image

* Update docs, add missing impl
2020-09-23 21:09:44 -07:00
Dan Field
b49de93b33
Create an ImageHandle wrapper (#21057)
Allows for reference counting of images before disposal.

This will allow multiple callers to hold a reference to an image and dispose of their reference without disposing the underlying image until all handles have been disposed.

This will be used by the framework to help resolve some of the kludge I was trying to introduce in flutter/flutter#64582
2020-09-23 14:33:29 -07:00
Richard Cai
515f339838
Update docs specifying addPlatformView offset param is not used (#21331)
for Android and iOS and remove offset from scenario_app test for iOS and Android.
2020-09-23 10:37:57 -07:00
Thore Goebel
f84e7a0196
Fix x-axis direction in Offset.direction doc (#21208)
Specify that the positive x direction is right, as opposed to left.
2020-09-16 07:57:44 -07:00
Chris Bracken
2a26bfba13
Define _USE_MATH_DEFINES on Windows where needed (#21166) 2020-09-15 08:37:02 -07:00
Pragya
455a137171
Updated ColorMatrix to ColorFilter (#19905) 2020-09-14 11:59:57 -07:00
Chris Bracken
08dabe9601
Clean up C++ includes (#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Chris Bracken
16b900b63e
Prefer C++ standard headers to their C counterpart (#21091)
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
2020-09-11 17:10:00 -07:00
Sam Rawlins
cda059e55c
Fix erroneous dartdoc @tool directive. (#21109) 2020-09-11 12:00:02 -07:00
Chinmay Garde
f0fb74b8fb
Avoid crashing and display error if the process cannot be prepared for JIT mode Dart VM. (#20980) 2020-09-08 13:41:31 -07:00
Siva
d77dd31013
Manual roll of Dart b29f228f62...016e8880f0 (#20967)
dart-lang/sdk@016e8880f0 Version 2.10.0-90.0.dev
dart-lang/sdk@34f636ce1d Revert "[vm/io] Fix FileSystemWatcher enum name typo."
dart-lang/sdk@7a02118a41 [vm/fuchsia]: Safely shutdown the async message loop.
dart-lang/sdk@334d368146 [analyzer_plugin] Remove unused dart:async imports
dart-lang/sdk@047c0f860a [Analyzer] Support analyzing open files without open workspaces
dart-lang/sdk@f846d0e7ea [analyzer_cli] Remove unused dart:async imports
dart-lang/sdk@ba372d6e8a [dartdev] Remove unused dart:async import
dart-lang/sdk@30cfb228c0 [nnbd_migration] Remove unused dart:async imports
dart-lang/sdk@1134a0f17c [analysis_server] Remove unused dart:async imports
dart-lang/sdk@3317d47c7d [_fe_analyzer_shared] Remove unused dart:async import
dart-lang/sdk@0a036db596 [vm/io] Fix FileSystemWatcher enum name typo.
dart-lang/sdk@000f3135a5 [analyzer] Remove unused dart:async imports
dart-lang/sdk@7817aa1796 [dartfix] Remove unused dart:async imports
dart-lang/sdk@0144087619 Version 2.10.0-89.0.dev
dart-lang/sdk@42dfb9d304 Add `generateCallGraphWithDominators` method to generate a `CallGraph` from a precompiler trace.
dart-lang/sdk@01024dfa5a Issue 43200. Report ASSIGNMENT_TO_FINAL when 'final late' has an initializer.
dart-lang/sdk@ab16d79af9 Revert "Flow analysis changes to fix mixed-mode unsoundness loophole."
dart-lang/sdk@7363adca67 [infra] Update checked-in SDKs to 2.10.0-79.0.dev
dart-lang/sdk@d833f2f65c Flow analysis changes to fix mixed-mode unsoundness loophole.
dart-lang/sdk@33e4a6bc2a Revert "[vm] Have Read/WriteStream use (S)LEB128 for variable-length encoding."
dart-lang/sdk@d9dc24b53e Version 2.10.0-88.0.dev
dart-lang/sdk@7130dd4d3d [cfe] Report error on non-void setter return type
dart-lang/sdk@a7cb764aa4 [tests/ffi] Reinstate deleted test
dart-lang/sdk@39689eb07c [co19] Roll co19 to 9c07e26d67665de7972ba6f7e87369933a978545
dart-lang/sdk@1f92293fd5 Revert "[dart:html] Add 'creates' type description to JS calls"
dart-lang/sdk@e44cf969c6 Fix creates value for getStats
dart-lang/sdk@15201ebe5f Version 2.10.0-87.0.dev
dart-lang/sdk@eb8dfee107 [CFE] Clean up duplicate entries in spell checker lists
2020-09-03 20:50:59 -07:00
0xZero
ac8b9c4c52
Member variables should appear before the |WeakPtrFactory|. (#20899) 2020-09-03 14:34:01 -07:00
Dan Field
c700479db5
Revert external size changes to Picture (#20950) 2020-09-02 13:42:25 -07:00
Dan Field
634e499bcc
Use hint freed specifically for image disposal (#20754)
* Use hint freed specifically for image disposal
2020-09-02 13:41:58 -07:00
Jim Graham
96efe39272
Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (#20936)
This reverts commit 58a62076559585b167c89531dfb81092d744a552.
2020-09-01 21:21:07 -07:00
Alexander Brusher
58a6207655
Adds fuchsia node roles to accessibility bridge updates. (#20385) 2020-09-01 13:33:02 -07:00
Chris Bracken
784e6d746e
Improve the precision of lerpDouble (#20879)
Reduces errors caused by the loss of floating point precision when the
two extrema of the lerp differ significantly in magnitude. Previously,
we used the calculation:

    a + (b - a) * t

When the difference in magnitude between `a` and `b` exceeds the
precision representable by double-precision floating point math, `b - a`
results in the larger-magnitude value of `a` or `b`. The error between
the value produced and the correct value is then scaled by t.

A simple example of the impact can be seen when `a` is significantly
larger in magnitude than `b`. In that case, `b - a` results in `a` and
when `t` is 1.0, the resulting value is `a - (a) * 1.0 == 0`.

The patch transforms the computation to the mathematically-equivalent
expression:

    a * (1.0 - t) + b * t

By scaling each value independently, the behaviour is more accurate.
From the point of view of performance, this adds an extra
multiplication, but multiplication is relatively cheap and the behaviour
is significantly better.

This patch also adds a `precisionErrorTolerance` constant to
test_utils.dart and migrates existing tests to use `closeTo()` for
testing.

The tests themselves *do* currently use values that have an exact
floating-point representation, but we should allow for flexibility in
future implementation changes.
2020-08-30 22:26:10 -07:00
Chris Bracken
dbc9b1a856
lerpDouble: stricter handling of NaN and infinity (#20871)
Previously, the behaviour of lerpDouble with respect to NaN and infinity
was relatively complex and difficult to reason about. This patch
simplifies the behaviour with respect to those conditions and adds
documentation and tests.

In general, if `a == b` or both values are null, infinite, or NaN, `a`
is returned. Otherwise we require `a` and `b` and `t` to be finite or
null and the result of the linear interpolation is returned.
2020-08-30 11:08:59 -07:00
Chris Bracken
388193a67b
Add tests for lerpDouble (#20778)
The behaviour of lerpDouble with respect to null inputs isn't entirely
obvious. In the case where both inputs are null, it returns null.
Otherwise, it defaults the null parameter to 0.0 and carries on.

Post non-null by default, it might be nice to strengthen the parameter
contract to require them to be non-null. While this would be a breaking
change, it seems likely that the framework either meets this guarantee
or can provide it without a framework breaking change.

https://github.com/flutter/flutter/issues/64617 tracks the above.

In the meantime, adding a test to lock in the current behaviour.
2020-08-26 11:32:15 -07:00
Dan Field
4a88d5e109
Revert hint_freed (#20746)
This caused over-aggressive GCs, which vastly increased CPU usage benchmarks.

* Revert "fix build (#20644)"

This reverts commit b59793ee20be29463fac7a79635bf20253f04107.

* Revert "Hint freed (#19842)"

This reverts commit 3930ac1b25820baee3c67d921a0b009606cb3dae.
2020-08-25 11:55:40 -07:00
Jason Simmons
e09af86a26
Remove image sizes from Picture::GetAllocationSize (#20673) 2020-08-21 16:26:02 -07:00
David Worsham
4dc866283d
fuchsia: Convert legacy permutations to build flag (#20647) 2020-08-19 19:09:51 -07:00
Dan Field
3930ac1b25
Hint freed (#19842)
* Hint the VM when a layer or picture goes out of scope
2020-08-19 14:04:31 -07:00
David Worsham
5a2bf6aa4c
Reland: "fuchsia: Remove dead code / break dependencies" (#20532)
Reland #19396 with a fix for improper scale that was affecting internal tests

Tested: Ran all unittests, ran internal tests, and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-14 20:41:18 -07:00
xster
0c504da039
Refactor initial route code take 2 (#20468) 2020-08-13 14:18:11 -07:00
Jason Simmons
f3964186ca
Do not access members after calling ClearDartWrapper (#20465) 2020-08-13 11:06:02 -07:00
gaaclarke
2ac5b3460a
Revert "Refactor initial route code (#19684)" (#20450)
This reverts commit 8d08e6c369e349986831d83204a79af3fcb8d8ca.
2020-08-12 12:43:08 -07:00
xster
8d08e6c369
Refactor initial route code (#19684) 2020-08-11 19:52:04 -07:00
Ming Lyu (CareF)
8b72bbcec9
remove FrameTiming named constructor (#20380) 2020-08-10 12:21:03 -07:00
Ming Lyu (CareF)
409a5e5963
FrameTiming build start timestamp fix and add vsync start timestamp (#20229) 2020-08-07 19:41:01 -07:00
Yegor
9a5a17f378
remove leftover temp annotation from pre-null safe world (#20234)
Co-authored-by: David Iglesias <ditman@gmail.com>
2020-08-06 14:03:52 -07:00
Zachary Anderson
47c1c61a92
Revert "fuchsia: Remove dead code / break dependencies (#19396)" (#20302)
This reverts commit 12a37478de2cc9aff7f8fc72bc3a47f5f02e083c.
2020-08-06 12:06:06 -07:00
Ming Lyu (CareF)
8ddc5aa4fd
add a named constructor to FrameTiming (#20269) 2020-08-05 17:26:02 -07:00
Adlai Holler
3342bd05e4
Migrate a few last places to GrDirectContext (#20235)
* Migrate a few last places to GrDirectContext

This is a followup to #19962 to cover a few places where we
were still using GrContext. No functional impact.

* Formatting
2020-08-05 10:31:43 -07:00
David Worsham
12a37478de
fuchsia: Remove dead code / break dependencies (#19396)
The fuchsia code around metrics and sizing was just sending this
information through a side-channel, when the engine already had the
information available. So, delete all of it to make future CLs simpler.

Additionally, the SceneUpdateContext has many unneccesary dependencies
re: metrics and PaintTasks. Break those to make future CLs simpler.

Tested: Ran all unittests and ran workstation on Fuchsia
BUG: 53062, 53063
2020-08-03 22:09:26 -07:00
Jim Graham
22fb58b774
update nullability of drawAtlas methods and flesh out docs (#20176) 2020-07-31 17:26:02 -07:00
Greg Spencer
98cfd1db78
Move platform specific information to PlatformConfiguration class (#19652) 2020-07-31 17:21:02 -07:00
Juyeong Lee
13e993ed1a
Fix Typos (#19691) 2020-07-31 16:32:58 -07:00
Zachary Anderson
5513273d0f
Reland: Avoid a copy in EncodeImage (#20003) 2020-07-31 08:24:08 -07:00
Greg Spencer
a6cd3ebc61
Fix lint errors in lib/ui (#19988)
This fixes all of the lint errors in lib/ui, except for a few (three, I think) where it would have changed the API, converting non-const references to pointers. For those, I just did NOLINT on the particular line instead of ignoring the whole file.
2020-07-30 20:21:37 -07:00