Fix OSR rendering recovery after GPU process crash (fixes issue #2827)

This commit is contained in:
elad bahar 2020-01-08 12:33:57 +00:00 committed by Marshall Greenblatt
parent 80fc651d7e
commit 8ca0b4580e
2 changed files with 17 additions and 3 deletions

View File

@ -435,6 +435,17 @@ void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink(
void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame() {}
void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete(
const cc::RenderFrameMetadata& metadata) {
bool force = false;
if (metadata.local_surface_id_allocation) {
force = local_surface_id_allocator_.UpdateFromChild(
*metadata.local_surface_id_allocation);
}
SynchronizeVisualProperties(force);
}
void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t sequence,
const gfx::Rect& rect) {
// Associate the given damage rect with the presentation token.
@ -700,9 +711,9 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
viz::ScopedSurfaceIdAllocator
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
base::OnceCallback<void()> allocation_task =
base::BindOnce(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr(), false);
base::OnceCallback<void()> allocation_task = base::BindOnce(
&CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete,
weak_ptr_factory_.GetWeakPtr(), metadata);
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
}
#endif

View File

@ -268,6 +268,9 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void OnPresentCompositorFrame();
void OnDidUpdateVisualPropertiesComplete(
const cc::RenderFrameMetadata& metadata);
private:
content::DelegatedFrameHost* GetDelegatedFrameHost() const;