Make a single-param ctor explicit in order to prevent surprising
implicit conversions.
Add a check for zero message-size and don't malloc/memcpy the incoming
message in those cases.
Add braces where they were missing.
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.
This re-enables the iOS Scenarios tests which have been flaky in the
last couple days.
Disabling two tests where we've seen the flakes:
* AppLifecycleTests testFlutterViewControllerDetachingSendsApplicationLifecycle
* FlutterViewControllerInitialRouteTest testSettingInitialRoute
This reverts commit 84995bd516d94a3a7e52e752ad666a8b22068498.
- Standardize on lowercase for windows.h
- Don't define NOMINMAX before including windows.h in (some) public
wrapper headers, since it causes a warning when combined with setting
NOMINMAX at the build level, which is the more robust way to avoid
issues with min/max and windows.h
This disables the macOS Scenarios app tests until a fix for the current
flakiness is found.
This also reverts commit 9ef075582e0dcaa4df990338b931219465ffcbce where
one test was previously disabled. However, another started failing soon
after, so instead we disable the whole suite here.
This disables the macOS Scenarios app test
testFlutterViewControllerDetachingSendsApplicationLifecycle
until a fix for the flakiness is found.
Related issue: https://github.com/flutter/flutter/issues/61620
Fixes https://github.com/flutter/flutter/issues/65258
The following devicelab tests should pass after this patch:
- flutter_gallery_sksl_warmup__transition_perf_e2e_ios32
- flutter_gallery_sksl_warmup_ios32__transition_perf
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.