Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: ui/compositor/test/in_process_context_provider.cc

Issue 1168943002: Remove ContextProvider::IsContextLost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contextprovider: . Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/compositor/test/in_process_context_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698