| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (context_provider_.get()) { | 121 if (context_provider_.get()) { |
| 122 success = context_provider_->BindToCurrentThread(); | 122 success = context_provider_->BindToCurrentThread(); |
| 123 if (success) { | 123 if (success) { |
| 124 context_provider_->SetLostContextCallback(base::Bind( | 124 context_provider_->SetLostContextCallback(base::Bind( |
| 125 &OutputSurface::DidLoseOutputSurface, base::Unretained(this))); | 125 &OutputSurface::DidLoseOutputSurface, base::Unretained(this))); |
| 126 context_provider_->SetMemoryPolicyChangedCallback( | 126 context_provider_->SetMemoryPolicyChangedCallback( |
| 127 base::Bind(&OutputSurface::SetMemoryPolicy, base::Unretained(this))); | 127 base::Bind(&OutputSurface::SetMemoryPolicy, base::Unretained(this))); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 if (success && worker_context_provider_.get()) { |
| 132 success = worker_context_provider_->BindToCurrentThread(); |
| 133 if (success) |
| 134 worker_context_provider_->SetupLock(); |
| 135 } |
| 136 |
| 131 if (!success) | 137 if (!success) |
| 132 client_ = NULL; | 138 client_ = NULL; |
| 133 | 139 |
| 134 return success; | 140 return success; |
| 135 } | 141 } |
| 136 | 142 |
| 137 void OutputSurface::EnsureBackbuffer() { | 143 void OutputSurface::EnsureBackbuffer() { |
| 138 if (software_device_) | 144 if (software_device_) |
| 139 software_device_->EnsureBackbuffer(); | 145 software_device_->EnsureBackbuffer(); |
| 140 } | 146 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 aggressively_free_resources); | 218 aggressively_free_resources); |
| 213 } | 219 } |
| 214 } | 220 } |
| 215 } | 221 } |
| 216 | 222 |
| 217 bool OutputSurface::SurfaceIsSuspendForRecycle() const { | 223 bool OutputSurface::SurfaceIsSuspendForRecycle() const { |
| 218 return false; | 224 return false; |
| 219 } | 225 } |
| 220 | 226 |
| 221 } // namespace cc | 227 } // namespace cc |
| OLD | NEW |