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

Issue 2845213002: DesktopRect::UnionWith() to extend current rect to cover the input rect (Closed)

Created:
3 years, 7 months ago by Hzj_jie
Modified:
3 years, 7 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, Jamie
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

DesktopRect::UnionWith() to extend current rect to cover the input rect The logic to calculate a smallest rectangle to cover two rectangles is duplicated in DxgiDuplicatorController, DxgiAdapterDuplicator and desktop_configuration.mm. Meanwhile the implementation in desktop_configuration.mm is not safe: if either rectangle is empty, it will extend current rectangle to cover (0, 0). So a function in DesktopRect to cover the requirement could be more efficient and safer. BUG=webrtc:7541 Review-Url: https://codereview.webrtc.org/2845213002 Cr-Commit-Position: refs/heads/master@{#18171} Committed: https://chromium.googlesource.com/external/webrtc/+/73c1234f6aee9ec75074348b8eb3d346f8b64049

Patch Set 1 #

Patch Set 2 : Rename JoinWith to UnionWith #

Total comments: 2

Patch Set 3 : Resolve review comments #

Total comments: 6

Patch Set 4 : Resolve review comments #

Patch Set 5 : Sync latest changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -35 lines) Patch
M webrtc/modules/desktop_capture/desktop_geometry.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/desktop_geometry.cc View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M webrtc/modules/desktop_capture/mac/desktop_configuration.mm View 1 2 chunks +2 lines, -13 lines 0 comments Download
M webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc View 1 1 chunk +1 line, -11 lines 0 comments Download
M webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.cc View 1 1 chunk +1 line, -11 lines 0 comments Download

Messages

Total messages: 62 (39 generated)
Hzj_jie
3 years, 7 months ago (2017-04-28 23:54:38 UTC) #7
jamiewalch
I think "Union" would be suitable a name for this. Technically, the union of two ...
3 years, 7 months ago (2017-04-29 00:44:22 UTC) #8
Hzj_jie
On 2017/04/29 00:44:22, jamiewalch wrote: > I think "Union" would be suitable a name for ...
3 years, 7 months ago (2017-05-02 18:49:55 UTC) #13
jamiewalch
lgtm https://codereview.webrtc.org/2845213002/diff/20001/webrtc/modules/desktop_capture/desktop_geometry.h File webrtc/modules/desktop_capture/desktop_geometry.h (right): https://codereview.webrtc.org/2845213002/diff/20001/webrtc/modules/desktop_capture/desktop_geometry.h#newcode142 webrtc/modules/desktop_capture/desktop_geometry.h:142: // replaces |this| with |rect|. This is not ...
3 years, 7 months ago (2017-05-02 22:18:12 UTC) #15
Hzj_jie
https://codereview.webrtc.org/2845213002/diff/20001/webrtc/modules/desktop_capture/desktop_geometry.h File webrtc/modules/desktop_capture/desktop_geometry.h (right): https://codereview.webrtc.org/2845213002/diff/20001/webrtc/modules/desktop_capture/desktop_geometry.h#newcode142 webrtc/modules/desktop_capture/desktop_geometry.h:142: // replaces |this| with |rect|. On 2017/05/02 22:18:11, jamiewalch ...
3 years, 7 months ago (2017-05-02 23:28:28 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2845213002/40001
3 years, 7 months ago (2017-05-02 23:28:39 UTC) #23
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the ...
3 years, 7 months ago (2017-05-02 23:28:42 UTC) #25
Hzj_jie
Sergey is OoO during these two weeks. Since this is a tiny and safe change, ...
3 years, 7 months ago (2017-05-02 23:33:03 UTC) #27
Hzj_jie
On 2017/05/02 23:33:03, Hzj_jie wrote: > Sergey is OoO during these two weeks. Since this ...
3 years, 7 months ago (2017-05-02 23:33:29 UTC) #28
Hzj_jie
On 2017/05/02 23:33:29, Hzj_jie wrote: > On 2017/05/02 23:33:03, Hzj_jie wrote: > > Sergey is ...
3 years, 7 months ago (2017-05-02 23:33:51 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2845213002/40001
3 years, 7 months ago (2017-05-02 23:34:07 UTC) #31
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the ...
3 years, 7 months ago (2017-05-02 23:34:10 UTC) #33
Hzj_jie
It looks like the "Add myself as reviewer" option box does not work as my ...
3 years, 7 months ago (2017-05-02 23:37:14 UTC) #35
jamiewalch
On 2017/05/02 23:37:14, Hzj_jie wrote: > It looks like the "Add myself as reviewer" option ...
3 years, 7 months ago (2017-05-02 23:39:08 UTC) #37
Sergey Ulanov
Please update the description - it still mentions JoinWith(). LGTM once my comments are addressed ...
3 years, 7 months ago (2017-05-16 19:53:00 UTC) #38
Hzj_jie
https://codereview.webrtc.org/2845213002/diff/40001/webrtc/modules/desktop_capture/desktop_geometry.cc File webrtc/modules/desktop_capture/desktop_geometry.cc (right): https://codereview.webrtc.org/2845213002/diff/40001/webrtc/modules/desktop_capture/desktop_geometry.cc#newcode42 webrtc/modules/desktop_capture/desktop_geometry.cc:42: left_ = rect.left(); On 2017/05/16 19:53:00, Sergey Ulanov wrote: ...
3 years, 7 months ago (2017-05-16 23:04:19 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2845213002/80001
3 years, 7 months ago (2017-05-16 23:47:39 UTC) #49
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/external/webrtc/+/73c1234f6aee9ec75074348b8eb3d346f8b64049
3 years, 7 months ago (2017-05-16 23:50:39 UTC) #52
Wez
BTW: nit about the CL description, for future reference: Short description is "Add a DesktopRect::UnionWith() ...
3 years, 7 months ago (2017-05-17 13:16:51 UTC) #53
Hzj_jie
Thank you Wiz for the feedback. I have updated the description according to your suggestion. ...
3 years, 7 months ago (2017-05-17 17:13:42 UTC) #56
Sergey Ulanov
On 2017/05/17 17:13:42, Hzj_jie wrote: > Thank you Wiz for the feedback. I have updated ...
3 years, 7 months ago (2017-05-17 17:27:35 UTC) #58
Hzj_jie
On 2017/05/17 17:27:35, Sergey Ulanov wrote: > On 2017/05/17 17:13:42, Hzj_jie wrote: > > Thank ...
3 years, 7 months ago (2017-05-17 17:35:34 UTC) #61
Do not use (sergeyu)
3 years, 7 months ago (2017-05-17 17:38:35 UTC) #62
Message was sent while issue was closed.
On 2017/05/17 17:35:34, Hzj_jie wrote:
> On 2017/05/17 17:27:35, Sergey Ulanov wrote:
> > On 2017/05/17 17:13:42, Hzj_jie wrote:
> > > Thank you Wiz for the feedback. I have updated the description according
to
> > your
> > > suggestion. Is it better?
> > 
> > Thank you. You could also make the summary line shorter (e.g. it could be
"Add
> a
> > DesktopRect::UnionWith()" for this CL).
> > There is no hard limit. This document says it should be below 50 characters:
> > https://chris.beams.io/posts/git-commit/  (linked from
> > https://www.chromium.org/developers/contributing-code). This may be too
> strict,
> > summaries in chromium are often longer. But it's best to keep it shorter
than 
> > description lines, i.e. 72 chars
> 
> I still prefer to keep a little bit detail, i.e. the functionality of the
newly
> added function. As Jamie and I discussed in the code review, typically
> Rectangle.UnionWith() should generate a DesktopRegion but not a DesktopRect.
> Without a little bit more description, it may be a little bit confusing.

Yes you should put these details in the CL description, but they don't need to
be in the summary line (i.e. the first line). It's almost never possible to put
all relevant details in one line and it's not what summary line is for.

Powered by Google App Engine
This is Rietveld 408576698