From e02d50931bdfa3b0cf8e4283d4cd22542bddf470 Mon Sep 17 00:00:00 2001 From: henrika Date: Wed, 12 Apr 2023 22:58:10 +0200 Subject: [PATCH] Adds temporary verbose logging to track cursor flickering (WebRTC) The idea is to land this in Canary and ask for feedback from users who can reproduce the issue, solve the issue and then revert this CL. Example: https://paste.googleplex.com/6080504230051840 Bug: chromium:1421656 Change-Id: Ic214dc341a322470970abeca1794493f45b93843 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301080 Reviewed-by: Alexander Cooper Commit-Queue: Alexander Cooper Commit-Queue: Henrik Andreassson Cr-Commit-Position: refs/heads/main@{#39834} --- .../desktop_capture/desktop_and_cursor_composer.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/desktop_capture/desktop_and_cursor_composer.cc b/modules/desktop_capture/desktop_and_cursor_composer.cc index 988d1740d3..7e436382df 100644 --- a/modules/desktop_capture/desktop_and_cursor_composer.cc +++ b/modules/desktop_capture/desktop_and_cursor_composer.cc @@ -21,6 +21,7 @@ #include "modules/desktop_capture/mouse_cursor.h" #include "modules/desktop_capture/mouse_cursor_monitor.h" #include "rtc_base/checks.h" +#include "rtc_base/logging.h" namespace webrtc { @@ -104,6 +105,11 @@ DesktopFrameWithCursor::DesktopFrameWithCursor( cursor_rect_.IntersectWith(DesktopRect::MakeSize(size())); if (!previous_cursor_rect.equals(cursor_rect_)) { + RTC_LOG(LS_VERBOSE) << "[MOUSE] cursors moved => cursor_rect=(" + << cursor_rect_.top_left().x() << "," + << cursor_rect_.top_left().y() << ") (" + << cursor_rect_.size().width() << "x" + << cursor_rect_.size().height() << ")"; mutable_updated_region()->AddRect(cursor_rect_); // TODO(crbug:1323241) Update this code to properly handle the case where // |previous_cursor_rect| is outside of the boundaries of |frame|. @@ -112,6 +118,11 @@ DesktopFrameWithCursor::DesktopFrameWithCursor( // we're running on. mutable_updated_region()->AddRect(previous_cursor_rect); } else if (cursor_changed) { + RTC_LOG(LS_VERBOSE) << "[MOUSE] cursor changed => cursor_rect=(" + << cursor_rect_.top_left().x() << "," + << cursor_rect_.top_left().y() << ") (" + << cursor_rect_.size().width() << "x" + << cursor_rect_.size().height() << ")"; mutable_updated_region()->AddRect(cursor_rect_); }