summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/capturer.cc3
-rw-r--r--remoting/host/capturer.h1
-rw-r--r--remoting/host/capturer_linux.cc10
3 files changed, 11 insertions, 3 deletions
diff --git a/remoting/host/capturer.cc b/remoting/host/capturer.cc
index 0dd09ab..fe9cb30 100644
--- a/remoting/host/capturer.cc
+++ b/remoting/host/capturer.cc
@@ -49,7 +49,8 @@ void Capturer::InvalidateFullScreen(int width, int height) {
}
void Capturer::InvalidateFullScreen() {
- InvalidateFullScreen(width_most_recent_, height_most_recent_);
+ if (width_most_recent_ && height_most_recent_)
+ InvalidateFullScreen(width_most_recent_, height_most_recent_);
}
void Capturer::CaptureInvalidRects(CaptureCompletedCallback* callback) {
diff --git a/remoting/host/capturer.h b/remoting/host/capturer.h
index a91dcd7..8c4216e 100644
--- a/remoting/host/capturer.h
+++ b/remoting/host/capturer.h
@@ -62,6 +62,7 @@ class Capturer {
void InvalidateRects(const InvalidRects& inval_rects);
// Invalidate the entire screen, of a given size.
+ // TODO(hclam): No overload function!
void InvalidateFullScreen(int width, int height);
// Invalidate the entire screen, using the size of the most recently
diff --git a/remoting/host/capturer_linux.cc b/remoting/host/capturer_linux.cc
index 408eda0..d37f0ab 100644
--- a/remoting/host/capturer_linux.cc
+++ b/remoting/host/capturer_linux.cc
@@ -218,8 +218,13 @@ void CapturerLinuxPimpl::CalculateInvalidRects() {
XDamageNotifyEvent *event = reinterpret_cast<XDamageNotifyEvent*>(&e);
gfx::Rect damage_rect(event->area.x, event->area.y, event->area.width,
event->area.height);
+
+ // TODO(hclam): Perform more checks on the rect.
+ if (damage_rect.width() <= 0 && damage_rect.height() <= 0)
+ continue;
+
invalid_rects.insert(damage_rect);
- VLOG(3) << "Damage receved for rect at ("
+ VLOG(3) << "Damage received for rect at ("
<< damage_rect.x() << "," << damage_rect.y() << ") size ("
<< damage_rect.width() << "," << damage_rect.height() << ")";
}
@@ -229,7 +234,8 @@ void CapturerLinuxPimpl::CalculateInvalidRects() {
}
if (capture_fullscreen_) {
- capturer_->InvalidateFullScreen();
+ // TODO(hclam): Check the new dimension again.
+ capturer_->InvalidateFullScreen(width_, height_);
capture_fullscreen_ = false;
} else {
capturer_->InvalidateRects(invalid_rects);