1. 11 9月, 2020 1 次提交
    • C
      Copyright header hygiene improvements (#21089) · 36f7f3ca
      Chris Bracken 提交于
      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.
      36f7f3ca
  2. 09 9月, 2020 1 次提交
    • C
      Update web lerpDouble to match C++ behaviour (#21010) · cf8c6b8b
      Chris Bracken 提交于
      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.
      cf8c6b8b
  3. 04 9月, 2020 1 次提交
  4. 03 9月, 2020 1 次提交
  5. 02 9月, 2020 2 次提交
  6. 31 8月, 2020 3 次提交
    • 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
    • C
      Extract Dart test utilities library (#20874) · 14ac65c9
      Chris Bracken 提交于
      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.
      14ac65c9
  7. 30 8月, 2020 1 次提交
  8. 29 8月, 2020 1 次提交
  9. 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
  10. 22 8月, 2020 1 次提交
  11. 15 8月, 2020 1 次提交
  12. 08 8月, 2020 1 次提交
  13. 07 8月, 2020 1 次提交
  14. 04 8月, 2020 1 次提交
    • D
      fuchsia: Remove dead code / break dependencies (#19396) · 12a37478
      David Worsham 提交于
      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
      12a37478
  15. 01 8月, 2020 1 次提交
  16. 29 7月, 2020 2 次提交
  17. 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
  18. 22 7月, 2020 1 次提交
    • D
      Refactor instantiateImageCodec/decodeImageFromPixels to provide an ImageDescriptor (#19537) · 52813224
      Dan Field 提交于
      Refactors instantiateImageCodec and decodeImageFromPixels to provide intermediate data about the image width, height, and bytes per pixel. This allows for more fine grained control from Dart, particularly when trying to reason about how or whether to maintain aspect ratio in the targetWidth/targetHeight parameters.
      
      This leaves the existing methods functional by re-implementing them to use the new ImmutableBuffer/ImageDescriptor class.
      
      The ImmutableBuffer class is provided so that callers can avoid copying the image data multiple times if they wish to re-recreate the image descriptor.
      
      Related Issues
      52813224
  19. 19 6月, 2020 1 次提交
    • D
      Parameterize upscaling for image decoding (#19067) · 5157a6b2
      Dan Field 提交于
      Adds an `allowUpscale` parameter to the Dart interfaces for instantiateImageCodec and decodeImageFromPIxels. If set to false, the image bounds will be clamped at their intrinsic dimensions.
      
      A later commit will change the default to true.
      5157a6b2
  20. 16 6月, 2020 1 次提交
  21. 13 6月, 2020 1 次提交
  22. 05 6月, 2020 1 次提交
  23. 04 6月, 2020 1 次提交
  24. 03 6月, 2020 1 次提交
    • D
      Make images contribute to Picture allocation size, more aggressively release... · f46dde1f
      Dan Field 提交于
      Make images contribute to Picture allocation size, more aggressively release references when dispose is called (#18706)
      
      SkImage references get held by both our Image and Picture objects. The GC has no idea about this, and so sometimes pictures look very small when they're actually holding a reference to a large chunk of memory. This patch helps make sure that the GC can more adequately catch the real size impact of Picture objects, and combined with an upstream patch in Dart allows for much more aggressive collection of unused image related memory.
      f46dde1f
  25. 03 4月, 2020 2 次提交
  26. 02 4月, 2020 1 次提交
  27. 28 3月, 2020 1 次提交
  28. 27 3月, 2020 1 次提交
  29. 25 3月, 2020 1 次提交
  30. 28 2月, 2020 1 次提交
  31. 21 2月, 2020 1 次提交
  32. 30 1月, 2020 1 次提交
  33. 29 1月, 2020 1 次提交
    • D
      Revert breaking PRs (#16148) · 53baa7ae
      Dan Field 提交于
      * Revert "Web PargraphStyle TextHeightBehavior integration (#16075)"
      
      This reverts commit 86682a2d.
      
      * Revert "Engine/LibTxt/dart:ui impl of TextHeightBehavior (#15087)"
      
      This reverts commit cbf4536d.
      53baa7ae
  34. 28 1月, 2020 1 次提交
  35. 17 1月, 2020 1 次提交