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

Issue 11365160: ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. (Closed)

Created:
8 years, 1 month ago by danakj
Modified:
8 years, 1 month ago
Reviewers:
sky
CC:
chromium-reviews, cc-bugs_chromium.org, backer, piman
Visibility:
Public.

Description

ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always. This was added with the intention of using Size as a vector, replacing use of IntSize. Since we have Vector2d now, negative sizes should not exist, so clamp them in set_width/set_height and the constructor. R=sky BUG=160158 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=167062

Patch Set 1 #

Patch Set 2 : Add test #

Total comments: 4

Patch Set 3 : nits #

Patch Set 4 : dchecks #

Patch Set 5 : impl #

Patch Set 6 : negativesizeunittest #

Patch Set 7 : fix unit tests that use negative values or NaN #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -51 lines) Patch
M cc/draw_quad_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/rect_f.h View 1 2 3 4 1 chunk +2 lines, -3 lines 0 comments Download
M ui/gfx/rect_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -4 lines 0 comments Download
M ui/gfx/size.cc View 1 2 3 4 2 chunks +5 lines, -8 lines 0 comments Download
M ui/gfx/size_base.h View 1 2 3 4 2 chunks +4 lines, -13 lines 0 comments Download
A ui/gfx/size_base_impl.h View 1 2 3 4 5 6 1 chunk +37 lines, -0 lines 0 comments Download
M ui/gfx/size_f.cc View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M ui/gfx/size_unittest.cc View 1 2 3 4 5 6 3 chunks +0 lines, -18 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
danakj
8 years, 1 month ago (2012-11-09 01:08:45 UTC) #1
sky
https://codereview.chromium.org/11365160/diff/2001/ui/gfx/rect_f.h File ui/gfx/rect_f.h (left): https://codereview.chromium.org/11365160/diff/2001/ui/gfx/rect_f.h#oldcode39 ui/gfx/rect_f.h:39: SizeF newSize = size().Scale(x_scale, y_scale); newSize -> new_size https://codereview.chromium.org/11365160/diff/2001/ui/gfx/size_base.h ...
8 years, 1 month ago (2012-11-09 17:03:55 UTC) #2
danakj
https://codereview.chromium.org/11365160/diff/2001/ui/gfx/rect_f.h File ui/gfx/rect_f.h (left): https://codereview.chromium.org/11365160/diff/2001/ui/gfx/rect_f.h#oldcode39 ui/gfx/rect_f.h:39: SizeF newSize = size().Scale(x_scale, y_scale); On 2012/11/09 17:03:55, sky ...
8 years, 1 month ago (2012-11-09 17:06:57 UTC) #3
danakj
> There were DCHECKs previously. https://chromiumcodereview.appspot.com/10996037/diff/9010/ui/gfx/size_base_impl.h
8 years, 1 month ago (2012-11-09 17:08:52 UTC) #4
sky
Should we put back the DCHECKs then? On Fri, Nov 9, 2012 at 9:08 AM, ...
8 years, 1 month ago (2012-11-09 17:11:41 UTC) #5
danakj
On Fri, Nov 9, 2012 at 12:11 PM, Scott Violet <sky@chromium.org> wrote: > Should we ...
8 years, 1 month ago (2012-11-09 18:28:35 UTC) #6
danakj
I've added DCHECKs. The downside is you can't test code that is going to DCHECK, ...
8 years, 1 month ago (2012-11-09 18:33:10 UTC) #7
sky
I don't see the DCHECKs. Did you intend to put them back?
8 years, 1 month ago (2012-11-09 21:30:53 UTC) #8
danakj
Sorry, seems like i lost the change locally too. Uploaded now PTAL
8 years, 1 month ago (2012-11-09 21:41:30 UTC) #9
sky
LGTM
8 years, 1 month ago (2012-11-09 22:03:28 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11365160/10001
8 years, 1 month ago (2012-11-10 01:08:34 UTC) #11
commit-bot: I haz the power
Failed to apply patch for ui/gfx/size_base.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 1 month ago (2012-11-10 01:08:35 UTC) #12
danakj
In order to avoid LOG() macro conflicts from WebRect.h etc, I had to reinvoke the ...
8 years, 1 month ago (2012-11-10 02:42:29 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11365160/5012
8 years, 1 month ago (2012-11-10 02:42:47 UTC) #14
commit-bot: I haz the power
8 years, 1 month ago (2012-11-10 03:58:15 UTC) #15

Powered by Google App Engine
This is Rietveld 408576698