Chromium Code Reviews| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 surface_manager_ = base::WrapUnique(new cc::SurfaceManager); | 180 surface_manager_ = base::WrapUnique(new cc::SurfaceManager); |
| 181 | 181 |
| 182 task_graph_runner_->Start("CompositorTileWorker1", | 182 task_graph_runner_->Start("CompositorTileWorker1", |
| 183 base::SimpleThread::Options()); | 183 base::SimpleThread::Options()); |
| 184 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
| 185 software_backing_.reset(new OutputDeviceBacking); | 185 software_backing_.reset(new OutputDeviceBacking); |
| 186 #endif | 186 #endif |
| 187 } | 187 } |
| 188 | 188 |
| 189 GpuProcessTransportFactory::~GpuProcessTransportFactory() { | 189 GpuProcessTransportFactory::~GpuProcessTransportFactory() { |
| 190 DCHECK(per_compositor_data_.empty()); | 190 // If this fails, then we are leaking compositors. |
|
danakj
2016/09/09 22:40:57
Can you TODO at the bug to go back to DCHECK
| |
| 191 CHECK(per_compositor_data_.empty()); | |
| 191 | 192 |
| 192 // Make sure the lost context callback doesn't try to run during destruction. | 193 // Make sure the lost context callback doesn't try to run during destruction. |
| 193 callback_factory_.InvalidateWeakPtrs(); | 194 callback_factory_.InvalidateWeakPtrs(); |
| 194 | 195 |
| 195 task_graph_runner_->Shutdown(); | 196 task_graph_runner_->Shutdown(); |
| 196 } | 197 } |
| 197 | 198 |
| 198 std::unique_ptr<cc::SoftwareOutputDevice> | 199 std::unique_ptr<cc::SoftwareOutputDevice> |
| 199 GpuProcessTransportFactory::CreateSoftwareOutputDevice( | 200 GpuProcessTransportFactory::CreateSoftwareOutputDevice( |
| 200 ui::Compositor* compositor) { | 201 ui::Compositor* compositor) { |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 873 shared_vulkan_context_provider_ = | 874 shared_vulkan_context_provider_ = |
| 874 cc::VulkanInProcessContextProvider::Create(); | 875 cc::VulkanInProcessContextProvider::Create(); |
| 875 } | 876 } |
| 876 | 877 |
| 877 shared_vulkan_context_provider_initialized_ = true; | 878 shared_vulkan_context_provider_initialized_ = true; |
| 878 } | 879 } |
| 879 return shared_vulkan_context_provider_; | 880 return shared_vulkan_context_provider_; |
| 880 } | 881 } |
| 881 | 882 |
| 882 } // namespace content | 883 } // namespace content |
| OLD | NEW |