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

Unified Diff: cc/test/test_context_provider.cc

Issue 988953002: gpu-raster: Check for NULL sk_surface in GpuRasterizer::RasterizeSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test. 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
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() {

Powered by Google App Engine
This is Rietveld 408576698