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

Unified Diff: cc/trees/layer_tree_host_impl.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: Create and check GrContext early in LTHI::InitializeRenderer() 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/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 0bf40594b49d519a242d450b1859190577331892..986ddaf0a3eaa990bf9c48ede51359992ce4c5a8 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2166,6 +2166,16 @@ bool LayerTreeHostImpl::InitializeRenderer(
return false;
}
+ if (use_gpu_rasterization_) {
danakj 2015/05/12 23:40:43 This can be changed by CreateAndSetRenderer below
vmiura 2015/05/13 02:53:00 Thanks for spotting this. Hmm, I think it could a
piman 2015/05/13 03:28:36 We can simply rely on settings_.gpu_rasterization_
Stephen White 2015/05/13 10:10:13 In that case, you should probably check settings_.
+ // Ensure we have a GrContext for GPU rasterization.
+ ContextProvider* context_provider =
+ output_surface->worker_context_provider();
+ if (!context_provider)
piman 2015/05/12 23:33:50 nit: you can probably DCHECK this.
+ return false;
+ if (!context_provider->GrContext())
+ return false;
+ }
+
output_surface_ = output_surface.Pass();
resource_provider_ = ResourceProvider::Create(
output_surface_.get(), shared_bitmap_manager_, gpu_memory_buffer_manager_,

Powered by Google App Engine
This is Rietveld 408576698