Commit 2c33a82e authored by eseckler's avatar eseckler Committed by Commit bot

Save latency info for skipped frames with the wrong size.

We observed that if a screenshot is captured while simultaneously the frame
is resized, it is possible that the screenshot is lost. This is because the latency
info (which identifies a CompositorFrame as the screenshot's frame) is sent
from the renderer within a wrongly sized CompositorFrame, which is then
skipped by DelegatedFrameHost.

For situations with an active resize lock, the latency info attached to dropped
frames is saved by the DFH and re-attached to the first frame that is not
dropped. However, this does not happen if the frame is dropped further down
the line, because it is not of the desired size of the RWHV.

This patch also saves the latency info for such wrongly sized frames in DFH,
until a correctly sized frame is submitted.

BUG=637066

Review-Url: https://codereview.chromium.org/2248183003
Cr-Commit-Position: refs/heads/master@{#414372}
parent e2322779
...@@ -492,14 +492,19 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t output_surface_id, ...@@ -492,14 +492,19 @@ void DelegatedFrameHost::SwapDelegatedFrame(uint32_t output_surface_id,
current_scale_factor_ = frame_device_scale_factor; current_scale_factor_ = frame_device_scale_factor;
} }
frame.metadata.latency_info.insert(frame.metadata.latency_info.end(),
skipped_latency_info_list_.begin(),
skipped_latency_info_list_.end());
skipped_latency_info_list_.clear();
gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP();
if (desired_size != frame_size_in_dip && !desired_size.IsEmpty()) if (desired_size != frame_size_in_dip && !desired_size.IsEmpty()) {
skip_frame = true; skip_frame = true;
skipped_latency_info_list_.insert(skipped_latency_info_list_.end(),
frame.metadata.latency_info.begin(),
frame.metadata.latency_info.end());
frame.metadata.latency_info.clear();
} else {
frame.metadata.latency_info.insert(frame.metadata.latency_info.end(),
skipped_latency_info_list_.begin(),
skipped_latency_info_list_.end());
skipped_latency_info_list_.clear();
}
cc::SurfaceFactory::DrawCallback ack_callback; cc::SurfaceFactory::DrawCallback ack_callback;
if (compositor_ && !skip_frame) { if (compositor_ && !skip_frame) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment