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

Side by Side Diff: webrtc/modules/desktop_capture/screen_capturer_mac.mm

Issue 2588973002: Fix a screen capture issue on retina macOS devices. (Closed)
Patch Set: Comments from sergeyu. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 display_stream_manager_->UnregisterActiveStreams(); 984 display_stream_manager_->UnregisterActiveStreams();
985 } 985 }
986 986
987 void ScreenCapturerMac::ScreenRefresh(CGRectCount count, 987 void ScreenCapturerMac::ScreenRefresh(CGRectCount count,
988 const CGRect* rect_array) { 988 const CGRect* rect_array) {
989 if (screen_pixel_bounds_.is_empty()) 989 if (screen_pixel_bounds_.is_empty())
990 ScreenConfigurationChanged(); 990 ScreenConfigurationChanged();
991 991
992 DesktopRegion region; 992 DesktopRegion region;
993 for (CGRectCount i = 0; i < count; ++i) { 993 for (CGRectCount i = 0; i < count; ++i) {
994 // Convert from Density-Independent Pixel to physical pixel coordinates. 994 // All rects are already in physical pixel coordinates.
995 DesktopRect rect = ScaleAndRoundCGRect(rect_array[i], dip_to_pixel_scale_); 995 DesktopRect rect = DesktopRect::MakeXYWH(
996 rect_array[i].origin.x, rect_array[i].origin.y,
997 rect_array[i].size.width, rect_array[i].size.height);
996 region.AddRect(rect); 998 region.AddRect(rect);
997 } 999 }
998 1000
999 helper_.InvalidateRegion(region); 1001 helper_.InvalidateRegion(region);
1000 } 1002 }
1001 1003
1002 std::unique_ptr<DesktopFrame> ScreenCapturerMac::CreateFrame() { 1004 std::unique_ptr<DesktopFrame> ScreenCapturerMac::CreateFrame() {
1003 std::unique_ptr<DesktopFrame> frame( 1005 std::unique_ptr<DesktopFrame> frame(
1004 new BasicDesktopFrame(screen_pixel_bounds_.size())); 1006 new BasicDesktopFrame(screen_pixel_bounds_.size()));
1005 frame->set_dpi(DesktopVector(kStandardDPI * dip_to_pixel_scale_, 1007 frame->set_dpi(DesktopVector(kStandardDPI * dip_to_pixel_scale_,
(...skipping 12 matching lines...) Expand all
1018 std::unique_ptr<ScreenCapturerMac> capturer( 1020 std::unique_ptr<ScreenCapturerMac> capturer(
1019 new ScreenCapturerMac(options.configuration_monitor())); 1021 new ScreenCapturerMac(options.configuration_monitor()));
1020 if (!capturer.get()->Init()) { 1022 if (!capturer.get()->Init()) {
1021 return nullptr; 1023 return nullptr;
1022 } 1024 }
1023 1025
1024 return capturer; 1026 return capturer;
1025 } 1027 }
1026 1028
1027 } // namespace webrtc 1029 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698