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 24eafda7fd06371142220856b6292f203d5f22fc..d3cd1afbe953d829e629def3b2a734f486d95f40 100644 |
--- a/content/browser/renderer_host/compositor_impl_android.cc |
+++ b/content/browser/renderer_host/compositor_impl_android.cc |
@@ -610,13 +610,8 @@ void CompositorImpl::HandlePendingOutputSurfaceRequest() { |
#endif |
DCHECK(surface_handle_ != gpu::kNullSurfaceHandle); |
- |
- ContextProviderFactoryImpl::GetInstance()->CreateDisplayContextProvider( |
- surface_handle_, GetCompositorContextSharedMemoryLimits(), |
- GetCompositorContextAttributes(has_transparent_background_), |
- false /*support_locking*/, false /*automatic_flushes*/, |
- base::Bind(&CompositorImpl::CreateCompositorOutputSurface, |
- weak_factory_.GetWeakPtr())); |
+ ContextProviderFactoryImpl::GetInstance()->RequestGpuChannelHost(base::Bind( |
+ &CompositorImpl::OnGpuChannelEstablished, weak_factory_.GetWeakPtr())); |
} |
#if defined(ENABLE_VULKAN) |
@@ -648,33 +643,34 @@ void CompositorImpl::CreateVulkanOutputSurface() { |
} |
#endif |
-void CompositorImpl::CreateCompositorOutputSurface( |
- const scoped_refptr<cc::ContextProvider>& context_provider, |
- ui::ContextProviderFactory::ContextCreationResult result) { |
+void CompositorImpl::OnGpuChannelEstablished( |
+ const scoped_refptr<gpu::GpuChannelHost>& gpu_channel_host, |
danakj
2016/09/02 00:35:29
This should be by value too.
Khushal
2016/09/02 16:26:47
Done.
|
+ ui::ContextProviderFactory::GpuChannelHostResult result) { |
DCHECK(output_surface_request_pending_); |
switch (result) { |
- // Don't retry if we are shutting down or if the Gpu Surface handle was |
- // lost. The Gpu Surface handle loss should happen only if we are invisible |
- // or this was from a previous request and the current surface has changed, |
- // in which case we would have made another request with the factory. |
- case ui::ContextProviderFactory::ContextCreationResult:: |
+ // Don't retry if we are shutting down. |
+ case ui::ContextProviderFactory::GpuChannelHostResult:: |
FAILURE_FACTORY_SHUTDOWN: |
- case ui::ContextProviderFactory::ContextCreationResult:: |
- FAILURE_GPU_SURFACE_HANDLE_LOST: |
break; |
- case ui::ContextProviderFactory::ContextCreationResult:: |
+ case ui::ContextProviderFactory::GpuChannelHostResult:: |
FAILURE_GPU_PROCESS_INITIALIZATION_FAILED: |
- // Retry only if we are visible. |
- if (host_->visible()) { |
- HandlePendingOutputSurfaceRequest(); |
- } |
+ HandlePendingOutputSurfaceRequest(); |
break; |
- case ui::ContextProviderFactory::ContextCreationResult::SUCCESS: |
- DCHECK(host_->visible()); |
+ case ui::ContextProviderFactory::GpuChannelHostResult::SUCCESS: |
+ // We don't need the context anymore if we are invisible. |
+ if (!host_->visible()) |
+ return; |
+ |
DCHECK(window_); |
DCHECK_NE(surface_handle_, gpu::kNullSurfaceHandle); |
- DCHECK(context_provider); |
+ scoped_refptr<cc::ContextProvider> context_provider = |
+ ContextProviderFactoryImpl::GetInstance() |
+ ->CreateDisplayContextProvider( |
+ surface_handle_, GetCompositorContextSharedMemoryLimits(), |
+ GetCompositorContextAttributes(has_transparent_background_), |
+ false /*support_locking*/, false /*automatic_flushes*/, |
+ gpu_channel_host); |
danakj
2016/09/02 00:35:29
And std::move() here
Khushal
2016/09/02 16:26:47
Done.
|
scoped_refptr<ContextProviderCommandBuffer> |
context_provider_command_buffer = |