desktopCapture: cursor bitmap too small when sharing a retina display
Reported by
thembr...@gmail.com,
Jul 31 2016
|
|||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; CrOS armv7l 8530.30.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.29 Safari/537.36 Steps to reproduce the problem: 1. On Mac OS with a retina display, use desktopCapture API (for example use Google Cast -> cast desktop or Google Hangout -> share screen) 2. Take a look at cursor size in shared desktop stream What is the expected behavior? Mouse cursor should have regular size What went wrong? Mouse cursor is very tiny and barely visible. Did this work before? N/A Chrome version: 51.0.2704.103 Channel: n/a OS Version: El Capitan Flash Version: Shockwave Flash 22.0 r0
,
Aug 4 2016
Test Engineering, can you please confirm this? I don't have any Retina hardware available locally.
,
Aug 5 2016
Able to reproduce the issue on the latest canary(54.0.2820.0) on MacBook Pro Retina Version: 10.10.5. Cursor was sized very small when shared the screen from the Retina display and observed the shared screen on Windows system. On older chrome versions:30.0.1549.0, 40.0.2172.0 was unable to share the screen and the issue is reproducible on 47.0.2526.58. Marking this Untriaged and triaging as Non-regression issue for more inputs.
,
Aug 19 2016
,
Aug 22 2016
,
Aug 22 2016
,
Aug 23 2016
sergeyu@: can you have a look or reassign this?
,
Aug 31 2016
sergeyu@ ping
,
Aug 31 2016
The problem is that MouseCursorMonitorMac takes only low-res representation of the cursor. It needs to be fixed to grab hi-res version of the image.
,
Sep 1 2016
qiangchen@ is this something you will have time to do for M54? If not please update the milestone accordingly.
,
Sep 1 2016
I am not familiar with that part of code. Move to M55, as M54 has already been branched.
,
Sep 16 2016
Update: I've verified that the [Cursor currentSystemCursor] returns a cursor with only non-retina image. (Because it has only one representation and its physical size == logical size) Thus the only thing we can do is to scale up the cursor image we can get. But as you know a scaled-up image would not look as clear as an HD image. sergeyu@: what is your opinion?
,
Sep 17 2016
FYI--isheriff@ originally implemented this feature, so he's probably more familiar with this than sergeyu@. To answer the questions at-hand: Maybe there are alternate Cocoa APIs to get the high-res system cursor? Try googling for it! :)
,
Sep 19 2016
ping isheriff@ for more ideas.
,
Sep 19 2016
The particular snippet of capturing cursor actually comes from MouseCursorMonitorMac which was originally written by sergeyu@ I am not sure about what the right API is to get high res version of the system cursor (looking at NSCursor API does not seem to provide any info) thakis@, any pointers on this ?
,
Sep 19 2016
[NSCursor image] hands you an NSImage, which will have a low-res and a high-res bitmap attached to it I think. ...oh, qiangchen says they checked that. Maybe it's a vector representation, what happens if you NSLog(@"%@", cursorImg) with the cursor image? If you draw it to a 2x offscreen graphics context, is it drawn sharply?
,
Sep 19 2016
Re#16: Yes. I found there is only one representation in [NSCursor image]. The attachment is the snapshot of screen capture with scaled cursor.
,
Sep 19 2016
Try changing https://cs.chromium.org/chromium/src/third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm?rcl=0&l=242 to pass in a rect that's 2x in size.width and size.height and see if that makes things sharp.
,
Sep 19 2016
Tried. That parameter has no effect at all. It is not used to scale the image, but is used to select a representation with similar size. Now that [NSCursor currentSystemCursor] has only one representation, the parameter does not play a role. In #16, the snapshot contains already scaled cursor. Does it look OK? I use libyuv::ARGBScale to do the scaling.
,
Sep 19 2016
If the one representation is a vector representation, it'll look good rasterized at any size. So that there's only one doesn't necessarily matter. Instead of scaling the bitmap, I'd try to get a bitmap at the right size from cocoa in the first place.
,
Sep 19 2016
Update: You are right. Actually, we just need to paint the cursor onto another NSImage using current graphics context, and the result will be retina. Then we patch the retina cursor on to the frame instead of using the raw cursor.
,
Sep 22 2016
,
Jan 26 2017
Can someone please tell me in which version of Chrome has this been released? I'm trying to apply patch to Chrome 54 (using Electron) and modified files do not exist and cannot even find them. I need to build Electron based on Chrome 54 with this fix. Thanks!
,
May 23 2017
As a drive by observer, I see the change was committed to the webrtc repo with the following change. Hopefully you have already discovered this yourself! commit 6f79d840ba238b8122d7ab354f54a444bb22a4ca Author: qiangchen <qiangchen@chromium.org> Date: Wed Sep 21 16:44:55 2016 -0700 Bug Fix: Mac Retina Screen Capture's Mouse Cursor Too Small On retina display, when we do screen capture, the mouse cursor looks too small. The reason is that we painted the cursor with low resolution on to the frame directly. This CL fixes the bug. BUG= 632995 Review-Url: https://codereview.webrtc.org/2350743003 Cr-Commit-Position: refs/heads/master@{#14340} |
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by tkonch...@chromium.org
, Aug 4 2016