* Remove unnecessary `?`s from web_ui.
In https://dart-review.googlesource.com/c/sdk/+/163841, dart's flow
analysis is being changed so that an assignment like this:
T? x = <non-nullable value>;
causes `x` to be immediately promoted to type `T`. This exposed two
instances in which a variable was unnecessarily given a nullable type.
To avoid warnings, we need to fix these two types before
https://dart-review.googlesource.com/c/sdk/+/163841 can land.
* enable ios safari screenshot tests
* this is the value used for screenshots in the repo.
* change revision
* fix the error made in the gaps
* do not try to fetch on LUCI
* lunix luci migth break existing prs. only skip fetching for mac
* add a placeholder tests for shadow golden test
* try to use iPhone 11 Pro on LUCI
* change the scale and the smoke test image
* add unmerged goldens PR to tests all the screenshots. will be removed later
* change the goldens lock back to flutter/goldens
* change wrong comment on screenshot tests block
* address reviewer comments
* change the commit number for goldens file
* skip canvas blend mode tests
* debugging LUCI error
* debugging LUCI error printing directory contents
* skip one test, remove the debug logs
* change the revision number to include the correct chrome files
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
Registering the service worker immediately after the documented has loaded may cause SW initialization to compete with framework initialization. It was recommended to us that we defer the service worker setup until after the framework is done with setup, which should be sometime after the first frame.
To implement this, the binding will dispatch a platform message on startup. This can be listened for in the html document
#66066
* run safari desktop tests on luci
* fix safari issue. focus on dom element when new transform is received. add transform to test cases
* Update text_editing.dart
minor change to retrigger tests (recipe change is merged)
* running screenshot tests on ios-safari unit tests
* fixing the golden_smoke tests. changes to the documentation
* addressing reviewer comments
* cropping footer from the simulator screenshot. addressing some reviewer comments
* use .dart_tools for recording the screenshots
* fix the usage of the method
* adding TODO's for missing documentation and not supported windows tests
* addressing comments
* changing to incremental counter for file names
* add comment to the counter
* fix anaylze issues
* using takescreenshot method from the iosSimulator.
* address reviewer comments
* fix the scaling issue. disable eronous test
* change the smoke file for top gap 282
* change the variable name for scale factor
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.
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.
This adds a check for the presence of dart2js in the engine build.
Felt relies on an engine build with `--full-dart-sdk` set. Previously,
we checked for the presence of pub, but not for the presence of
web-specific tooling such as dart2js that felt relies on. Pub is built
as part of the default Dart SDK build when `--full-dart-sdk` is not set,
so its presence is insufficient to prove that other required tooling is
present.
Without this check, we get the following error on run:
Unhandled exception:
ProcessException: No such file or directory
Command: /Users/cbracken/src/flutter/engine/src/out/host_debug_unopt/dart-sdk/bin/dart2js --no-minify --disable-inlining --enable-asserts --enable-experiment=non-nullable --no-sound-null-safety -O2 -o test/paragraph_builder_test.dart.browser_test.dart.js test/paragraph_builder_test.dart
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.
* `Image.toByteData()` was not implemented in either DomCanvas or CanvasKit. This PR covers **both.**
* `Picture.toImage()` was not implemented in either DomCanvas or CanvasKit. This PR covers **CanvasKit**