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

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: 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
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() {
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | content/common/gpu/client/context_provider_command_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698