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

Issue 2051343002: Make various gfx classes more amenable to use as compile-time constants. (Closed)

Created:
4 years, 6 months ago by Peter Kasting
Modified:
4 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

Make various gfx classes more amenable to use as compile-time constants. Specifically, this means marking most constructors and simple accessors as constexpr. It also means removing the explicit empty destructors, since that can qualify as a nontrivial destructor and bung things up. (If we really want to explicitly declare these, the right way would be to use "= default".) This also adds some missing operators to the Insets classes. I needed one of these, and the style guide says to overload all related operators when overloading one. BUG=none TEST=none CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel R=danakj@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/275539a60ec716bea022200fa650a409772a81bf

Patch Set 1 #

Total comments: 16

Patch Set 2 : Compile and test fixes #

Total comments: 2

Patch Set 3 : Compile and test fixes #

Patch Set 4 : More compile fixes #

Patch Set 5 : Compile fixes #

Patch Set 6 : Compile fixes redux #

Patch Set 7 : Son of compile fixes #

Patch Set 8 : Another compile fix #

Patch Set 9 : Resync #

Patch Set 10 : Delete destructor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+223 lines, -181 lines) Patch
M ui/gfx/geometry/box_f.h View 1 2 3 4 5 6 7 8 3 chunks +19 lines, -16 lines 0 comments Download
M ui/gfx/geometry/insets.h View 3 chunks +34 lines, -13 lines 0 comments Download
M ui/gfx/geometry/insets.cc View 1 chunk +0 lines, -12 lines 0 comments Download
M ui/gfx/geometry/insets_f.h View 3 chunks +34 lines, -13 lines 0 comments Download
M ui/gfx/geometry/insets_f.cc View 1 chunk +0 lines, -12 lines 0 comments Download
M ui/gfx/geometry/insets_unittest.cc View 1 3 chunks +50 lines, -1 line 0 comments Download
M ui/gfx/geometry/point.h View 2 chunks +4 lines, -6 lines 0 comments Download
M ui/gfx/geometry/point3_f.h View 2 chunks +7 lines, -9 lines 0 comments Download
M ui/gfx/geometry/point_f.h View 1 chunk +5 lines, -6 lines 0 comments Download
M ui/gfx/geometry/quad_f.h View 1 2 chunks +12 lines, -12 lines 0 comments Download
M ui/gfx/geometry/rect.h View 1 3 chunks +17 lines, -18 lines 0 comments Download
M ui/gfx/geometry/rect_f.h View 1 2 chunks +17 lines, -19 lines 0 comments Download
M ui/gfx/geometry/size.h View 2 chunks +4 lines, -6 lines 0 comments Download
M ui/gfx/geometry/size_f.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -6 lines 0 comments Download
M ui/gfx/geometry/vector2d.h View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/gfx/geometry/vector2d_f.h View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/gfx/geometry/vector3d_f.h View 1 chunk +7 lines, -6 lines 0 comments Download
M ui/gfx/geometry/vector3d_f.cc View 1 chunk +0 lines, -18 lines 0 comments Download

Messages

Total messages: 24 (11 generated)
Peter Kasting
https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/size_f.h#newcode23 ui/gfx/geometry/size_f.h:23: : width_(width < 0 ? 0 : width), height_(height ...
4 years, 6 months ago (2016-06-10 00:19:19 UTC) #2
danakj
https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/box_f.h File ui/gfx/geometry/box_f.h (right): https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/box_f.h#newcode72 ui/gfx/geometry/box_f.h:72: constexpr float x() const { return origin_.x(); } is ...
4 years, 6 months ago (2016-06-10 00:36:48 UTC) #3
vmpstr
https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/box_f.h File ui/gfx/geometry/box_f.h (right): https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/box_f.h#newcode72 ui/gfx/geometry/box_f.h:72: constexpr float x() const { return origin_.x(); } On ...
4 years, 6 months ago (2016-06-10 00:46:15 UTC) #5
Peter Kasting
Turns out making these constexpr, much like making DISALLOW_COPY_AND_ASSIGN use =delete, starts exposing a bunch ...
4 years, 6 months ago (2016-06-10 05:50:06 UTC) #9
Peter Kasting
https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/size_f.h#newcode23 ui/gfx/geometry/size_f.h:23: : width_(width < 0 ? 0 : width), height_(height ...
4 years, 6 months ago (2016-06-10 07:03:18 UTC) #10
Peter Kasting
Hold off reviewing this; I'm splitting the variable removals out, and I had an idea ...
4 years, 6 months ago (2016-06-10 21:40:21 UTC) #11
Peter Kasting
OK, this is ready for re-review. The cleanup has been landed, and the changes to ...
4 years, 6 months ago (2016-06-14 18:51:59 UTC) #12
danakj
LGTM https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/insets.h File ui/gfx/geometry/insets.h (right): https://codereview.chromium.org/2051343002/diff/1/ui/gfx/geometry/insets.h#newcode105 ui/gfx/geometry/insets.h:105: lhs += rhs; On 2016/06/10 05:50:06, Peter Kasting ...
4 years, 6 months ago (2016-06-14 19:04:12 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051343002/180001
4 years, 6 months ago (2016-06-14 22:58:32 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on tryserver.chromium.mac (JOB_TIMED_OUT, no build URL) ios-device-gn on ...
4 years, 6 months ago (2016-06-15 00:59:39 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051343002/180001
4 years, 6 months ago (2016-06-15 01:30:44 UTC) #20
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/275539a60ec716bea022200fa650a409772a81bf Cr-Commit-Position: refs/heads/master@{#399815}
4 years, 6 months ago (2016-06-15 01:45:32 UTC) #22
Peter Kasting
4 years, 6 months ago (2016-06-15 01:46:27 UTC) #24
Message was sent while issue was closed.
Committed patchset #10 (id:180001) manually as
275539a60ec716bea022200fa650a409772a81bf (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698