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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_mac.mm

Issue 2404983002: Use kCGDisplayStreamUpdateDirtyRects. (Closed)
Patch Set: Minor fix. Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/screen_capturer_mac.mm
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac.mm b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
index 316aa3dbe6a04da78bad6a39ea21f7baa22638d8..3de253707cb9b2b557ee9fad45e7636697c92951 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_mac.mm
+++ b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
@@ -287,10 +287,6 @@ class ScreenCapturerMac : public ScreenCapturer {
void UnregisterRefreshAndMoveHandlers();
void ScreenRefresh(CGRectCount count, const CGRect *rect_array);
- void ScreenUpdateMove(CGFloat delta_x,
- CGFloat delta_y,
- size_t count,
- const CGRect* rect_array);
void ScreenRefreshCallback(CGRectCount count, const CGRect* rect_array);
void ReleaseBuffers();
@@ -945,25 +941,8 @@ bool ScreenCapturerMac::RegisterRefreshAndMoveHandlers() {
size_t count = 0;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
-// TODO(erikchen): Use kCGDisplayStreamUpdateDirtyRects.
const CGRect* rects = CGDisplayStreamUpdateGetRects(
- updateRef, kCGDisplayStreamUpdateMovedRects, &count);
-#pragma clang diagnostic pop
- if (count != 0) {
- CGFloat dx = 0;
- CGFloat dy = 0;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunguarded-availability"
- CGDisplayStreamUpdateGetMovedRectsDelta(updateRef, &dx, &dy);
-#pragma clang diagnostic pop
- ScreenUpdateMove(dx, dy, count, rects);
- }
-
- count = 0;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunguarded-availability"
- rects = CGDisplayStreamUpdateGetRects(
- updateRef, kCGDisplayStreamUpdateRefreshedRects, &count);
+ updateRef, kCGDisplayStreamUpdateDirtyRects, &count);
#pragma clang diagnostic pop
if (count != 0) {
// According to CGDisplayStream.h, it's safe to call
@@ -1011,20 +990,6 @@ void ScreenCapturerMac::ScreenRefresh(CGRectCount count,
helper_.InvalidateRegion(region);
}
-void ScreenCapturerMac::ScreenUpdateMove(CGFloat delta_x,
- CGFloat delta_y,
- size_t count,
- const CGRect* rect_array) {
- // Translate |rect_array| to identify the move's destination.
- CGRect refresh_rects[count];
- for (CGRectCount i = 0; i < count; ++i) {
- refresh_rects[i] = CGRectOffset(rect_array[i], delta_x, delta_y);
- }
-
- // Currently we just treat move events the same as refreshes.
- ScreenRefresh(count, refresh_rects);
-}
-
void ScreenCapturerMac::ScreenRefreshCallback(CGRectCount count,
const CGRect* rect_array) {
if (screen_pixel_bounds_.is_empty())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698