Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/mus/mus_context_factory.h" | 5 #include "ui/aura/mus/mus_context_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "cc/base/switches.h" | 9 #include "cc/base/switches.h" |
| 10 #include "services/ui/public/cpp/gpu/gpu.h" | 10 #include "services/ui/public/cpp/gpu/gpu.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 void MusContextFactory::OnEstablishedGpuChannel( | 32 void MusContextFactory::OnEstablishedGpuChannel( |
| 33 base::WeakPtr<ui::Compositor> compositor, | 33 base::WeakPtr<ui::Compositor> compositor, |
| 34 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { | 34 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { |
| 35 if (!compositor) | 35 if (!compositor) |
| 36 return; | 36 return; |
| 37 WindowTreeHost* host = | 37 WindowTreeHost* host = |
| 38 WindowTreeHost::GetForAcceleratedWidget(compositor->widget()); | 38 WindowTreeHost::GetForAcceleratedWidget(compositor->widget()); |
| 39 WindowPortMus* window_port = WindowPortMus::Get(host->window()); | 39 WindowPortMus* window_port = WindowPortMus::Get(host->window()); |
| 40 DCHECK(window_port); | 40 DCHECK(window_port); |
| 41 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink = | 41 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink = |
| 42 window_port->RequestCompositorFrameSink( | 42 window_port->CreateCompositorFrameSinkWithContextAndBufferManager( |
|
Fady Samuel
2017/05/30 18:36:41
This is a really long name? Can we just keep the n
Peng
2017/05/31 20:12:25
Done.
| |
| 43 gpu_->CreateContextProvider(std::move(gpu_channel)), | 43 gpu_->CreateContextProvider(std::move(gpu_channel)), |
| 44 gpu_->gpu_memory_buffer_manager()); | 44 gpu_->gpu_memory_buffer_manager()); |
| 45 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 45 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void MusContextFactory::CreateCompositorFrameSink( | 48 void MusContextFactory::CreateCompositorFrameSink( |
| 49 base::WeakPtr<ui::Compositor> compositor) { | 49 base::WeakPtr<ui::Compositor> compositor) { |
| 50 gpu_->EstablishGpuChannel( | 50 gpu_->EstablishGpuChannel( |
| 51 base::Bind(&MusContextFactory::OnEstablishedGpuChannel, | 51 base::Bind(&MusContextFactory::OnEstablishedGpuChannel, |
| 52 weak_ptr_factory_.GetWeakPtr(), compositor)); | 52 weak_ptr_factory_.GetWeakPtr(), compositor)); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 79 | 79 |
| 80 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { | 80 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { |
| 81 return raster_thread_helper_.task_graph_runner(); | 81 return raster_thread_helper_.task_graph_runner(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 const cc::RendererSettings& MusContextFactory::GetRendererSettings() const { | 84 const cc::RendererSettings& MusContextFactory::GetRendererSettings() const { |
| 85 return renderer_settings_; | 85 return renderer_settings_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace aura | 88 } // namespace aura |
| OLD | NEW |