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

Issue 11028127: Implicit coversion operators from integer geometry types to floating point. (Closed)

Created:
8 years, 2 months ago by danakj
Modified:
8 years, 2 months ago
Reviewers:
jamesr, sky, piman
CC:
chromium-reviews, cc-bugs_chromium.org, piman, backer, Use pkasting(at)chromium.org, tfarina
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Implicit coversion operators from integer geometry types to floating point. This change allows you to call a function that expects a floating point object with an integer object and have things just work. The addition operator for Points is outside the Point classes so it can add/subtract integer and float points together implicitly. Tested to verify compilation with: ui_unittests:RectTest.ToRectF ui_unittests:SizeTest.ToSizeF ui_unittests:PointTest.ToPointF BUG=147395 R=sky@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=161415

Patch Set 1 #

Patch Set 2 : operator== #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : sort #

Patch Set 7 : rebase #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -79 lines) Patch
M chrome/browser/notifications/balloon_collection_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/paint_aggregator.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M ui/base/win/hwnd_util.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/point.h View 1 2 chunks +9 lines, -1 line 0 comments Download
M ui/gfx/point_base.h View 1 1 chunk +0 lines, -8 lines 0 comments Download
M ui/gfx/point_f.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
A ui/gfx/point_unittest.cc View 1 1 chunk +31 lines, -0 lines 0 comments Download
M ui/gfx/rect.h View 1 2 chunks +11 lines, -2 lines 0 comments Download
M ui/gfx/rect_base.h View 1 2 chunks +0 lines, -11 lines 0 comments Download
M ui/gfx/rect_base_impl.h View 1 1 chunk +0 lines, -10 lines 0 comments Download
M ui/gfx/rect_f.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
M ui/gfx/rect_unittest.cc View 1 4 chunks +47 lines, -32 lines 0 comments Download
M ui/gfx/size.h View 1 2 chunks +9 lines, -1 line 0 comments Download
M ui/gfx/size_base.h View 1 1 chunk +0 lines, -8 lines 0 comments Download
M ui/gfx/size_f.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
A ui/gfx/size_unittest.cc View 1 1 chunk +31 lines, -0 lines 0 comments Download
M ui/ui_unittests.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/ppb_graphics_2d_impl_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/webview_plugin.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (0 generated)
danakj
8 years, 2 months ago (2012-10-10 22:11:44 UTC) #1
danakj
TBH I'm not sure about operator==. I tried to keep this conservative for now. Since ...
8 years, 2 months ago (2012-10-10 22:13:24 UTC) #2
Peter Kasting
On 2012/10/10 22:13:24, danakj wrote: > Since it would be comparing both as floats, maybe ...
8 years, 2 months ago (2012-10-10 22:13:50 UTC) #3
danakj
On 2012/10/10 22:13:50, Peter Kasting wrote: > On 2012/10/10 22:13:24, danakj wrote: > > Since ...
8 years, 2 months ago (2012-10-10 22:22:03 UTC) #4
tfarina
On 2012/10/10 22:22:03, danakj wrote: > New patch moves operator== outside the classes so that ...
8 years, 2 months ago (2012-10-11 00:03:56 UTC) #5
danakj
On Wed, Oct 10, 2012 at 5:03 PM, <tfarina@chromium.org> wrote: > If you moved it ...
8 years, 2 months ago (2012-10-11 00:05:08 UTC) #6
sky
LGTM http://codereview.chromium.org/11028127/diff/3004/ui/ui_unittests.gypi File ui/ui_unittests.gypi (right): http://codereview.chromium.org/11028127/diff/3004/ui/ui_unittests.gypi#newcode85 ui/ui_unittests.gypi:85: 'gfx/size_unittest.cc', sort
8 years, 2 months ago (2012-10-11 00:55:13 UTC) #7
danakj
Thanks! http://codereview.chromium.org/11028127/diff/3004/ui/ui_unittests.gypi File ui/ui_unittests.gypi (right): http://codereview.chromium.org/11028127/diff/3004/ui/ui_unittests.gypi#newcode85 ui/ui_unittests.gypi:85: 'gfx/size_unittest.cc', On 2012/10/11 00:55:13, sky wrote: > sort ...
8 years, 2 months ago (2012-10-11 01:10:09 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11028127/6010
8 years, 2 months ago (2012-10-11 06:01:21 UTC) #9
commit-bot: I haz the power
Presubmit check for 11028127-6010 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 2 months ago (2012-10-11 06:01:40 UTC) #10
danakj
+piman for content/ OWNERS +jamesr for webkit/ OWNERS
8 years, 2 months ago (2012-10-11 06:03:40 UTC) #11
jamesr
webkit/ and content/renderer lgtm
8 years, 2 months ago (2012-10-11 18:02:15 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11028127/6010
8 years, 2 months ago (2012-10-11 18:03:20 UTC) #13
commit-bot: I haz the power
Failed to apply patch for ui/ui_unittests.gypi: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 2 months ago (2012-10-11 18:03:28 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11028127/11023
8 years, 2 months ago (2012-10-11 18:06:38 UTC) #15
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build. Your ...
8 years, 2 months ago (2012-10-11 18:31:23 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11028127/11025
8 years, 2 months ago (2012-10-11 18:48:59 UTC) #17
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build. Your ...
8 years, 2 months ago (2012-10-11 19:14:42 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11028127/11025
8 years, 2 months ago (2012-10-11 19:38:28 UTC) #19
commit-bot: I haz the power
8 years, 2 months ago (2012-10-11 21:52:25 UTC) #20
Change committed as 161415

Powered by Google App Engine
This is Rietveld 408576698