| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 } // namespace | 116 } // namespace |
| 117 | 117 |
| 118 OutputSurface::OutputSurface( | 118 OutputSurface::OutputSurface( |
| 119 const scoped_refptr<ContextProvider>& context_provider, | 119 const scoped_refptr<ContextProvider>& context_provider, |
| 120 const scoped_refptr<ContextProvider>& worker_context_provider, | 120 const scoped_refptr<ContextProvider>& worker_context_provider, |
| 121 scoped_ptr<SoftwareOutputDevice> software_device) | 121 scoped_ptr<SoftwareOutputDevice> software_device) |
| 122 : client_(NULL), | 122 : client_(NULL), |
| 123 context_provider_(context_provider), | 123 context_provider_(context_provider), |
| 124 worker_context_provider_(worker_context_provider), | 124 worker_context_provider_(worker_context_provider), |
| 125 software_device_(software_device.Pass()), | 125 software_device_(std::move(software_device)), |
| 126 device_scale_factor_(-1), | 126 device_scale_factor_(-1), |
| 127 external_stencil_test_enabled_(false), | 127 external_stencil_test_enabled_(false), |
| 128 weak_ptr_factory_(this) { | 128 weak_ptr_factory_(this) { |
| 129 client_thread_checker_.DetachFromThread(); | 129 client_thread_checker_.DetachFromThread(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 OutputSurface::OutputSurface( | 132 OutputSurface::OutputSurface( |
| 133 const scoped_refptr<ContextProvider>& context_provider) | 133 const scoped_refptr<ContextProvider>& context_provider) |
| 134 : OutputSurface(context_provider, nullptr, nullptr) { | 134 : OutputSurface(context_provider, nullptr, nullptr) { |
| 135 } | 135 } |
| 136 | 136 |
| 137 OutputSurface::OutputSurface( | 137 OutputSurface::OutputSurface( |
| 138 const scoped_refptr<ContextProvider>& context_provider, | 138 const scoped_refptr<ContextProvider>& context_provider, |
| 139 const scoped_refptr<ContextProvider>& worker_context_provider) | 139 const scoped_refptr<ContextProvider>& worker_context_provider) |
| 140 : OutputSurface(context_provider, worker_context_provider, nullptr) { | 140 : OutputSurface(context_provider, worker_context_provider, nullptr) { |
| 141 } | 141 } |
| 142 | 142 |
| 143 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 143 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
| 144 : OutputSurface(nullptr, nullptr, software_device.Pass()) { | 144 : OutputSurface(nullptr, nullptr, std::move(software_device)) {} |
| 145 } | |
| 146 | 145 |
| 147 OutputSurface::OutputSurface( | 146 OutputSurface::OutputSurface( |
| 148 const scoped_refptr<ContextProvider>& context_provider, | 147 const scoped_refptr<ContextProvider>& context_provider, |
| 149 scoped_ptr<SoftwareOutputDevice> software_device) | 148 scoped_ptr<SoftwareOutputDevice> software_device) |
| 150 : OutputSurface(context_provider, nullptr, software_device.Pass()) { | 149 : OutputSurface(context_provider, nullptr, std::move(software_device)) {} |
| 151 } | |
| 152 | 150 |
| 153 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, | 151 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, |
| 154 base::TimeDelta interval) { | 152 base::TimeDelta interval) { |
| 155 TRACE_EVENT2("cc", | 153 TRACE_EVENT2("cc", |
| 156 "OutputSurface::CommitVSyncParameters", | 154 "OutputSurface::CommitVSyncParameters", |
| 157 "timebase", | 155 "timebase", |
| 158 (timebase - base::TimeTicks()).InSecondsF(), | 156 (timebase - base::TimeTicks()).InSecondsF(), |
| 159 "interval", | 157 "interval", |
| 160 interval.InSecondsF()); | 158 interval.InSecondsF()); |
| 161 client_->CommitVSyncParameters(timebase, interval); | 159 client_->CommitVSyncParameters(timebase, interval); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 if (context_provider_.get()) { | 361 if (context_provider_.get()) { |
| 364 context_provider_->SetLostContextCallback( | 362 context_provider_->SetLostContextCallback( |
| 365 ContextProvider::LostContextCallback()); | 363 ContextProvider::LostContextCallback()); |
| 366 } | 364 } |
| 367 context_provider_ = nullptr; | 365 context_provider_ = nullptr; |
| 368 client_ = nullptr; | 366 client_ = nullptr; |
| 369 weak_ptr_factory_.InvalidateWeakPtrs(); | 367 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 370 } | 368 } |
| 371 | 369 |
| 372 } // namespace cc | 370 } // namespace cc |
| OLD | NEW |