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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Android + Addressed Antoine's comment Created 4 years, 5 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
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 66bc2eb270e83844ab6dd208fee4438d12d5ddf4..1d20f27c71cf0f2fab59bfa1cd6a5f5c1d5cfabe 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -337,14 +337,12 @@ cc::SurfaceManager* CompositorImpl::GetSurfaceManager() {
}
// static
-std::unique_ptr<cc::SurfaceIdAllocator>
-CompositorImpl::CreateSurfaceIdAllocator() {
- std::unique_ptr<cc::SurfaceIdAllocator> allocator(
- new cc::SurfaceIdAllocator(++g_surface_client_id));
+uint32_t CompositorImpl::AllocateSurfaceClientId() {
+ uint32_t client_id = ++g_surface_client_id;
cc::SurfaceManager* manager = GetSurfaceManager();
DCHECK(manager);
- allocator->RegisterSurfaceClientId(manager);
- return allocator;
+ manager->RegisterSurfaceClientId(client_id);
+ return client_id;
}
// static
@@ -364,7 +362,8 @@ CompositorImpl::SharedVulkanContextProviderAndroid() {
CompositorImpl::CompositorImpl(CompositorClient* client,
gfx::NativeWindow root_window)
: root_layer_(cc::Layer::Create()),
- surface_id_allocator_(CreateSurfaceIdAllocator()),
+ surface_id_allocator_(
+ new cc::SurfaceIdAllocator(AllocateSurfaceClientId())),
resource_manager_(root_window),
has_transparent_background_(false),
device_scale_factor_(1),

Powered by Google App Engine
This is Rietveld 408576698