Index: cc/output/gl_renderer.cc |
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc |
index 10985875d8c36122453ee585c8d6dc85bad36621..5335ea72fde2d0ff3cb5ac7290fb696779d0a564 100644 |
--- a/cc/output/gl_renderer.cc |
+++ b/cc/output/gl_renderer.cc |
@@ -163,7 +163,10 @@ class GLRenderer::ScopedUseGrContext { |
public: |
static scoped_ptr<ScopedUseGrContext> Create(GLRenderer* renderer, |
DrawingFrame* frame) { |
- return make_scoped_ptr(new ScopedUseGrContext(renderer, frame)); |
+ // GrContext creation may fail. |
+ if (renderer->output_surface_->context_provider()->GrContext()) |
+ return make_scoped_ptr(new ScopedUseGrContext(renderer, frame)); |
+ return nullptr; |
} |
~ScopedUseGrContext() { |