| Index: remoting/host/capturer_helper.cc
|
| diff --git a/remoting/host/capturer_helper.cc b/remoting/host/capturer_helper.cc
|
| index eba7c1260821c6ff0e0b5d7ba38f0c0492780a5c..12e7d86782938fa6b953c9c2648444e1a7fdd8ef 100644
|
| --- a/remoting/host/capturer_helper.cc
|
| +++ b/remoting/host/capturer_helper.cc
|
| @@ -4,9 +4,6 @@
|
|
|
| #include "remoting/host/capturer_helper.h"
|
|
|
| -#include <algorithm>
|
| -#include <iterator>
|
| -
|
| namespace remoting {
|
|
|
| CapturerHelper::CapturerHelper() : size_most_recent_(0, 0) {
|
| @@ -15,24 +12,20 @@ CapturerHelper::CapturerHelper() : size_most_recent_(0, 0) {
|
| CapturerHelper::~CapturerHelper() {
|
| }
|
|
|
| -void CapturerHelper::ClearInvalidRects() {
|
| - base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
|
| - inval_rects_.clear();
|
| +void CapturerHelper::ClearInvalidRegion() {
|
| + base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
|
| + invalid_region_.setEmpty();
|
| }
|
|
|
| -void CapturerHelper::InvalidateRects(const InvalidRects& inval_rects) {
|
| - base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
|
| - 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()));
|
| - inval_rects_.swap(temp_rects);
|
| +void CapturerHelper::InvalidateRegion(const SkRegion& invalid_region) {
|
| + base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
|
| + invalid_region_.op(invalid_region, SkRegion::kUnion_Op);
|
| }
|
|
|
| void CapturerHelper::InvalidateScreen(const gfx::Size& size) {
|
| - base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
|
| - inval_rects_.clear();
|
| - inval_rects_.insert(gfx::Rect(0, 0, size.width(), size.height()));
|
| + base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
|
| + invalid_region_.op(SkIRect::MakeWH(size.width(), size.height()),
|
| + SkRegion::kUnion_Op);
|
| }
|
|
|
| void CapturerHelper::InvalidateFullScreen() {
|
| @@ -40,17 +33,9 @@ void CapturerHelper::InvalidateFullScreen() {
|
| InvalidateScreen(size_most_recent_);
|
| }
|
|
|
| -bool CapturerHelper::IsCaptureFullScreen(const gfx::Size& size) {
|
| - base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
|
| - return inval_rects_.size() == 1u &&
|
| - inval_rects_.begin()->x() == 0 && inval_rects_.begin()->y() == 0 &&
|
| - inval_rects_.begin()->width() == size.width() &&
|
| - inval_rects_.begin()->height() == size.height();
|
| -}
|
| -
|
| -void CapturerHelper::SwapInvalidRects(InvalidRects& inval_rects) {
|
| - base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
|
| - inval_rects.swap(inval_rects_);
|
| +void CapturerHelper::SwapInvalidRegion(SkRegion* invalid_region) {
|
| + base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
|
| + invalid_region->swap(invalid_region_);
|
| }
|
|
|
| const gfx::Size& CapturerHelper::size_most_recent() const {
|
|
|