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 <alcooper@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39834}
This commit is contained in:
henrika 2023-04-12 22:58:10 +02:00 committed by WebRTC LUCI CQ
parent 79ea89ee74
commit e02d50931b

View File

@ -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_);
}