| 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.
|
|
|