Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: ui/android/delegated_frame_host_android.cc

Issue 2382873002: Replace usage of SurfaceId's client_id with FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/android/delegated_frame_host_android.h ('k') | ui/android/window_android_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5be36577f3c8d9aefe7f721f59307ee053fe56a9..08bcd7da26a20b5ce94e06485fec181efd575c93 100644
--- a/ui/android/delegated_frame_host_android.cc
+++ b/ui/android/delegated_frame_host_android.cc
@@ -28,7 +28,7 @@ void SatisfyCallback(cc::SurfaceManager* manager,
const cc::SurfaceSequence& sequence) {
std::vector<uint32_t> sequences;
sequences.push_back(sequence.sequence);
- manager->DidSatisfySequences(sequence.client_id, &sequences);
+ manager->DidSatisfySequences(sequence.frame_sink_id, &sequences);
}
void RequireCallback(cc::SurfaceManager* manager,
@@ -82,8 +82,8 @@ DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(
surface_manager_ =
ui::ContextProviderFactory::GetInstance()->GetSurfaceManager();
surface_id_allocator_.reset(new cc::SurfaceIdAllocator(
- ui::ContextProviderFactory::GetInstance()->AllocateSurfaceClientId()));
- surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
+ ui::ContextProviderFactory::GetInstance()->AllocateFrameSinkId()));
+ surface_manager_->RegisterFrameSinkId(surface_id_allocator_->frame_sink_id());
background_layer_->SetBackgroundColor(background_color);
view_->GetLayer()->AddChild(background_layer_);
@@ -93,9 +93,9 @@ DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(
DelegatedFrameHostAndroid::~DelegatedFrameHostAndroid() {
DestroyDelegatedContent();
surface_factory_.reset();
- UnregisterSurfaceNamespaceHierarchy();
- surface_manager_->InvalidateSurfaceClientId(
- surface_id_allocator_->client_id());
+ UnregisterFrameSinkHierarchy();
+ surface_manager_->InvalidateFrameSinkId(
+ surface_id_allocator_->frame_sink_id());
background_layer_->RemoveFromParent();
}
@@ -159,8 +159,8 @@ void DelegatedFrameHostAndroid::SubmitCompositorFrame(
std::move(frame), draw_callback);
}
-uint32_t DelegatedFrameHostAndroid::GetSurfaceClientId() const {
- return surface_id_allocator_->client_id();
+cc::FrameSinkId DelegatedFrameHostAndroid::GetFrameSinkId() const {
+ return surface_id_allocator_->frame_sink_id();
}
void DelegatedFrameHostAndroid::RequestCopyOfSurface(
@@ -222,25 +222,25 @@ void DelegatedFrameHostAndroid::UpdateContainerSizeinDIP(
UpdateBackgroundLayer();
}
-void DelegatedFrameHostAndroid::RegisterSurfaceNamespaceHierarchy(
- uint32_t parent_id) {
- if (registered_parent_client_id_ != 0u)
- UnregisterSurfaceNamespaceHierarchy();
- registered_parent_client_id_ = parent_id;
+void DelegatedFrameHostAndroid::RegisterFrameSinkHierarchy(
+ const cc::FrameSinkId& parent_id) {
+ if (!registered_parent_frame_sink_id_.is_null())
+ UnregisterFrameSinkHierarchy();
+ registered_parent_frame_sink_id_ = parent_id;
surface_manager_->RegisterSurfaceFactoryClient(
- surface_id_allocator_->client_id(), this);
- surface_manager_->RegisterSurfaceNamespaceHierarchy(
- parent_id, surface_id_allocator_->client_id());
+ surface_id_allocator_->frame_sink_id(), this);
+ surface_manager_->RegisterFrameSinkHierarchy(
+ parent_id, surface_id_allocator_->frame_sink_id());
}
-void DelegatedFrameHostAndroid::UnregisterSurfaceNamespaceHierarchy() {
- if (registered_parent_client_id_ == 0u)
+void DelegatedFrameHostAndroid::UnregisterFrameSinkHierarchy() {
+ if (registered_parent_frame_sink_id_.is_null())
return;
surface_manager_->UnregisterSurfaceFactoryClient(
- surface_id_allocator_->client_id());
- surface_manager_->UnregisterSurfaceNamespaceHierarchy(
- registered_parent_client_id_, surface_id_allocator_->client_id());
- registered_parent_client_id_ = 0u;
+ surface_id_allocator_->frame_sink_id());
+ surface_manager_->UnregisterFrameSinkHierarchy(
+ registered_parent_frame_sink_id_, surface_id_allocator_->frame_sink_id());
+ registered_parent_frame_sink_id_ = cc::FrameSinkId();
}
void DelegatedFrameHostAndroid::ReturnResources(
« no previous file with comments | « ui/android/delegated_frame_host_android.h ('k') | ui/android/window_android_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698