| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 base::trace_event::ProcessMemoryDump* pmd_; | 113 base::trace_event::ProcessMemoryDump* pmd_; |
| 114 uint64_t share_group_tracing_guid_; | 114 uint64_t share_group_tracing_guid_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); | 116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 OutputSurface::OutputSurface( | 121 OutputSurface::OutputSurface( |
| 122 const scoped_refptr<ContextProvider>& context_provider, | 122 scoped_refptr<ContextProvider> context_provider, |
| 123 const scoped_refptr<ContextProvider>& worker_context_provider, | 123 scoped_refptr<ContextProvider> worker_context_provider, |
| 124 scoped_ptr<SoftwareOutputDevice> software_device) | 124 scoped_ptr<SoftwareOutputDevice> software_device) |
| 125 : client_(NULL), | 125 : client_(NULL), |
| 126 context_provider_(context_provider), | 126 context_provider_(std::move(context_provider)), |
| 127 worker_context_provider_(worker_context_provider), | 127 worker_context_provider_(std::move(worker_context_provider)), |
| 128 software_device_(std::move(software_device)), | 128 software_device_(std::move(software_device)), |
| 129 device_scale_factor_(-1), | 129 device_scale_factor_(-1), |
| 130 has_alpha_(true), | 130 has_alpha_(true), |
| 131 external_stencil_test_enabled_(false), | 131 external_stencil_test_enabled_(false), |
| 132 weak_ptr_factory_(this) { | 132 weak_ptr_factory_(this) { |
| 133 client_thread_checker_.DetachFromThread(); | 133 client_thread_checker_.DetachFromThread(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 OutputSurface::OutputSurface( | 136 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider) |
| 137 const scoped_refptr<ContextProvider>& context_provider) | 137 : OutputSurface(std::move(context_provider), nullptr, nullptr) {} |
| 138 : OutputSurface(context_provider, nullptr, nullptr) { | |
| 139 } | |
| 140 | 138 |
| 141 OutputSurface::OutputSurface( | 139 OutputSurface::OutputSurface( |
| 142 const scoped_refptr<ContextProvider>& context_provider, | 140 scoped_refptr<ContextProvider> context_provider, |
| 143 const scoped_refptr<ContextProvider>& worker_context_provider) | 141 scoped_refptr<ContextProvider> worker_context_provider) |
| 144 : OutputSurface(context_provider, worker_context_provider, nullptr) { | 142 : OutputSurface(std::move(context_provider), |
| 145 } | 143 std::move(worker_context_provider), |
| 144 nullptr) {} |
| 146 | 145 |
| 147 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) | 146 OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
| 148 : OutputSurface(nullptr, nullptr, std::move(software_device)) {} | 147 : OutputSurface(nullptr, nullptr, std::move(software_device)) {} |
| 149 | 148 |
| 150 OutputSurface::OutputSurface( | 149 OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider, |
| 151 const scoped_refptr<ContextProvider>& context_provider, | 150 scoped_ptr<SoftwareOutputDevice> software_device) |
| 152 scoped_ptr<SoftwareOutputDevice> software_device) | 151 : OutputSurface(std::move(context_provider), |
| 153 : OutputSurface(context_provider, nullptr, std::move(software_device)) {} | 152 nullptr, |
| 153 std::move(software_device)) {} |
| 154 | 154 |
| 155 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, | 155 void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, |
| 156 base::TimeDelta interval) { | 156 base::TimeDelta interval) { |
| 157 TRACE_EVENT2("cc", | 157 TRACE_EVENT2("cc", |
| 158 "OutputSurface::CommitVSyncParameters", | 158 "OutputSurface::CommitVSyncParameters", |
| 159 "timebase", | 159 "timebase", |
| 160 (timebase - base::TimeTicks()).InSecondsF(), | 160 (timebase - base::TimeTicks()).InSecondsF(), |
| 161 "interval", | 161 "interval", |
| 162 interval.InSecondsF()); | 162 interval.InSecondsF()); |
| 163 client_->CommitVSyncParameters(timebase, interval); | 163 client_->CommitVSyncParameters(timebase, interval); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 if (context_provider_.get()) { | 356 if (context_provider_.get()) { |
| 357 context_provider_->SetLostContextCallback( | 357 context_provider_->SetLostContextCallback( |
| 358 ContextProvider::LostContextCallback()); | 358 ContextProvider::LostContextCallback()); |
| 359 } | 359 } |
| 360 context_provider_ = nullptr; | 360 context_provider_ = nullptr; |
| 361 client_ = nullptr; | 361 client_ = nullptr; |
| 362 weak_ptr_factory_.InvalidateWeakPtrs(); | 362 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 } // namespace cc | 365 } // namespace cc |
| OLD | NEW |