OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/compositor/blimp_context_provider.h" | 5 #include "blimp/client/compositor/blimp_context_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "gpu/command_buffer/client/gl_in_process_context.h" | 10 #include "gpu/command_buffer/client/gl_in_process_context.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 if (gr_context_) | 145 if (gr_context_) |
146 gr_context_->freeGpuResources(); | 146 gr_context_->freeGpuResources(); |
147 } | 147 } |
148 | 148 |
149 void BlimpContextProvider::SetLostContextCallback( | 149 void BlimpContextProvider::SetLostContextCallback( |
150 const LostContextCallback& lost_context_callback) { | 150 const LostContextCallback& lost_context_callback) { |
151 DCHECK(context_thread_checker_.CalledOnValidThread()); | 151 DCHECK(context_thread_checker_.CalledOnValidThread()); |
152 lost_context_callback_ = lost_context_callback; | 152 lost_context_callback_ = lost_context_callback; |
153 } | 153 } |
154 | 154 |
| 155 void BlimpContextProvider::SetMemoryPolicyChangedCallback( |
| 156 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
| 157 // There's no memory manager for the in-process implementation. |
| 158 // TODO(dtrainor): Figure out if we need a memory manager for Blimp. |
| 159 } |
| 160 |
155 void BlimpContextProvider::OnLostContext() { | 161 void BlimpContextProvider::OnLostContext() { |
156 DCHECK(context_thread_checker_.CalledOnValidThread()); | 162 DCHECK(context_thread_checker_.CalledOnValidThread()); |
157 if (!lost_context_callback_.is_null()) | 163 if (!lost_context_callback_.is_null()) |
158 base::ResetAndReturn(&lost_context_callback_).Run(); | 164 base::ResetAndReturn(&lost_context_callback_).Run(); |
159 if (gr_context_) | 165 if (gr_context_) |
160 gr_context_->abandonContext(); | 166 gr_context_->abandonContext(); |
161 } | 167 } |
162 | 168 |
163 } // namespace blimp | 169 } // namespace blimp |
OLD | NEW |