summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-21 23:15:04 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-21 23:15:04 +0000
commitfa8af9afe43e707fa05f808d2de95e7b71f48809 (patch)
tree00c8e8d487c94e1667dfe921ad4b4830fec02651
parentf39c99ae859a26cf21776310ed430e6d7f9af594 (diff)
downloadchromium_src-fa8af9afe43e707fa05f808d2de95e7b71f48809.zip
chromium_src-fa8af9afe43e707fa05f808d2de95e7b71f48809.tar.gz
chromium_src-fa8af9afe43e707fa05f808d2de95e7b71f48809.tar.bz2
Fix Chromoting Mac to work with multiple monitors.
BUG=96742 TEST=See bug Review URL: http://codereview.chromium.org/7982037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102190 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/host/capturer_mac.cc45
1 files changed, 24 insertions, 21 deletions
diff --git a/remoting/host/capturer_mac.cc b/remoting/host/capturer_mac.cc
index ae92847..8b91c45 100644
--- a/remoting/host/capturer_mac.cc
+++ b/remoting/host/capturer_mac.cc
@@ -377,13 +377,14 @@ void CapturerMac::GlBlitFast(const VideoFrameBuffer& buffer,
const int y_offset = (buffer_height - 1) * buffer.bytes_per_row();
for(SkRegion::Iterator i(last_invalid_region_); !i.done(); i.next()) {
SkIRect copy_rect = i.rect();
- copy_rect.intersect(clip_rect);
- CopyRect(last_buffer_ + y_offset,
- -buffer.bytes_per_row(),
- buffer.ptr() + y_offset,
- -buffer.bytes_per_row(),
- 4, // Bytes for pixel for RGBA.
- copy_rect);
+ if (copy_rect.intersect(clip_rect)) {
+ CopyRect(last_buffer_ + y_offset,
+ -buffer.bytes_per_row(),
+ buffer.ptr() + y_offset,
+ -buffer.bytes_per_row(),
+ 4, // Bytes for pixel for RGBA.
+ copy_rect);
+ }
}
}
last_buffer_ = buffer.ptr();
@@ -404,13 +405,14 @@ void CapturerMac::GlBlitFast(const VideoFrameBuffer& buffer,
const int y_offset = (buffer_height - 1) * buffer.bytes_per_row();
for(SkRegion::Iterator i(region); !i.done(); i.next()) {
SkIRect copy_rect = i.rect();
- copy_rect.intersect(clip_rect);
- CopyRect(ptr + y_offset,
- -buffer.bytes_per_row(),
- buffer.ptr() + y_offset,
- -buffer.bytes_per_row(),
- 4, // Bytes for pixel for RGBA.
- copy_rect);
+ if (copy_rect.intersect(clip_rect)) {
+ CopyRect(ptr + y_offset,
+ -buffer.bytes_per_row(),
+ buffer.ptr() + y_offset,
+ -buffer.bytes_per_row(),
+ 4, // Bytes for pixel for RGBA.
+ copy_rect);
+ }
}
}
if (!glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB)) {
@@ -460,13 +462,14 @@ void CapturerMac::CgBlit(const VideoFrameBuffer& buffer,
// http://crbug.com/92354
for(SkRegion::Iterator i(region); !i.done(); i.next()) {
SkIRect copy_rect = i.rect();
- copy_rect.intersect(clip_rect);
- CopyRect(display_base_address,
- src_bytes_per_row,
- buffer.ptr(),
- buffer.bytes_per_row(),
- src_bytes_per_pixel,
- copy_rect);
+ if (copy_rect.intersect(clip_rect)) {
+ CopyRect(display_base_address,
+ src_bytes_per_row,
+ buffer.ptr(),
+ buffer.bytes_per_row(),
+ src_bytes_per_pixel,
+ copy_rect);
+ }
}
}