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

Unified Diff: media/video/capture/screen/screen_capturer_mac.mm

Issue 12221103: Fix ScreenCapturerMac handling of secondary configurations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments. Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/screen/screen_capturer_mac.mm
diff --git a/media/video/capture/screen/screen_capturer_mac.mm b/media/video/capture/screen/screen_capturer_mac.mm
index 1baa0904cea6707df256dad5e386307016b18065..9b4cd7679773f61dc28f5a20db4ac1aa97856368 100644
--- a/media/video/capture/screen/screen_capturer_mac.mm
+++ b/media/video/capture/screen/screen_capturer_mac.mm
@@ -585,8 +585,7 @@ void ScreenCapturerMac::CgBlitPreLion(const ScreenCaptureFrame& buffer,
continue;
// Translate the region to be copied into display-relative coordinates.
- copy_region.translate(-desktop_config_.pixel_bounds.left(),
- -desktop_config_.pixel_bounds.top());
+ copy_region.translate(-display_bounds.left(), -display_bounds.top());
// Calculate where in the output buffer the display's origin is.
uint8* out_ptr = buffer.pixels() +
@@ -606,7 +605,7 @@ void ScreenCapturerMac::CgBlitPreLion(const ScreenCaptureFrame& buffer,
}
void ScreenCapturerMac::CgBlitPostLion(const ScreenCaptureFrame& buffer,
- const SkRegion& region) {
+ const SkRegion& region) {
const int buffer_height = buffer.dimensions().height();
// Copy the entire contents of the previous capture buffer, to capture over.
@@ -632,8 +631,7 @@ void ScreenCapturerMac::CgBlitPostLion(const ScreenCaptureFrame& buffer,
continue;
// Translate the region to be copied into display-relative coordinates.
- copy_region.translate(-desktop_config_.pixel_bounds.left(),
- -desktop_config_.pixel_bounds.top());
+ copy_region.translate(-display_bounds.left(), -display_bounds.top());
// Create an image containing a snapshot of the display.
base::mac::ScopedCFTypeRef<CGImageRef> image(
@@ -677,7 +675,8 @@ void ScreenCapturerMac::ScreenConfigurationChanged() {
helper_.ClearInvalidRegion();
// Refresh the cached desktop configuration.
- desktop_config_ = MacDesktopConfiguration::GetCurrent();
+ desktop_config_ = MacDesktopConfiguration::GetCurrent(
+ MacDesktopConfiguration::TopLeftOrigin);
// Re-mark the entire desktop as dirty.
helper_.InvalidateScreen(

Powered by Google App Engine
This is Rietveld 408576698