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

Unified Diff: ui/aura/mus/mus_context_factory.cc

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: WIP Created 3 years, 7 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: 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 9517875318f35ee39d05ef00313a8b7970cf1c18..b39ef5fb660fababef2c8ec93bf4815deb90c1b4 100644
--- a/ui/aura/mus/mus_context_factory.cc
+++ b/ui/aura/mus/mus_context_factory.cc
@@ -50,8 +50,18 @@ void MusContextFactory::CreateCompositorFrameSink(
scoped_refptr<cc::ContextProvider>
MusContextFactory::SharedMainThreadContextProvider() {
- // NOTIMPLEMENTED();
- return nullptr;
+ if (!shared_main_thread_context_provider_) {
Fady Samuel 2017/05/16 10:26:41 Maybe this can be a separate CL?
+ // In this point, the gpu channel should be already established in gpu_,
+ // the gpu_->EstablishGpuChannelSync() just returns the gpu channel
+ // immediately.
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698