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

Unified Diff: remoting/host/capturer_mac.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_mac.h ('k') | remoting/host/capturer_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capturer_mac.cc
===================================================================
--- remoting/host/capturer_mac.cc (revision 55264)
+++ remoting/host/capturer_mac.cc (working copy)
@@ -71,11 +71,17 @@
CGLSetCurrentContext(cgl_context_);
}
-void CapturerMac::CaptureRects(const RectVector& rects,
+void CapturerMac::CalculateInvalidRects() {
+ // Since the Mac gets its list of invalid rects via calls to InvalidateRect(),
+ // this step only needs to perform post-processing optimizations on the rect
+ // list (if needed).
+}
+
+void CapturerMac::CaptureRects(const InvalidRects& rects,
CaptureCompletedCallback* callback) {
// TODO(dmaclach): something smarter here in the future.
gfx::Rect dirtyRect;
- for (RectVector::const_iterator i = rects.begin(); i < rects.end(); ++i) {
+ for (InvalidRects::const_iterator i = rects.begin(); i != rects.end(); ++i) {
dirtyRect = dirtyRect.Union(*i);
}
@@ -101,32 +107,31 @@
width(),
height(),
pixel_format()));
- data->mutable_dirty_rects().assign(1, dirtyRect);
+ data->mutable_dirty_rects().clear();
+ data->mutable_dirty_rects().insert(dirtyRect);
FinishCapture(data, callback);
}
-
void CapturerMac::ScreenRefresh(CGRectCount count, const CGRect *rect_array) {
- RectVector rects;
+ InvalidRects rects;
for (CGRectCount i = 0; i < count; ++i) {
CGRect rect = rect_array[i];
rect.origin.y = height() - rect.size.height;
- rects.push_back(gfx::Rect(rect));
+ rects.insert(gfx::Rect(rect));
}
InvalidateRects(rects);
-
}
void CapturerMac::ScreenUpdateMove(CGScreenUpdateMoveDelta delta,
size_t count,
const CGRect *rect_array) {
- RectVector rects;
+ InvalidRects rects;
for (CGRectCount i = 0; i < count; ++i) {
CGRect rect = rect_array[i];
rect.origin.y = height() - rect.size.height;
- rects.push_back(gfx::Rect(rect));
+ rects.insert(gfx::Rect(rect));
rect = CGRectOffset(rect, delta.dX, delta.dY);
- rects.push_back(gfx::Rect(rect));
+ rects.insert(gfx::Rect(rect));
}
InvalidateRects(rects);
}
« no previous file with comments | « remoting/host/capturer_mac.h ('k') | remoting/host/capturer_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698