OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 ReflectorImpl* reflector = nullptr; | 167 ReflectorImpl* reflector = nullptr; |
168 std::unique_ptr<cc::Display> display; | 168 std::unique_ptr<cc::Display> display; |
169 bool output_is_secure = false; | 169 bool output_is_secure = false; |
170 }; | 170 }; |
171 | 171 |
172 GpuProcessTransportFactory::GpuProcessTransportFactory() | 172 GpuProcessTransportFactory::GpuProcessTransportFactory() |
173 : task_graph_runner_(new cc::SingleThreadTaskGraphRunner), | 173 : task_graph_runner_(new cc::SingleThreadTaskGraphRunner), |
174 callback_factory_(this) { | 174 callback_factory_(this) { |
175 cc::SetClientNameForMetrics("Browser"); | 175 cc::SetClientNameForMetrics("Browser"); |
176 | 176 |
177 surface_manager_ = base::WrapUnique(new cc::SurfaceManager); | 177 surface_manager_ = base::WrapUnique(new cc::SurfaceManager(nullptr)); |
178 | 178 |
179 task_graph_runner_->Start("CompositorTileWorker1", | 179 task_graph_runner_->Start("CompositorTileWorker1", |
180 base::SimpleThread::Options()); | 180 base::SimpleThread::Options()); |
181 #if defined(OS_WIN) | 181 #if defined(OS_WIN) |
182 software_backing_.reset(new OutputDeviceBacking); | 182 software_backing_.reset(new OutputDeviceBacking); |
183 #endif | 183 #endif |
184 } | 184 } |
185 | 185 |
186 GpuProcessTransportFactory::~GpuProcessTransportFactory() { | 186 GpuProcessTransportFactory::~GpuProcessTransportFactory() { |
187 // If this fails, then we are leaking compositors. | 187 // If this fails, then we are leaking compositors. |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 } | 643 } |
644 | 644 |
645 cc::TaskGraphRunner* GpuProcessTransportFactory::GetTaskGraphRunner() { | 645 cc::TaskGraphRunner* GpuProcessTransportFactory::GetTaskGraphRunner() { |
646 return task_graph_runner_.get(); | 646 return task_graph_runner_.get(); |
647 } | 647 } |
648 | 648 |
649 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { | 649 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { |
650 return this; | 650 return this; |
651 } | 651 } |
652 | 652 |
653 uint32_t GpuProcessTransportFactory::AllocateSurfaceClientId() { | 653 cc::FrameSinkId GpuProcessTransportFactory::AllocateFrameSinkId() { |
654 return next_surface_client_id_++; | 654 return cc::FrameSinkId(next_surface_client_id_++, 0); |
655 } | 655 } |
656 | 656 |
657 void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor, | 657 void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor, |
658 bool visible) { | 658 bool visible) { |
659 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); | 659 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); |
660 if (it == per_compositor_data_.end()) | 660 if (it == per_compositor_data_.end()) |
661 return; | 661 return; |
662 PerCompositorData* data = it->second.get(); | 662 PerCompositorData* data = it->second.get(); |
663 DCHECK(data); | 663 DCHECK(data); |
664 // The compositor will always SetVisible on the Display once it is set up, so | 664 // The compositor will always SetVisible on the Display once it is set up, so |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 shared_vulkan_context_provider_ = | 871 shared_vulkan_context_provider_ = |
872 cc::VulkanInProcessContextProvider::Create(); | 872 cc::VulkanInProcessContextProvider::Create(); |
873 } | 873 } |
874 | 874 |
875 shared_vulkan_context_provider_initialized_ = true; | 875 shared_vulkan_context_provider_initialized_ = true; |
876 } | 876 } |
877 return shared_vulkan_context_provider_; | 877 return shared_vulkan_context_provider_; |
878 } | 878 } |
879 | 879 |
880 } // namespace content | 880 } // namespace content |
OLD | NEW |