Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Issue 1186133003: gfx: Fix ToEnclosing/ToEnclosed math to deal with big numbers. (Closed)

Created:
5 years, 6 months ago by vmpstr
Modified:
5 years, 6 months ago
Reviewers:
danakj
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/03aa528c7796e123655a04c1d3bc3f9a75453ddd Cr-Commit-Position: refs/heads/master@{#334487}

Patch Set 1 #

Patch Set 2 : move function #

Total comments: 2

Patch Set 3 : update #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -50 lines) Patch
M ui/gfx/geometry/rect_conversions.cc View 1 2 chunks +14 lines, -4 lines 0 comments Download
M ui/gfx/geometry/rect_unittest.cc View 1 2 3 4 chunks +25 lines, -46 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
vmpstr
Please take a look.
5 years, 6 months ago (2015-06-15 18:46:21 UTC) #2
danakj
Thanks for the tests and fixes to the code. I'm not sure why SafelyScaleToEnclosingRect() is ...
5 years, 6 months ago (2015-06-15 18:48:21 UTC) #3
vmpstr
On 2015/06/15 18:48:21, danakj wrote: > Thanks for the tests and fixes to the code. ...
5 years, 6 months ago (2015-06-15 18:54:43 UTC) #4
danakj
On Mon, Jun 15, 2015 at 11:54 AM, <vmpstr@chromium.org> wrote: > On 2015/06/15 18:48:21, danakj ...
5 years, 6 months ago (2015-06-15 18:58:02 UTC) #5
vmpstr
On 2015/06/15 18:58:02, danakj wrote: > On Mon, Jun 15, 2015 at 11:54 AM, <mailto:vmpstr@chromium.org> ...
5 years, 6 months ago (2015-06-15 19:09:26 UTC) #6
danakj
https://codereview.chromium.org/1186133003/diff/20001/ui/gfx/geometry/rect.h File ui/gfx/geometry/rect.h (right): https://codereview.chromium.org/1186133003/diff/20001/ui/gfx/geometry/rect.h#newcode249 ui/gfx/geometry/rect.h:249: // scale. If the result is scaling would make ...
5 years, 6 months ago (2015-06-15 19:13:48 UTC) #7
vmpstr
PTAL. I removed the SafelyScaleToEnclosedRect function. Instead, this patch just fixes the signed overflow with ...
5 years, 6 months ago (2015-06-15 19:33:33 UTC) #8
danakj
LGTM
5 years, 6 months ago (2015-06-15 20:02:52 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186133003/60001
5 years, 6 months ago (2015-06-15 20:04:44 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/33938)
5 years, 6 months ago (2015-06-15 22:11:59 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186133003/60001
5 years, 6 months ago (2015-06-15 23:05:00 UTC) #15
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 6 months ago (2015-06-15 23:12:00 UTC) #16
commit-bot: I haz the power
5 years, 6 months ago (2015-06-15 23:12:48 UTC) #17
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/03aa528c7796e123655a04c1d3bc3f9a75453ddd
Cr-Commit-Position: refs/heads/master@{#334487}

Powered by Google App Engine
This is Rietveld 408576698