Implement Centroid calculation using a Kahan sum. Makes calc O(1).
This modifies Centroid calculation to be O(1) when calculating a centroid of a stroke. Centroid fetching/checking happens a lot, so it's worthwhile to optimize. Nevertheless this is still a heavy O(1) - so alternatives are happily considered. Bug: 1009290 Change-Id: Ia421502c1cdf5e37bd5c6f80dc4f866af2119b7f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880237Reviewed-by:Michael Spang <spang@chromium.org> Commit-Queue: Rob Schonberger <robsc@chromium.org> Cr-Commit-Position: refs/heads/master@{#709777}
Showing
Please register or sign in to comment