| 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 88cc36ae52716271d05a483843965064b1711c37..b3fd8a744db2ab9b42790e5ce32699f2839fe60e 100644
|
| --- a/ui/android/delegated_frame_host_android.cc
|
| +++ b/ui/android/delegated_frame_host_android.cc
|
| @@ -15,6 +15,7 @@
|
| #include "cc/surfaces/surface_id.h"
|
| #include "cc/surfaces/surface_id_allocator.h"
|
| #include "cc/surfaces/surface_manager.h"
|
| +#include "content/browser/renderer_host/compositor_impl_android.h"
|
| #include "ui/android/context_provider_factory.h"
|
| #include "ui/android/view_android.h"
|
| #include "ui/android/window_android_compositor.h"
|
| @@ -78,7 +79,7 @@ DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(
|
| DelegatedFrameHostAndroid::~DelegatedFrameHostAndroid() {
|
| DestroyDelegatedContent();
|
| surface_factory_.reset();
|
| - UnregisterFrameSinkHierarchy();
|
| + DetachFromCompositor();
|
| surface_manager_->InvalidateFrameSinkId(frame_sink_id_);
|
| background_layer_->RemoveFromParent();
|
| }
|
| @@ -203,22 +204,21 @@ void DelegatedFrameHostAndroid::UpdateContainerSizeinDIP(
|
| UpdateBackgroundLayer();
|
| }
|
|
|
| -void DelegatedFrameHostAndroid::RegisterFrameSinkHierarchy(
|
| - const cc::FrameSinkId& parent_id) {
|
| - if (registered_parent_frame_sink_id_.is_valid())
|
| - UnregisterFrameSinkHierarchy();
|
| - registered_parent_frame_sink_id_ = parent_id;
|
| +void DelegatedFrameHostAndroid::AttachToCompositor(
|
| + content::CompositorImpl* compositor) {
|
| + if (parent_compositor_impl_)
|
| + DetachFromCompositor();
|
| surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
|
| - surface_manager_->RegisterFrameSinkHierarchy(parent_id, frame_sink_id_);
|
| + compositor->AddChildFrameSink(frame_sink_id_);
|
| + parent_compositor_impl_ = compositor;
|
| }
|
|
|
| -void DelegatedFrameHostAndroid::UnregisterFrameSinkHierarchy() {
|
| - if (!registered_parent_frame_sink_id_.is_valid())
|
| +void DelegatedFrameHostAndroid::DetachFromCompositor() {
|
| + if (!parent_compositor_impl_)
|
| return;
|
| surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
|
| - surface_manager_->UnregisterFrameSinkHierarchy(
|
| - registered_parent_frame_sink_id_, frame_sink_id_);
|
| - registered_parent_frame_sink_id_ = cc::FrameSinkId();
|
| + parent_compositor_impl_->RemoveChildFrameSink(frame_sink_id_);
|
| + parent_compositor_impl_ = nullptr;
|
| }
|
|
|
| void DelegatedFrameHostAndroid::ReturnResources(
|
|
|