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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1139463004: cc: Validate that GPU rasterization is usable in UpdateGpuRasterizationStatus(). (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7ae1945a2e0514a1330623bdadb1916cb5bd837c 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1613,6 +1613,17 @@ void LayerTreeHostImpl::UpdateGpuRasterizationStatus() {
gpu_rasterization_status_ = GpuRasterizationStatus::OFF_CONTENT;
}
+ if (use_gpu) {
danakj 2015/05/13 20:47:49 I think this is better than making InitializeRende
+ // Ensure that a GrContext is initialized for GPU rasterization.
+ if (!output_surface_->context_provider() ||
+ !output_surface_->worker_context_provider() ||
+ !output_surface_->worker_context_provider()->GrContext()) {
+ use_gpu = false;
+ use_msaa = false;
+ gpu_rasterization_status_ = GpuRasterizationStatus::OFF_DEVICE;
+ }
+ }
+
if (use_gpu == use_gpu_rasterization_ && use_msaa == use_msaa_)
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698