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

Unified Diff: remoting/host/capturer_helper.cc

Issue 7622002: Revert 96327 - Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- remoting/host/capturer_helper.cc (revision 96327)
+++ remoting/host/capturer_helper.cc (working copy)
@@ -4,6 +4,9 @@
#include "remoting/host/capturer_helper.h"
+#include <algorithm>
+#include <iterator>
+
namespace remoting {
CapturerHelper::CapturerHelper() : size_most_recent_(0, 0) {
@@ -12,20 +15,24 @@
CapturerHelper::~CapturerHelper() {
}
-void CapturerHelper::ClearInvalidRegion() {
- base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
- invalid_region_.setEmpty();
+void CapturerHelper::ClearInvalidRects() {
+ base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
+ inval_rects_.clear();
}
-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::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::InvalidateScreen(const gfx::Size& size) {
- base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
- invalid_region_.op(SkIRect::MakeWH(size.width(), size.height()),
- SkRegion::kUnion_Op);
+ base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
+ inval_rects_.clear();
+ inval_rects_.insert(gfx::Rect(0, 0, size.width(), size.height()));
}
void CapturerHelper::InvalidateFullScreen() {
@@ -33,17 +40,17 @@
InvalidateScreen(size_most_recent_);
}
-// TODO: Is this actually required?
-// http://crbug.com/92346
bool CapturerHelper::IsCaptureFullScreen(const gfx::Size& size) {
- base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
- SkRegion fullScreenRegion(SkIRect::MakeWH(size.width(), size.height()));
- return fullScreenRegion == invalid_region_;
+ 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::SwapInvalidRegion(SkRegion* invalid_region) {
- base::AutoLock auto_invalid_region_lock(invalid_region_lock_);
- invalid_region->swap(invalid_region_);
+void CapturerHelper::SwapInvalidRects(InvalidRects& inval_rects) {
+ base::AutoLock auto_inval_rects_lock(inval_rects_lock_);
+ inval_rects.swap(inval_rects_);
}
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