177 Commits

Author SHA1 Message Date
Jason Simmons
8c6f4a36de Signal an error if an Isolate.spawnUri call uses an unsupported URI (flutter/engine#24583) 2021-03-10 16:45:02 -08:00
chunhtai
92d11213ff Adds set text action for voice access (flutter/engine#24734) 2021-03-04 17:44:01 -08:00
LongCatIsLooong
deec3a0d07 Reland "TextStyle level leadingDistribution (#24025)" reverted in #24665 (flutter/engine#24668) 2021-03-01 14:55:03 -08:00
LongCatIsLooong
b82a309954 Revert "TextStyle level leadingDistribution (#24025)" (flutter/engine#24665) 2021-02-26 12:41:01 -08:00
LongCatIsLooong
e10becadf3 TextStyle level leadingDistribution (flutter/engine#24025) 2021-02-25 11:46:02 -08:00
Jason Simmons
b27a922c38 Propagate image decode errors to the future returned by Codec.getNextFrame (flutter/engine#24336) 2021-02-11 14:51:03 -08:00
Tong Mu
ee1cc9f5ab Hardware keyboard: Web, embedder, and dart:ui (flutter/engine#23466) 2021-01-28 17:19:02 -08:00
Ian Hickson
b26007da3e Continue filling in the list of FontFeatures (flutter/engine#23730) 2021-01-27 02:49:02 -08:00
Dan Field
dedf9bd1af Reland path volatility tracker, disabling it if deterministic rendering is requested (flutter/engine#23226)
* Reland path volatility tracker (#23063)" (#23220)

This reverts commit b56fc25561417f96e17dacab375e66f474a54c94.

* allow disabling based on whether deterministic rendering is needed
2020-12-22 08:25:20 -08:00
Dan Field
b56fc25561 Revert "Reland path volatility tracker (#23063)" (flutter/engine#23220)
This reverts commit 77c7096efb0b1392acc9793c386561a3c36012ba.
2020-12-21 13:53:18 -08:00
Dan Field
77c7096efb Reland path volatility tracker (flutter/engine#23063)
* Revert "Revert "Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)" (#23044)"

This reverts commit feda80cb42f99e2588a9a6b9ab3dd1f812d0f45b.

* Fix tracing
2020-12-14 17:21:55 -08:00
Dan Field
feda80cb42 Revert "Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)" (flutter/engine#23044)
This reverts commit 2d52a3c87c97660a050e4bf5559091d0cec262f3.
2020-12-11 15:39:24 -08:00
Jim Graham
8d66065e9a Allow Tile mode for blur filter and add new decal TileMode (flutter/engine#22982)
Add a new TileMode.decal enum value and allow TileMode in ImagerFilter.blur() constructor
2020-12-10 14:37:17 -08:00
Dan Field
2d52a3c87c Set SkPath::setIsVolatile based on whether the path survives at least two frames (flutter/engine#22620)
This patch defaults the volatility bit on SkPaths to false, and then flips it to true if the path survives at least two frames.
2020-12-10 13:57:23 -08:00
Alexander Aprelev
240e9648d3 Use List.filled constructor instead of soon-to-be-deprecated List constructor (flutter/engine#22925) 2020-12-08 09:53:05 -08:00
Greg Spencer
851544f2d2 Fix PlatformDispatcher.locale to return something meaningful when there are no locales. (flutter/engine#22608)
Returns an "undefined" locale (language code "und") from PlatformDispatcher.locale when no locales are defined.
2020-12-01 09:54:56 -08:00
vsmenon
c035c7f167 Remove opt outs for dart:ui (flutter/engine#22603)
* Remove null safety opt outs for dart:ui
2020-11-19 18:54:12 -08:00
Ian Hickson
9902781f55 Also maintain the zone on the ChannelBuffers.push callback (flutter/engine#22454) 2020-11-17 09:48:03 -08:00
LongCatIsLooong
465c84321e Exposing ColorFilter to ImageFilter conversion and Compose() (flutter/engine#20309) 2020-11-12 15:34:02 -08:00
Zachary Anderson
62f0aa5126 Add SDK constraint to a pubspec (flutter/engine#22375)
This appears to be blocking the Dart SDK roll.
2020-11-06 17:11:11 -08:00
Ian Hickson
618c52f1aa Refactor platform message logic (flutter/engine#22181) 2020-11-05 15:19:01 -08:00
Chris Bracken
736d19ecbf Fix _lerpInt precision bug (flutter/engine#22089)
Fixes a precision bug was introduced in 5f363dc, which improved the
precision of lerpDouble when the extrema differed significantly in
magnitude.

_lerpInt doesn't have this issue since the extrema are passed as 64-bit
twos-complement values, therefore the difference will always be accurate
so long as it doesn't overflow. This reverts the _lerpInt implementation
to the original a + (b - a) * t, but adds a test to avoid a regression
if anyone is tempted to make it consistent with the others.
2020-10-24 09:49:21 -07:00
Dan Field
ab0d43bf69 Add debugDisposed to Image (flutter/engine#21547) 2020-10-23 10:27:02 -07:00
Greg Spencer
06b6f8af89 Reland: Migration to PlatformDispatcher and multi-window (flutter/engine#21932)
This re-lands #20496 and #21780 after fixing the semantics-enabling code that was causing the post-submit web_smoke_test to fail.

Below is the description from the original PR:

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-22 14:54:25 -07:00
Yuqian Li
0c645869e3 Revert "Migration to PlatformDispatcher and multi-window #20496" (flutter/engine#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit a539d91840d2fbbb4aa07eeed6a92d654db167ab.

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

This reverts commit a58fec63f196175eedfc5fbaedce9336dab5c508.
2020-10-12 19:26:41 -07:00
Greg Spencer
a58fec63f1 Migration to PlatformDispatcher and multi-window (flutter/engine#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
Dan Field
f7bbb7d405 Fix getNextFrame (flutter/engine#21422) 2020-09-25 17:26:59 -07:00
Alexander Brusher
2afe2bffaf Revert "Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (#20936)" (flutter/engine#21367)
This reverts commit 22e1f69704ed0f67b6b57d72197abac4a35f94b3.
2020-09-25 11:07:10 -07:00
Ian Hickson
49b2401dfe Revert "Make drain() consistently asynchronous. (#21062)" (flutter/engine#21391)
This reverts commit 7a237c9b68fc5fc2813c732d316e9cde5a932def.
2020-09-24 18:19:53 -07:00
Ian Hickson
7a237c9b68 Make drain() consistently asynchronous. (flutter/engine#21062) 2020-09-23 22:17:02 -07:00
Dan Field
3b207ab1f7 isCloneOf for Image (flutter/engine#21371)
* isCloneOf for Image

* Update docs, add missing impl
2020-09-23 21:09:44 -07:00
Dan Field
182a38b446 Create an ImageHandle wrapper (flutter/engine#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
Chris Bracken
9ff7d7ca44 Copyright header hygiene improvements (flutter/engine#21089)
Add copyright headers in a few files where they were missing.

Trim trailing blank comment line where present, for consistency with
other engine code.

Use the standard libtxt copyright header in one file where it differed
(extra (C) and comma compared to other files in libtxt).

This also amends tools/const_finder/test/const_finder_test.dart to look
for a const an additional four lines down to account for the copyright
header added to the test fixture.
2020-09-11 08:55:37 -07:00
Chris Bracken
753abd9f14 Update web lerpDouble to match C++ behaviour (flutter/engine#21010)
This updates the web_ui implementation of lerpDouble to match the
behaviour of the C++ engine implementation in dart:ui.

Specifically this covers the following changes:
* #20871: stricter handling of NaN and infinity
* #20879: Improve the precision of lerpDouble

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.

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-09-08 16:04:11 -07:00
Jason Simmons
f0520a07ab Update test Dart code to pass the latest Dart analyzer rules (flutter/engine#20986) 2020-09-03 18:09:05 -07:00
Dan Field
3dcd0fb2b7 Revert external size changes to Picture (flutter/engine#20950) 2020-09-02 13:42:25 -07:00
Jim Graham
22e1f69704 Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (flutter/engine#20936)
This reverts commit 26659fa0fd05b2f3cc3c2e530298659702e1f869.
2020-09-01 21:21:07 -07:00
Alexander Brusher
26659fa0fd Adds fuchsia node roles to accessibility bridge updates. (flutter/engine#20385) 2020-09-01 13:33:02 -07:00
Chris Bracken
5f363dcee6 Improve the precision of lerpDouble (flutter/engine#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
f113960205 lerpDouble: stricter handling of NaN and infinity (flutter/engine#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
d42e2f004c Extract Dart test utilities library (flutter/engine#20874)
This extracts a Dart test utilities library, containing
`expectAssertion` and `expectArgumentError` functions that simplify
running tests that test assertions across debug, profile, and release
configurations.

This change also restricts Dart unit tests to testing files whose
filename matches `*_test.dart` under `flutter/testing/dart`; previously
any file in that directory was run, but all files matched the above
pattern.
2020-08-30 11:07:05 -07:00
Chris Bracken
399a7961cd Add integer input tests for lerpDouble (flutter/engine#20880)
The `a` and `b` parameters to `lerpDouble` have type `num`. This adds
tests for integer parameter values.
2020-08-29 16:48:41 -07:00
Chris Bracken
6a210704a8 lerpDouble: add tests for NaN, infinity (flutter/engine#20848)
Adds tests for lerpDouble for cases where NaN or infinite values are
passed. These tests simply specify the current behaviour.
2020-08-28 15:11:15 -07:00
Chris Bracken
d37e3846a8 Add tests for lerpDouble (flutter/engine#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
Jason Simmons
1945052c8e Remove image sizes from Picture::GetAllocationSize (flutter/engine#20673) 2020-08-21 16:26:02 -07:00
David Worsham
ad2bff1014 Reland: "fuchsia: Remove dead code / break dependencies" (flutter/engine#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
Ming Lyu (CareF)
24b22ade69 FrameTiming build start timestamp fix and add vsync start timestamp (flutter/engine#20229) 2020-08-07 19:41:01 -07:00
Zachary Anderson
275f2b04cc Revert "fuchsia: Remove dead code / break dependencies (#19396)" (flutter/engine#20302)
This reverts commit 017f07942e8e80a4e886def19c6fffac7ce18479.
2020-08-06 12:06:06 -07:00
David Worsham
017f07942e fuchsia: Remove dead code / break dependencies (flutter/engine#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
c32ae6bc2b update nullability of drawAtlas methods and flesh out docs (flutter/engine#20176) 2020-07-31 17:26:02 -07:00