Index: ui/aura/mus/mus_context_factory.cc |
diff --git a/ui/aura/mus/mus_context_factory.cc b/ui/aura/mus/mus_context_factory.cc |
index 71698063c0639e72494947b2103a2a4bd99dbcfc..e0ea1a0170b55edbecc0e52d9c071d53a850439b 100644 |
--- a/ui/aura/mus/mus_context_factory.cc |
+++ b/ui/aura/mus/mus_context_factory.cc |
@@ -62,8 +62,18 @@ void MusContextFactory::CreateCompositorFrameSink( |
scoped_refptr<cc::ContextProvider> |
MusContextFactory::SharedMainThreadContextProvider() { |
- // NOTIMPLEMENTED(); |
- return nullptr; |
+ if (!shared_main_thread_context_provider_) { |
+ // In this point, the gpu channel should be already established in gpu_, |
+ // the gpu_->EstablishGpuChannelSync() just returns the gpu channel |
+ // immediately. |
sadrul
2017/05/16 19:34:27
Can you verify that here? i.e. have a bool flag th
Peng
2017/05/16 19:52:08
I think we shouldn't DCHECK it, because ui::Contex
sadrul
2017/05/16 19:53:27
If we cannot depend on this, can you remove/update
Peng
2017/05/16 19:56:55
Removed. Done
|
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel = |
+ gpu_->EstablishGpuChannelSync(); |
+ shared_main_thread_context_provider_ = |
+ gpu_->CreateContextProvider(std::move(gpu_channel)); |
+ if (!shared_main_thread_context_provider_->BindToCurrentThread()) |
+ shared_main_thread_context_provider_ = nullptr; |
+ } |
+ return shared_main_thread_context_provider_; |
} |
void MusContextFactory::RemoveCompositor(ui::Compositor* compositor) { |