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

Unified Diff: remoting/host/capturer_helper.cc

Issue 7491070: Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up shared lib compile Created 9 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_helper.h ('k') | remoting/host/capturer_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « remoting/host/capturer_helper.h ('k') | remoting/host/capturer_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698