| Index: ui/android/delegated_frame_host_android.cc
|
| diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc
|
| index 2412a064cafee54b1f30112c9ce1ac3679e5ccf4..72e98ef7652d61b7db05a1ccf08f52793176c361 100644
|
| --- a/ui/android/delegated_frame_host_android.cc
|
| +++ b/ui/android/delegated_frame_host_android.cc
|
| @@ -85,6 +85,8 @@ DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(
|
| ui::ContextProviderFactory::GetInstance()->GetSurfaceManager();
|
| surface_id_allocator_.reset(new cc::SurfaceIdAllocator());
|
| surface_manager_->RegisterFrameSinkId(frame_sink_id_);
|
| + surface_factory_ = base::WrapUnique(
|
| + new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this));
|
|
|
| background_layer_->SetBackgroundColor(background_color);
|
| view_->GetLayer()->AddChild(background_layer_);
|
| @@ -106,11 +108,6 @@ DelegatedFrameHostAndroid::FrameData::~FrameData() = default;
|
| void DelegatedFrameHostAndroid::SubmitCompositorFrame(
|
| cc::CompositorFrame frame,
|
| cc::SurfaceFactory::DrawCallback draw_callback) {
|
| - if (!surface_factory_) {
|
| - surface_factory_ = base::WrapUnique(
|
| - new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this));
|
| - }
|
| -
|
| cc::RenderPass* root_pass = frame.render_pass_list.back().get();
|
| gfx::Size surface_size = root_pass->output_rect.size();
|
|
|
| @@ -191,7 +188,6 @@ void DelegatedFrameHostAndroid::DestroyDelegatedContent() {
|
| if (!current_frame_)
|
| return;
|
|
|
| - DCHECK(surface_factory_.get());
|
| DCHECK(content_layer_);
|
|
|
| content_layer_->RemoveFromParent();
|
| @@ -208,7 +204,7 @@ bool DelegatedFrameHostAndroid::HasDelegatedContent() const {
|
|
|
| void DelegatedFrameHostAndroid::CompositorFrameSinkChanged() {
|
| DestroyDelegatedContent();
|
| - surface_factory_.reset();
|
| + surface_factory_->Reset();
|
| }
|
|
|
| void DelegatedFrameHostAndroid::UpdateBackgroundColor(SkColor color) {
|
|
|