OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 : OutputSurface(std::move(context_provider), | 154 : OutputSurface(std::move(context_provider), |
155 std::move(worker_context_provider), | 155 std::move(worker_context_provider), |
156 #if defined(ENABLE_VULKAN) | 156 #if defined(ENABLE_VULKAN) |
157 nullptr, | 157 nullptr, |
158 #endif | 158 #endif |
159 nullptr) { | 159 nullptr) { |
160 } | 160 } |
161 | 161 |
162 #if defined(ENABLE_VULKAN) | 162 #if defined(ENABLE_VULKAN) |
163 OutputSurface::OutputSurface( | 163 OutputSurface::OutputSurface( |
164 scoped_refptr<VulkanContextProvider> vulkan_context_provider) | 164 scoped_refptr<VulkanContextProvider> vulkan_context_provider, |
| 165 bool use_vulkan) |
165 : OutputSurface(nullptr, | 166 : OutputSurface(nullptr, |
166 nullptr, | 167 nullptr, |
167 std::move(vulkan_context_provider), | 168 std::move(vulkan_context_provider), |
168 nullptr) {} | 169 nullptr) { |
| 170 DCHECK(use_vulkan); |
| 171 } |
169 #endif | 172 #endif |
170 | 173 |
171 OutputSurface::OutputSurface( | 174 OutputSurface::OutputSurface( |
172 std::unique_ptr<SoftwareOutputDevice> software_device) | 175 std::unique_ptr<SoftwareOutputDevice> software_device) |
173 : OutputSurface(nullptr, | 176 : OutputSurface(nullptr, |
174 nullptr, | 177 nullptr, |
175 #if defined(ENABLE_VULKAN) | 178 #if defined(ENABLE_VULKAN) |
176 nullptr, | 179 nullptr, |
177 #endif | 180 #endif |
178 std::move(software_device)) { | 181 std::move(software_device)) { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 if (context_provider_.get()) { | 385 if (context_provider_.get()) { |
383 context_provider_->SetLostContextCallback( | 386 context_provider_->SetLostContextCallback( |
384 ContextProvider::LostContextCallback()); | 387 ContextProvider::LostContextCallback()); |
385 } | 388 } |
386 context_provider_ = nullptr; | 389 context_provider_ = nullptr; |
387 client_ = nullptr; | 390 client_ = nullptr; |
388 weak_ptr_factory_.InvalidateWeakPtrs(); | 391 weak_ptr_factory_.InvalidateWeakPtrs(); |
389 } | 392 } |
390 | 393 |
391 } // namespace cc | 394 } // namespace cc |
OLD | NEW |