Commit 94a519a3 authored by piman@chromium.org's avatar piman@chromium.org

Aura: fix full-screen Flash with delegated renderer

During the fullscreen transition, on some sites Flash destroys and recreates its
context, which causes the RenderWidgetFullscreenPepper to switch back and forth
between composited and non-composited modes, recreating its compositor. That
causes it to send 2 successive frames with resources that have the same id (1)
but from different compositors (and different mailboxes).
Make sure we disambiguate those by recreating the DelegatedRendererLayer.

BUG=284821

Review URL: https://chromiumcodereview.appspot.com/23513012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221341 0039d316-1c4b-4281-b951-d872f2087c98
parent 31fddc0d
...@@ -649,6 +649,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) ...@@ -649,6 +649,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
text_input_type_(ui::TEXT_INPUT_TYPE_NONE), text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
can_compose_inline_(true), can_compose_inline_(true),
has_composition_text_(false), has_composition_text_(false),
last_output_surface_id_(0),
last_swapped_surface_scale_factor_(1.f), last_swapped_surface_scale_factor_(1.f),
paint_canvas_(NULL), paint_canvas_(NULL),
synthetic_move_sent_(false), synthetic_move_sent_(false),
...@@ -1459,6 +1460,17 @@ void RenderWidgetHostViewAura::SwapDelegatedFrame( ...@@ -1459,6 +1460,17 @@ void RenderWidgetHostViewAura::SwapDelegatedFrame(
host_->GetProcess()->GetID(), ack); host_->GetProcess()->GetID(), ack);
return; return;
} }
if (output_surface_id != last_output_surface_id_) {
// Resource ids are scoped by the output surface.
// If the originating output surface doesn't match the last one, it
// indicates the renderer's output surface may have been recreated, in which
// case we should recreate the DelegatedRendererLayer, to avoid matching
// resources from the old one with resources from the new one which would
// have the same id.
window_->layer()->SetDelegatedFrame(scoped_ptr<cc::DelegatedFrameData>(),
frame_size_in_dip);
last_output_surface_id_ = output_surface_id;
}
window_->layer()->SetDelegatedFrame(frame_data.Pass(), frame_size_in_dip); window_->layer()->SetDelegatedFrame(frame_data.Pass(), frame_size_in_dip);
released_front_lock_ = NULL; released_front_lock_ = NULL;
current_frame_size_ = frame_size_in_dip; current_frame_size_ = frame_size_in_dip;
......
...@@ -588,6 +588,11 @@ class RenderWidgetHostViewAura ...@@ -588,6 +588,11 @@ class RenderWidgetHostViewAura
// This holds the current software framebuffer. // This holds the current software framebuffer.
scoped_refptr<MemoryHolder> framebuffer_holder_; scoped_refptr<MemoryHolder> framebuffer_holder_;
// With delegated renderer, this is the last output surface, used to
// disambiguate resources with the same id coming from different output
// surfaces.
uint32 last_output_surface_id_;
// The damage in the previously presented buffer. // The damage in the previously presented buffer.
SkRegion previous_damage_; SkRegion previous_damage_;
......
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