gfx: Fix ToEnclosing/ToEnclosed math to deal with big numbers.
This match ensures that ToEnclosingRect and ToEnclosedRect deal
better with extreme values. In particular, width and height
calculations exhibited undefined behavior with signed integer
overflow. This was fixed by first promoting the operands to float
and then safely truncating the result to int.
R=danakj
Review URL: https://codereview.chromium.org/1186133003
Cr-Commit-Position: refs/heads/master@{#334487}
CrOS-Libchrome-Original-Commit: 03aa528c7796e123655a04c1d3bc3f9a75453ddd
2 files changed