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

Unified Diff: cc/test/test_context_provider.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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/layer_tree_test.cc ('k') | cc/test/test_web_graphics_context_3d.cc » ('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 bf85ea3a7d735f413479a31c0c060ffce841d117..7c9bb2ce07592171a5f7f91db0420bd916668e0d 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -104,6 +104,11 @@ class GrContext* TestContextProvider::GrContext() {
gl_context->makeCurrent();
gr_context_ = skia::AdoptRef(GrContext::Create(
kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(gl_context->gl())));
+
+ // If GlContext is already lost, also abandon the new GrContext.
+ if (IsContextLost())
+ gr_context_->abandonContext();
+
return gr_context_.get();
}
@@ -151,6 +156,8 @@ void TestContextProvider::OnLostContext() {
}
if (!lost_context_callback_.is_null())
base::ResetAndReturn(&lost_context_callback_).Run();
+ if (gr_context_)
+ gr_context_->abandonContext();
}
TestWebGraphicsContext3D* TestContextProvider::TestContext3d() {
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/test_web_graphics_context_3d.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698