Commit 5868bf0a authored by kylechar's avatar kylechar Committed by Commit Bot

viz: Fix frame eviction logic with --enable-viz.

The FrameEvictionManager expects a response from
DelegatedFrameHost::EvictDelegatedFrame() otherwise it will DCHECK and
crash. Implement the correct logic in DelegatedFrameHost. There is no
CompositorFrameSinkSupport to clear, but we clear the SurfaceLayer which
will drop the surface reference to the evicted frame.

Bug: 777881
Change-Id: Id6725d6cdb141c668b8217419535863ecf586a17
Reviewed-on: https://chromium-review.googlesource.com/829618
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524717}
parent 63af24a0
...@@ -525,7 +525,6 @@ void DelegatedFrameHost::SubmitCompositorFrame( ...@@ -525,7 +525,6 @@ void DelegatedFrameHost::SubmitCompositorFrame(
local_surface_id, std::move(frame), std::move(hit_test_region_list)); local_surface_id, std::move(frame), std::move(hit_test_region_list));
DCHECK(result); DCHECK(result);
} }
} }
void DelegatedFrameHost::ClearDelegatedFrame() { void DelegatedFrameHost::ClearDelegatedFrame() {
...@@ -617,27 +616,25 @@ void DelegatedFrameHost::OnBeginFrame(const viz::BeginFrameArgs& args) { ...@@ -617,27 +616,25 @@ void DelegatedFrameHost::OnBeginFrame(const viz::BeginFrameArgs& args) {
} }
void DelegatedFrameHost::EvictDelegatedFrame() { void DelegatedFrameHost::EvictDelegatedFrame() {
if (enable_viz_) {
NOTIMPLEMENTED();
return;
}
if (!HasFallbackSurface()) if (!HasFallbackSurface())
return; return;
if (enable_surface_synchronization_) { if (enable_surface_synchronization_) {
client_->DelegatedFrameHostGetLayer()->SetFallbackSurfaceId( client_->DelegatedFrameHostGetLayer()->SetFallbackSurfaceId(
viz::SurfaceId()); viz::SurfaceId());
support_->EvictCurrentSurface(); } else {
frame_evictor_->DiscardedFrame(); client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent();
return; resize_lock_.reset();
UpdateGutters();
} }
client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent(); // TODO(samans): Ensure that with --enable-viz the latest frame is evicted and
support_->EvictCurrentSurface(); // that DelegatedFrameHost updates the SurfaceLayer when the frame becomes
resize_lock_.reset(); // visible again.
if (!enable_viz_)
support_->EvictCurrentSurface();
frame_evictor_->DiscardedFrame(); frame_evictor_->DiscardedFrame();
UpdateGutters();
} }
// static // static
......
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