Update frame damage_region when previous_frame is false
Bug: chromium:409473386
Change-Id: I4b0a01711ed710b9187837af3610163665a62ba5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/398560
Commit-Queue: Palak Agarwal <agpalak@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45053}
diff --git a/modules/desktop_capture/win/wgc_capture_session.cc b/modules/desktop_capture/win/wgc_capture_session.cc
index f024349..dc744d4 100644
--- a/modules/desktop_capture/win/wgc_capture_session.cc
+++ b/modules/desktop_capture/win/wgc_capture_session.cc
@@ -583,6 +583,15 @@
// Mark resized frames as damaged.
damage_region_.SetRect(DesktopRect::MakeSize(current_frame->size()));
}
+ } else{
+ // Mark a `damage_region_` even if there is no previous frame. This
+ // condition does not create any increased overhead but is useful while
+ // using FullScreenWindowDetector, where it would create a new
+ // WgcCaptureSession(with no previous frame) for the slide show window but
+ // the DesktopCaptureDevice instance might have already received frames
+ // from the editor window's WgcCaptureSession which would have activated
+ // the zero-hertz mode.
+ damage_region_.SetRect(DesktopRect::MakeSize(current_frame->size()));
}
}