mac: Fix screen capture on secondary displays.
The old API CGScreenRegisterMoveCallback returned update rects in desktop
coordinates [secondary display has an origin != 0,0]. The new CGDisplayStream
API returns update rects in display coordinates [origin == 0,0]. Translating the
update rect based on the display's position on the desktop is now incorrect.
BUG=webrtc:6702
Review-Url: https://codereview.webrtc.org/2496413002
Cr-Commit-Position: refs/heads/master@{#15092}
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac.mm b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
index 34f5087..f11b36d 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_mac.mm
+++ b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
@@ -990,13 +990,9 @@
ScreenConfigurationChanged();
DesktopRegion region;
- DesktopVector translate_vector =
- DesktopVector().subtract(screen_pixel_bounds_.top_left());
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_);
- // Translate from local desktop to capturer framebuffer coordinates.
- rect.Translate(translate_vector);
region.AddRect(rect);
}