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

Unified Diff: cc/output/gl_renderer.cc

Issue 1135743004: cc: Add null checks for GrContext created by ContextProviderCommandBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worker context provider's lock must be held during GrContext creation. Created 5 years, 7 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 | « no previous file | cc/test/fake_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index bdb537aa6627d34d7be142c772419ce6ce5fe301..93a4114e2b204f9a5454740b94882eebacef8b7b 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -163,7 +163,13 @@ class GLRenderer::ScopedUseGrContext {
public:
static scoped_ptr<ScopedUseGrContext> Create(GLRenderer* renderer,
DrawingFrame* frame) {
- return make_scoped_ptr(new ScopedUseGrContext(renderer, frame));
+ // GrContext for filters is created lazily, and may fail if the context
+ // is lost.
+ // TODO(vmiura,bsalomon): crbug.com/487850 Ensure that
+ // ContextProvider::GrContext() does not return NULL.
+ if (renderer->output_surface_->context_provider()->GrContext())
+ return make_scoped_ptr(new ScopedUseGrContext(renderer, frame));
+ return nullptr;
}
~ScopedUseGrContext() {
« no previous file with comments | « no previous file | cc/test/fake_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698