Commit eef2fcc9 authored by Riku Palomäki's avatar Riku Palomäki Committed by Marshall Greenblatt
Browse files

Fix frozen OSR rendering after resize (fixes issue #2627)

parent e1c74c2e
......@@ -344,6 +344,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
software_output_device_(NULL),
hold_resize_(false),
pending_resize_(false),
pending_resize_force_(false),
render_widget_host_(content::RenderWidgetHostImpl::From(widget)),
has_parent_(parent_host_view != NULL),
parent_host_view_(parent_host_view),
......@@ -1142,9 +1143,11 @@ CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() {
viz::ScopedSurfaceIdAllocator
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
bool force =
local_surface_id_allocation_ != metadata.local_surface_id_allocation;
base::OnceCallback<void()> allocation_task =
base::BindOnce(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr());
weak_ptr_factory_.GetWeakPtr(), force);
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
}
#endif
......@@ -1249,14 +1252,16 @@ bool CefRenderWidgetHostViewOSR::InstallTransparency() {
return false;
}
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties() {
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties(bool force) {
if (hold_resize_) {
if (!pending_resize_)
pending_resize_ = true;
if (force)
pending_resize_force_ = true;
return;
}
ResizeRootLayer(false);
ResizeRootLayer(force);
}
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
......@@ -1637,11 +1642,13 @@ void CefRenderWidgetHostViewOSR::ReleaseResize() {
hold_resize_ = false;
if (pending_resize_) {
bool force = pending_resize_force_;
pending_resize_ = false;
pending_resize_force_ = false;
CEF_POST_TASK(
CEF_UIT,
base::Bind(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr()));
weak_ptr_factory_.GetWeakPtr(), force));
}
}
......
......@@ -225,7 +225,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool InstallTransparency();
void SynchronizeVisualProperties();
void SynchronizeVisualProperties(bool force = false);
void OnScreenInfoChanged();
void Invalidate(CefBrowserHost::PaintElementType type);
void SendExternalBeginFrame();
......@@ -395,6 +395,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool hold_resize_;
bool pending_resize_;
bool pending_resize_force_;
// The associated Model. While |this| is being Destroyed,
// |render_widget_host_| is NULL and the message loop is run one last time
......
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