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

Unified Diff: cc/test/test_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_gles2_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_context_provider.cc
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index 2bf803c19f612a377419993ccd896cf94cc1decd..ca7714d30cf9f4ca1b0eaaaeb7c117f7ddd180de 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -55,7 +55,7 @@ bool TestContextProvider::BindToCurrentThread() {
if (bound_)
return true;
- if (context3d_->isContextLost()) {
+ if (context_gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR) {
base::AutoLock lock(destroyed_lock_);
destroyed_ = true;
return false;
@@ -106,7 +106,7 @@ class GrContext* TestContextProvider::GrContext() {
kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(gl_context->gl())));
// If GlContext is already lost, also abandon the new GrContext.
- if (IsContextLost())
+ if (ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR)
gr_context_->abandonContext();
return gr_context_.get();
@@ -127,18 +127,11 @@ base::Lock* TestContextProvider::GetLock() {
return &context_lock_;
}
-bool TestContextProvider::IsContextLost() {
- DCHECK(bound_);
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- return context3d_->isContextLost();
-}
-
void TestContextProvider::VerifyContexts() {
DCHECK(bound_);
DCHECK(context_thread_checker_.CalledOnValidThread());
- if (context3d_->isContextLost()) {
+ if (ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR) {
base::AutoLock lock(destroyed_lock_);
destroyed_ = true;
}
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_gles2_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698