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

Issue 2908853002: desktopCapture: scale the cursor image according to screen scale factor on OSX (Closed)

Created:
3 years, 7 months ago by braveyao1
Modified:
3 years, 6 months ago
Reviewers:
Sergey Ulanov, erikchen
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, erikchen
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

desktopCapture: scale the cursor image according to screen scale factor on OSX Before 10.12, OSX may report 1X cursor on Retina screen. (See crbug.com/632995.) After 10.12, OSX may report 2X cursor on non-Retina screen. (See crbug.com/671436.) So scaling the cursor if the image size doesn't meet the expected size on either Retina or non-Retina screen. Also corrects the cursor caching and change detection, so we can only do scalingat cursor changing for better performance. As to screen capture on OSX, the captured frame already contains the current cursor. So the MouseCursorMonitorMac is not needed for ScreenCapture for performance purpose. BUG=671436 Review-Url: https://codereview.webrtc.org/2908853002 Cr-Commit-Position: refs/heads/master@{#18393} Committed: https://chromium.googlesource.com/external/webrtc/+/0d1e27f00fd6bf7aeae7cb19845b8cd1ed4a40c1

Patch Set 1 #

Total comments: 6

Patch Set 2 : correct the issue of memory management #

Total comments: 5

Patch Set 3 : address comments #

Total comments: 18

Patch Set 4 : address comments #

Total comments: 2

Patch Set 5 : run git cl format #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -32 lines) Patch
M webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm View 1 2 3 4 5 chunks +39 lines, -32 lines 0 comments Download

Messages

Total messages: 49 (33 generated)
braveyao1
Hi, sergeyu@, done the stuff discussed in offline thread. Please take a look.
3 years, 7 months ago (2017-05-26 23:04:34 UTC) #6
erikchen
https://codereview.webrtc.org/2908853002/diff/1/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/1/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode33 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:33: CGImageRef ResizeCGImage(CGImageRef image, int width, int height) { please ...
3 years, 7 months ago (2017-05-26 23:09:05 UTC) #8
braveyao1
Thanks erik@ for the suggestions and off-line talk. Unfortunately not all chromium methods are available ...
3 years, 6 months ago (2017-05-30 17:08:19 UTC) #9
erikchen
https://codereview.webrtc.org/2908853002/diff/1/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/1/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode44 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:44: CGColorSpaceRelease(colorspace); Please read through https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html and fix your CL ...
3 years, 6 months ago (2017-05-30 17:27:46 UTC) #10
braveyao1
Yes I found more discussion about the scaling method and corrected my cl accordingly. Sorry ...
3 years, 6 months ago (2017-05-30 21:34:07 UTC) #19
erikchen
https://codereview.webrtc.org/2908853002/diff/20001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/20001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode264 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:264: last_cursor_ = nsimage; You need to retain last_cursor_, and ...
3 years, 6 months ago (2017-05-30 22:34:31 UTC) #20
erikchen
https://codereview.webrtc.org/2908853002/diff/20001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/20001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode264 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:264: last_cursor_ = nsimage; On 2017/05/30 22:34:31, erikchen wrote: > ...
3 years, 6 months ago (2017-05-30 23:18:27 UTC) #21
braveyao1
Hi erikchen@, thanks so much for the help and all the documents shared. Always good ...
3 years, 6 months ago (2017-05-31 22:55:05 UTC) #26
erikchen
lgtm
3 years, 6 months ago (2017-05-31 23:54:08 UTC) #27
Do not use (sergeyu)
https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode37 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:37: CGBitmapContextCreate(NULL, s/NULL/nullptr/ https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode38 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:38: width, Please run 'git cl ...
3 years, 6 months ago (2017-06-01 00:22:00 UTC) #29
braveyao1
sergeyu@, thanks for the comments. All addressed/answered. PTAL. https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode37 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:37: CGBitmapContextCreate(NULL, ...
3 years, 6 months ago (2017-06-01 17:50:15 UTC) #34
Do not use (sergeyu)
https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm File webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm (right): https://codereview.webrtc.org/2908853002/diff/40001/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm#newcode38 webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm:38: width, On 2017/06/01 17:50:14, braveyao1 wrote: > On 2017/06/01 ...
3 years, 6 months ago (2017-06-01 18:08:08 UTC) #35
braveyao1
Lost in all the style guides... https://chromium.googlesource.com/chromium/src/+/master/styleguide/objective-c/objective-c.md says it should be 80 char. Anyway, ran ...
3 years, 6 months ago (2017-06-01 18:17:56 UTC) #38
Sergey Ulanov
lgtm
3 years, 6 months ago (2017-06-01 21:16:12 UTC) #41
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/2908853002/80001
3 years, 6 months ago (2017-06-01 21:25:06 UTC) #46
commit-bot: I haz the power
3 years, 6 months ago (2017-06-01 21:27:47 UTC) #49
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/external/webrtc/+/0d1e27f00fd6bf7aeae7cb198...

Powered by Google App Engine
This is Rietveld 408576698