| 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..d5f0b64a6020ab6aed1a9c9db00d39459b750d33 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 (gr_context_ && 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() {
|
|
|