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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 }; | 117 }; |
118 | 118 |
119 } // namespace | 119 } // namespace |
120 | 120 |
121 OutputSurface::OutputSurface( | 121 OutputSurface::OutputSurface( |
122 scoped_refptr<ContextProvider> context_provider, | 122 scoped_refptr<ContextProvider> context_provider, |
123 scoped_refptr<ContextProvider> worker_context_provider, | 123 scoped_refptr<ContextProvider> worker_context_provider, |
124 #if defined(ENABLE_VULKAN) | 124 #if defined(ENABLE_VULKAN) |
125 scoped_refptr<VulkanContextProvider> vulkan_context_provider, | 125 scoped_refptr<VulkanContextProvider> vulkan_context_provider, |
126 #endif | 126 #endif |
127 scoped_ptr<SoftwareOutputDevice> software_device) | 127 std::unique_ptr<SoftwareOutputDevice> software_device) |
128 : client_(NULL), | 128 : client_(NULL), |
129 context_provider_(std::move(context_provider)), | 129 context_provider_(std::move(context_provider)), |
130 worker_context_provider_(std::move(worker_context_provider)), | 130 worker_context_provider_(std::move(worker_context_provider)), |
131 #if defined(ENABLE_VULKAN) | 131 #if defined(ENABLE_VULKAN) |
132 vulkan_context_provider_(vulkan_context_provider), | 132 vulkan_context_provider_(vulkan_context_provider), |
133 #endif | 133 #endif |
134 software_device_(std::move(software_device)), | 134 software_device_(std::move(software_device)), |
135 device_scale_factor_(-1), | 135 device_scale_factor_(-1), |
136 has_alpha_(true), | 136 has_alpha_(true), |
137 external_stencil_test_enabled_(false), | 137 external_stencil_test_enabled_(false), |
(...skipping 23 matching lines...) Expand all Loading... |
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 : OutputSurface(nullptr, | 165 : OutputSurface(nullptr, |
166 nullptr, | 166 nullptr, |
167 std::move(vulkan_context_provider), | 167 std::move(vulkan_context_provider), |
168 nullptr) {} | 168 nullptr) {} |
169 #endif | 169 #endif |
170 | 170 |
171 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 171 OutputSurface::OutputSurface( |
| 172 std::unique_ptr<SoftwareOutputDevice> software_device) |
172 : OutputSurface(nullptr, | 173 : OutputSurface(nullptr, |
173 nullptr, | 174 nullptr, |
174 #if defined(ENABLE_VULKAN) | 175 #if defined(ENABLE_VULKAN) |
175 nullptr, | 176 nullptr, |
176 #endif | 177 #endif |
177 std::move(software_device)) { | 178 std::move(software_device)) { |
178 } | 179 } |
179 | 180 |
180 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider, | 181 OutputSurface::OutputSurface( |
181 scoped_ptr<SoftwareOutputDevice> software_device) | 182 scoped_refptr<ContextProvider> context_provider, |
| 183 std::unique_ptr<SoftwareOutputDevice> software_device) |
182 : OutputSurface(std::move(context_provider), | 184 : OutputSurface(std::move(context_provider), |
183 nullptr, | 185 nullptr, |
184 #if defined(ENABLE_VULKAN) | 186 #if defined(ENABLE_VULKAN) |
185 nullptr, | 187 nullptr, |
186 #endif | 188 #endif |
187 std::move(software_device)) { | 189 std::move(software_device)) { |
188 } | 190 } |
189 | 191 |
190 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, | 192 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, |
191 base::TimeDelta interval) { | 193 base::TimeDelta interval) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (context_provider_.get()) { | 393 if (context_provider_.get()) { |
392 context_provider_->SetLostContextCallback( | 394 context_provider_->SetLostContextCallback( |
393 ContextProvider::LostContextCallback()); | 395 ContextProvider::LostContextCallback()); |
394 } | 396 } |
395 context_provider_ = nullptr; | 397 context_provider_ = nullptr; |
396 client_ = nullptr; | 398 client_ = nullptr; |
397 weak_ptr_factory_.InvalidateWeakPtrs(); | 399 weak_ptr_factory_.InvalidateWeakPtrs(); |
398 } | 400 } |
399 | 401 |
400 } // namespace cc | 402 } // namespace cc |
OLD | NEW |