Refine condition when setTargetAtTime has converged
The function HasSetTargetConverged was too restrictive and would continue to say the setTargetAtTime event was not converged even though the increment was so small as make no change in the value. Thus, adjust the criteria so that if the increment is too small to affect the value, consider the event has having converged. There's also a bug in HandleAllEventsInThePast where setTargetAtTime has converged and we've updated the default value but the timeline would return the old default value instead of the new converged default value. A couple of tests needed to be updated due to the change in the convergence criterion. Ran the test https://jsfiddle.net/8vo0gbav/52/ and the CPU now no longer goes to 100% as it did without this change. Bug: 813504 Change-Id: I506b31289b5b40380147d231d8b2ea41785d6600 Reviewed-on: https://chromium-review.googlesource.com/940273Reviewed-by:Hongchan Choi <hongchan@chromium.org> Commit-Queue: Raymond Toy <rtoy@chromium.org> Cr-Commit-Position: refs/heads/master@{#539900}
Showing
Please register or sign in to comment