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 "ui/compositor/test/in_process_context_provider.h" | 5 #include "ui/compositor/test/in_process_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 "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 gr_context_.get()->resetContext(state); | 182 gr_context_.get()->resetContext(state); |
183 } | 183 } |
184 | 184 |
185 void InProcessContextProvider::SetupLock() { | 185 void InProcessContextProvider::SetupLock() { |
186 } | 186 } |
187 | 187 |
188 base::Lock* InProcessContextProvider::GetLock() { | 188 base::Lock* InProcessContextProvider::GetLock() { |
189 return &context_lock_; | 189 return &context_lock_; |
190 } | 190 } |
191 | 191 |
192 bool InProcessContextProvider::IsContextLost() { | |
193 DCHECK(context_thread_checker_.CalledOnValidThread()); | |
194 | |
195 base::AutoLock lock(destroyed_lock_); | |
196 return destroyed_; | |
197 } | |
198 | |
199 void InProcessContextProvider::VerifyContexts() { | 192 void InProcessContextProvider::VerifyContexts() { |
200 } | 193 } |
201 | 194 |
202 void InProcessContextProvider::DeleteCachedResources() { | 195 void InProcessContextProvider::DeleteCachedResources() { |
203 DCHECK(context_thread_checker_.CalledOnValidThread()); | 196 DCHECK(context_thread_checker_.CalledOnValidThread()); |
204 | 197 |
205 if (gr_context_) { | 198 if (gr_context_) { |
206 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", | 199 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", |
207 TRACE_EVENT_SCOPE_THREAD); | 200 TRACE_EVENT_SCOPE_THREAD); |
208 gr_context_->freeGpuResources(); | 201 gr_context_->freeGpuResources(); |
(...skipping 25 matching lines...) Expand all Loading... |
234 return; | 227 return; |
235 destroyed_ = true; | 228 destroyed_ = true; |
236 } | 229 } |
237 if (!lost_context_callback_.is_null()) | 230 if (!lost_context_callback_.is_null()) |
238 base::ResetAndReturn(&lost_context_callback_).Run(); | 231 base::ResetAndReturn(&lost_context_callback_).Run(); |
239 if (gr_context_) | 232 if (gr_context_) |
240 gr_context_->abandonContext(); | 233 gr_context_->abandonContext(); |
241 } | 234 } |
242 | 235 |
243 } // namespace ui | 236 } // namespace ui |
OLD | NEW |