Fix a screen capture issue on retina macOS devices.

The CGDisplayStream API returns rects in physical pixel coordinates, not
Density-Independent Pixel coordinates. The code was incorrectly re-applying the
dip_to_pixel scaling.

BUG=chromium:675490

Review-Url: https://codereview.webrtc.org/2588973002
Cr-Commit-Position: refs/heads/master@{#15720}
This commit is contained in:
erikchen 2016-12-20 17:00:22 -08:00 committed by Commit bot
parent 14a588ab0a
commit 494dff4c07

View File

@ -991,8 +991,10 @@ void ScreenCapturerMac::ScreenRefresh(CGRectCount count,
DesktopRegion region;
for (CGRectCount i = 0; i < count; ++i) {
// Convert from Density-Independent Pixel to physical pixel coordinates.
DesktopRect rect = ScaleAndRoundCGRect(rect_array[i], dip_to_pixel_scale_);
// All rects are already in physical pixel coordinates.
DesktopRect rect = DesktopRect::MakeXYWH(
rect_array[i].origin.x, rect_array[i].origin.y,
rect_array[i].size.width, rect_array[i].size.height);
region.AddRect(rect);
}