1. 31 8月, 2020 2 次提交
    • C
      Improve the precision of lerpDouble (#20879) · 784e6d74
      Chris Bracken 提交于
      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.
      784e6d74
    • C
      lerpDouble: stricter handling of NaN and infinity (#20871) · dbc9b1a8
      Chris Bracken 提交于
      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.
      dbc9b1a8
  2. 27 8月, 2020 1 次提交
    • C
      Add tests for lerpDouble (#20778) · 388193a6
      Chris Bracken 提交于
      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.
      388193a6
  3. 25 7月, 2020 1 次提交
    • S
      Manual merge of Dart a3815b6590...24c7666def (#19967) · 3bb6cc26
      Siva 提交于
      * Manual merge or Dart into flutter a3815b6590...24c7666def
      
      dart-lang/sdk@24c7666def Update tests that have the current version number hardcoded
      dart-lang/sdk@f88ce7aef5 Increase Dart version to 2.10
      
      * Update language version.
      
      * Update license.
      
      * Hpdate language version.
      
      * Update license.
      3bb6cc26
  4. 13 6月, 2020 1 次提交
  5. 09 6月, 2020 1 次提交
  6. 14 5月, 2020 1 次提交
  7. 21 2月, 2020 1 次提交
  8. 17 1月, 2020 1 次提交
  9. 08 11月, 2018 1 次提交
  10. 18 1月, 2018 1 次提交
  11. 20 4月, 2017 1 次提交
  12. 30 9月, 2016 1 次提交
  13. 11 8月, 2016 1 次提交
  14. 13 10月, 2015 1 次提交
    • A
      Start sketching out new dart:ui API · 8d204406
      Adam Barth 提交于
      This patch starts down the process of cleaning up the dart:ui API. In this
      approach, we use Dart code to specify the interface instead of IDL. The code in
      this patch is far from complete. It's just a sketch to see how this sort of
      approach might work.
      8d204406