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

Issue 10993094: Make adding and subtracting gfx:: point types simpler. (Closed)

Created:
8 years, 2 months ago by danakj
Modified:
8 years, 2 months ago
Reviewers:
jamesr, sky
CC:
chromium-reviews, cc-bugs_chromium.org, backer, aelias_OOO_until_Jul13, piman, tfarina
Visibility:
Public.

Description

Make adding and subtracting gfx:: point types simpler. 1) Removed iffy flooring conversion from Float types to Int types. 2) Added methods to convert from Int to Float types so you can do things like add a Point to a PointF and viceversa. 3) Added operator+ and operator- for point types. This had to be done in both Point and PointF headers to allow (Point+PointF) to compile. 4) Move the PointF::~PointF() destructor to the .cc file to be consistent with other types. 5) Remove the unimplemented PointF::PointF(Point) constructor from the header. BUG=152473 R=sky,jamesr Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=160426

Patch Set 1 #

Patch Set 2 : remove some patch noise #

Total comments: 7

Patch Set 3 : #

Total comments: 7

Patch Set 4 : #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -25 lines) Patch
M content/browser/renderer_host/backing_store_mac.mm View 1 2 3 4 5 6 7 2 chunks +6 lines, -1 line 0 comments Download
M ui/gfx/point.h View 1 2 3 4 5 2 chunks +13 lines, -0 lines 0 comments Download
M ui/gfx/point_f.h View 1 2 4 1 chunk +9 lines, -5 lines 0 comments Download
M ui/gfx/point_f.cc View 1 2 3 4 5 6 2 chunks +1 line, -7 lines 0 comments Download
M ui/gfx/rect.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/size.h View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
M ui/gfx/size_f.h View 2 chunks +0 lines, -3 lines 0 comments Download
M ui/gfx/size_f.cc View 1 2 3 4 5 6 2 chunks +0 lines, -8 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
danakj
8 years, 2 months ago (2012-09-28 22:54:05 UTC) #1
sky
https://codereview.chromium.org/10993094/diff/3001/ui/gfx/point.h File ui/gfx/point.h (right): https://codereview.chromium.org/10993094/diff/3001/ui/gfx/point.h#newcode28 ui/gfx/point.h:28: Point(const Point& other); explicit https://codereview.chromium.org/10993094/diff/3001/ui/gfx/point.h#newcode51 ui/gfx/point.h:51: operator PointF() const ...
8 years, 2 months ago (2012-09-28 23:05:49 UTC) #2
danakj
Thanks, PTAL. https://codereview.chromium.org/10993094/diff/3001/ui/gfx/point.h File ui/gfx/point.h (right): https://codereview.chromium.org/10993094/diff/3001/ui/gfx/point.h#newcode28 ui/gfx/point.h:28: Point(const Point& other); On 2012/09/28 23:05:49, sky ...
8 years, 2 months ago (2012-09-28 23:19:14 UTC) #3
sky
I have mixed feelings about all this. From the style guide: "Do not overload operators ...
8 years, 2 months ago (2012-10-01 13:42:03 UTC) #4
danakj
On 2012/10/01 13:42:03, sky wrote: > I have mixed feelings about all this. From the ...
8 years, 2 months ago (2012-10-01 15:22:38 UTC) #5
sky
Here's more from the section suggesting no operators: It can fool our intuition into thinking ...
8 years, 2 months ago (2012-10-01 17:08:29 UTC) #6
brettw
I think simple geometric base types are the main place where operator overloading makes sense, ...
8 years, 2 months ago (2012-10-01 17:23:29 UTC) #7
jamesr
On 2012/10/01 15:22:38, danakj wrote: > As to operator RectF() it is the same as ...
8 years, 2 months ago (2012-10-01 18:17:17 UTC) #8
danakj
On 2012/10/01 18:17:17, jamesr wrote: > On 2012/10/01 15:22:38, danakj wrote: > > As to ...
8 years, 2 months ago (2012-10-01 18:20:10 UTC) #9
sky
https://codereview.chromium.org/10993094/diff/2010/ui/gfx/point.h File ui/gfx/point.h (right): https://codereview.chromium.org/10993094/diff/2010/ui/gfx/point.h#newcode55 ui/gfx/point.h:55: inline Point operator+(Point lhs, Point rhs) { const Point& ...
8 years, 2 months ago (2012-10-01 21:02:20 UTC) #10
sky
Thanks Brett. -Scott On Mon, Oct 1, 2012 at 10:23 AM, <brettw@chromium.org> wrote: > I ...
8 years, 2 months ago (2012-10-01 21:02:28 UTC) #11
danakj
https://codereview.chromium.org/10993094/diff/2010/ui/gfx/rect.h File ui/gfx/rect.h (right): https://codereview.chromium.org/10993094/diff/2010/ui/gfx/rect.h#newcode81 ui/gfx/rect.h:81: operator RectF() const { On 2012/10/01 21:02:20, sky wrote: ...
8 years, 2 months ago (2012-10-01 21:55:34 UTC) #12
danakj
https://codereview.chromium.org/10993094/diff/2010/ui/gfx/point.h File ui/gfx/point.h (right): https://codereview.chromium.org/10993094/diff/2010/ui/gfx/point.h#newcode55 ui/gfx/point.h:55: inline Point operator+(Point lhs, Point rhs) { On 2012/10/01 ...
8 years, 2 months ago (2012-10-01 22:03:37 UTC) #13
sky
It's obscure and not immediately obvious what is going on. Which is why the style ...
8 years, 2 months ago (2012-10-01 22:59:21 UTC) #14
danakj
ok. ptal
8 years, 2 months ago (2012-10-02 18:36:51 UTC) #15
enne (OOO)
On 2012/10/01 22:59:21, sky wrote: > It's obscure and not immediately obvious what is going ...
8 years, 2 months ago (2012-10-02 19:29:22 UTC) #16
sky
In my experience folks are less surprised by implicit conversion of primitive types then they ...
8 years, 2 months ago (2012-10-02 20:04:32 UTC) #17
sky
LGTM http://codereview.chromium.org/10993094/diff/25001/ui/gfx/size.h File ui/gfx/size.h (right): http://codereview.chromium.org/10993094/diff/25001/ui/gfx/size.h#newcode46 ui/gfx/size.h:46: SizeF ToSizeF() const WARN_UNUSED_RESULT { Remove the WARN_UNUSED_RESULT. ...
8 years, 2 months ago (2012-10-02 20:05:38 UTC) #18
danakj
http://codereview.chromium.org/10993094/diff/25001/ui/gfx/size.h File ui/gfx/size.h (right): http://codereview.chromium.org/10993094/diff/25001/ui/gfx/size.h#newcode46 ui/gfx/size.h:46: SizeF ToSizeF() const WARN_UNUSED_RESULT { On 2012/10/02 20:05:38, sky ...
8 years, 2 months ago (2012-10-02 20:06:33 UTC) #19
enne (OOO)
On 2012/10/02 20:04:32, sky wrote: > In my experience folks are less surprised by implicit ...
8 years, 2 months ago (2012-10-02 20:33:21 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/10993094/17002
8 years, 2 months ago (2012-10-04 22:19:05 UTC) #21
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-04 22:46:30 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/10993094/34001
8 years, 2 months ago (2012-10-04 22:46:35 UTC) #23
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
8 years, 2 months ago (2012-10-05 01:04:57 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/10993094/33002
8 years, 2 months ago (2012-10-05 01:05:29 UTC) #25
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
8 years, 2 months ago (2012-10-05 01:17:57 UTC) #26
tfarina
On 2012/10/02 20:33:21, enne wrote: > On 2012/10/02 20:04:32, sky wrote: > > In my ...
8 years, 2 months ago (2012-10-05 01:49:48 UTC) #27
enne (OOO)
On 2012/10/05 01:49:48, tfarina wrote: > Scott, if we can't do this conversion implicitly, then ...
8 years, 2 months ago (2012-10-05 16:11:26 UTC) #28
piman
On Fri, Oct 5, 2012 at 9:11 AM, <enne@chromium.org> wrote: > On 2012/10/05 01:49:48, tfarina ...
8 years, 2 months ago (2012-10-05 16:29:37 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/10993094/36001
8 years, 2 months ago (2012-10-05 16:49:36 UTC) #30
danakj
On Fri, Oct 5, 2012 at 9:29 AM, Antoine Labour <piman@chromium.org> wrote: > > > ...
8 years, 2 months ago (2012-10-05 17:20:33 UTC) #31
piman
On Fri, Oct 5, 2012 at 10:20 AM, Dana Jansens <danakj@chromium.org> wrote: > On Fri, ...
8 years, 2 months ago (2012-10-05 17:27:31 UTC) #32
commit-bot: I haz the power
8 years, 2 months ago (2012-10-05 18:24:29 UTC) #33
Retried try job too often for step(s) interactive_ui_tests

Powered by Google App Engine
This is Rietveld 408576698