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

Issue 2749513011: Stabilize empty rect handling in EnclosingRect. (Closed)

Created:
3 years, 9 months ago by Peter Mayo
Modified:
3 years, 8 months ago
Reviewers:
danakj
CC:
chromium-reviews, cc-bugs_chromium.org, sky
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Stabilize empty rect handling in EnclosingRect. We want empty Rects to have empty enclosing rects, per https://chromiumcodereview.appspot.com/15233003, but we would prefer this to not bounce around based on floating point calculations accumulating some epsilon sized errors. roundOut in SKIA does not have either the former or the new behavior, so we are drifting apart from an underlying expectation, and should be careful this doesn't cause future inconsistencies between paths, like mainthread/ impl thread. BUG=None R=danakj CC=sky CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2749513011 Cr-Commit-Position: refs/heads/master@{#460794} Committed: https://chromium.googlesource.com/chromium/src/+/faa28efcb640abddbf5f80a75724bad3d6e20a31

Patch Set 1 #

Total comments: 1

Patch Set 2 : Make less sensitive #

Patch Set 3 : Keep size positive or zero. #

Patch Set 4 : Use size in Enclosing computation #

Total comments: 2

Patch Set 5 : Drop limits #

Patch Set 6 : Add ARM code branch #

Total comments: 5

Patch Set 7 : Fix edges better #

Total comments: 2

Patch Set 8 : Remove logicals, add tests, fix inconsistency, unwrap internals #

Total comments: 1

Patch Set 9 : typo #

Patch Set 10 : Rebase to ToT and fix comment typo. #

Total comments: 13

Patch Set 11 : SizeFPrivate, prettier unittests. #

Patch Set 12 : Move kTrivial inside the class #

Total comments: 5

Patch Set 13 : Convert to FRIEND_TEST_ALL_PREFIXES #

Patch Set 14 : Change constnat naming convention, add assertion that nearly trivial isn't trivial #

Patch Set 15 : Rebased #

Total comments: 4

Patch Set 16 : Nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -15 lines) Patch
M ui/gfx/geometry/rect_conversions.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -12 lines 0 comments Download
M ui/gfx/geometry/rect_unittest.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M ui/gfx/geometry/size_f.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +16 lines, -3 lines 0 comments Download
M ui/gfx/geometry/size_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +95 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 53 (25 generated)
Peter Mayo
Here is the change related to keeping empty rects empty on 'Enclosing'. One of the ...
3 years, 9 months ago (2017-03-17 16:13:10 UTC) #1
danakj
On 2017/03/17 16:13:10, Peter Mayo wrote: > Here is the change related to keeping empty ...
3 years, 9 months ago (2017-03-17 16:46:13 UTC) #2
Peter Mayo
https://codereview.chromium.org/2749513011/diff/1/ui/gfx/geometry/rect_conversions.cc File ui/gfx/geometry/rect_conversions.cc (right): https://codereview.chromium.org/2749513011/diff/1/ui/gfx/geometry/rect_conversions.cc#newcode17 ui/gfx/geometry/rect_conversions.cc:17: static const float kEmptyDimension = 0.1f; That is too ...
3 years, 9 months ago (2017-03-20 18:53:50 UTC) #5
Peter Mayo
On 2017/03/17 16:46:13, danakj wrote: > On 2017/03/17 16:13:10, Peter Mayo wrote: > > Here ...
3 years, 9 months ago (2017-03-20 18:57:46 UTC) #6
Peter Mayo
On 2017/03/17 16:46:13, danakj wrote: > On 2017/03/17 16:13:10, Peter Mayo wrote: > > Here ...
3 years, 9 months ago (2017-03-20 18:57:47 UTC) #7
danakj
https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h#newcode49 ui/gfx/geometry/size_f.h:49: bool HasHeight() const { return height() > kTrivial; } ...
3 years, 9 months ago (2017-03-21 16:16:36 UTC) #8
Peter Mayo
https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h#newcode49 ui/gfx/geometry/size_f.h:49: bool HasHeight() const { return height() > kTrivial; } ...
3 years, 9 months ago (2017-03-21 16:45:57 UTC) #9
danakj
https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h#newcode49 ui/gfx/geometry/size_f.h:49: bool HasHeight() const { return height() > kTrivial; } ...
3 years, 9 months ago (2017-03-21 17:42:05 UTC) #10
Peter Mayo
On 2017/03/21 17:42:05, danakj wrote: > https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h > File ui/gfx/geometry/size_f.h (right): > > https://codereview.chromium.org/2749513011/diff/120001/ui/gfx/geometry/size_f.h#newcode49 > ...
3 years, 9 months ago (2017-03-21 17:55:39 UTC) #11
danakj
On Tue, Mar 21, 2017 at 1:55 PM, <petermayo@chromium.org> wrote: > On 2017/03/21 17:42:05, danakj ...
3 years, 9 months ago (2017-03-21 18:22:15 UTC) #12
Peter Mayo
On 2017/03/21 18:22:15, danakj wrote: > On Tue, Mar 21, 2017 at 1:55 PM, <mailto:petermayo@chromium.org> ...
3 years, 9 months ago (2017-03-22 22:30:29 UTC) #13
danakj
Cool, so, I'd just prefer to not add APIs to gfx::SizeF that don't seem to ...
3 years, 9 months ago (2017-03-23 16:10:42 UTC) #14
Peter Mayo
Copied some previous comments into the in-line style for reviewing changes, and making sure they're ...
3 years, 9 months ago (2017-03-23 19:29:23 UTC) #18
Peter Mayo
https://codereview.chromium.org/2749513011/diff/180001/ui/gfx/geometry/size_unittest.cc File ui/gfx/geometry/size_unittest.cc (right): https://codereview.chromium.org/2749513011/diff/180001/ui/gfx/geometry/size_unittest.cc#newcode164 ui/gfx/geometry/size_unittest.cc:164: // The using the setter. Then
3 years, 9 months ago (2017-03-23 19:32:31 UTC) #21
danakj
https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/rect_conversions.cc File ui/gfx/geometry/rect_conversions.cc (right): https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/rect_conversions.cc#newcode20 ui/gfx/geometry/rect_conversions.cc:20: int width = rect.size().width() I think you can revert ...
3 years, 9 months ago (2017-03-23 20:12:06 UTC) #24
Peter Mayo
https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/rect_conversions.cc File ui/gfx/geometry/rect_conversions.cc (right): https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/rect_conversions.cc#newcode20 ui/gfx/geometry/rect_conversions.cc:20: int width = rect.size().width() On 2017/03/23 20:12:06, danakj wrote: ...
3 years, 9 months ago (2017-03-23 23:58:41 UTC) #27
Peter Mayo
https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/size_f.h#newcode34 ui/gfx/geometry/size_f.h:34: void set_width(float width) { width_ = width > kTrivial ...
3 years, 9 months ago (2017-03-24 01:17:45 UTC) #28
danakj
https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/rect_conversions.cc File ui/gfx/geometry/rect_conversions.cc (right): https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/rect_conversions.cc#newcode20 ui/gfx/geometry/rect_conversions.cc:20: int width = rect.size().width() On 2017/03/23 23:58:41, Peter Mayo ...
3 years, 9 months ago (2017-03-24 14:55:35 UTC) #33
Peter Mayo
https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/220001/ui/gfx/geometry/size_f.h#newcode17 ui/gfx/geometry/size_f.h:17: static constexpr float kTrivial = 8.f * std::numeric_limits<float>::epsilon(); On ...
3 years, 9 months ago (2017-03-24 21:05:41 UTC) #34
danakj
On Fri, Mar 24, 2017 at 5:05 PM, <petermayo@chromium.org> wrote: > > https://codereview.chromium.org/2749513011/diff/220001/ui/ > gfx/geometry/size_f.h ...
3 years, 9 months ago (2017-03-24 21:24:12 UTC) #35
Peter Mayo
On 2017/03/24 21:24:12, danakj wrote: > On Fri, Mar 24, 2017 at 5:05 PM, <mailto:petermayo@chromium.org> ...
3 years, 9 months ago (2017-03-27 16:12:33 UTC) #36
danakj
https://codereview.chromium.org/2749513011/diff/260001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/260001/ui/gfx/geometry/size_f.h#newcode63 ui/gfx/geometry/size_f.h:63: friend float SizeFPrivateMatch(); // Test access to the kTrivial ...
3 years, 8 months ago (2017-03-28 18:00:21 UTC) #41
Peter Mayo
Done. https://codereview.chromium.org/2749513011/diff/260001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/260001/ui/gfx/geometry/size_f.h#newcode63 ui/gfx/geometry/size_f.h:63: friend float SizeFPrivateMatch(); // Test access to the ...
3 years, 8 months ago (2017-03-28 20:11:21 UTC) #42
Peter Mayo
Rebased & ready to go?
3 years, 8 months ago (2017-03-29 18:48:56 UTC) #43
danakj
LGTM w/ nits https://codereview.chromium.org/2749513011/diff/320001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/320001/ui/gfx/geometry/size_f.h#newcode51 ui/gfx/geometry/size_f.h:51: bool IsEmpty() const { return !height_ ...
3 years, 8 months ago (2017-03-29 19:10:52 UTC) #46
Peter Mayo
https://codereview.chromium.org/2749513011/diff/320001/ui/gfx/geometry/size_f.h File ui/gfx/geometry/size_f.h (right): https://codereview.chromium.org/2749513011/diff/320001/ui/gfx/geometry/size_f.h#newcode51 ui/gfx/geometry/size_f.h:51: bool IsEmpty() const { return !height_ || !width_; } ...
3 years, 8 months ago (2017-03-29 20:14:48 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2749513011/340001
3 years, 8 months ago (2017-03-30 15:15:52 UTC) #50
commit-bot: I haz the power
3 years, 8 months ago (2017-03-30 16:50:06 UTC) #53
Message was sent while issue was closed.
Committed patchset #16 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/faa28efcb640abddbf5f80a75724...

Powered by Google App Engine
This is Rietveld 408576698