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

Unified Diff: remoting/host/capturer.cc

Issue 3013015: Initial pass at integrating Differ into the chromoting host code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « remoting/host/capturer.h ('k') | remoting/host/capturer_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capturer.cc
===================================================================
--- remoting/host/capturer.cc (revision 55264)
+++ remoting/host/capturer.cc (working copy)
@@ -4,6 +4,8 @@
#include "remoting/host/capturer.h"
+#include <algorithm>
+
namespace remoting {
Capturer::Capturer()
@@ -17,9 +19,34 @@
Capturer::~Capturer() {
}
+void Capturer::ClearInvalidRects() {
+ AutoLock auto_inval_rects_lock(inval_rects_lock_);
+ inval_rects_.clear();
+}
+
+void Capturer::InvalidateRects(const InvalidRects& inval_rects) {
+ InvalidRects temp_rects;
+ std::set_union(inval_rects_.begin(), inval_rects_.end(),
+ inval_rects.begin(), inval_rects.end(),
+ std::inserter(temp_rects, temp_rects.begin()));
+ {
+ AutoLock auto_inval_rects_lock(inval_rects_lock_);
+ inval_rects_.swap(temp_rects);
+ }
+}
+
+void Capturer::InvalidateFullScreen() {
+ AutoLock auto_inval_rects_lock(inval_rects_lock_);
+ inval_rects_.clear();
+ inval_rects_.insert(gfx::Rect(0, 0, width_, height_));
+}
+
void Capturer::CaptureInvalidRects(CaptureCompletedCallback* callback) {
+ // Calculate which rects need to be captured.
+ CalculateInvalidRects();
+
// Braced to scope the lock.
- RectVector local_rects;
+ InvalidRects local_rects;
{
AutoLock auto_inval_rects_lock(inval_rects_lock_);
local_rects = inval_rects_;
@@ -29,20 +56,6 @@
CaptureRects(local_rects, callback);
}
-void Capturer::InvalidateRects(const RectVector& inval_rects) {
- AutoLock auto_inval_rects_lock(inval_rects_lock_);
- inval_rects_.insert(inval_rects_.end(),
- inval_rects.begin(),
- inval_rects.end());
-}
-
-void Capturer::InvalidateFullScreen() {
- RectVector rects;
- rects.push_back(gfx::Rect(0, 0, width_, height_));
-
- InvalidateRects(rects);
-}
-
void Capturer::FinishCapture(scoped_refptr<CaptureData> data,
CaptureCompletedCallback* callback) {
// Select the next buffer to be the current buffer.
« no previous file with comments | « remoting/host/capturer.h ('k') | remoting/host/capturer_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698