Chromium Code Reviews| 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..ddd48770539fe21ca2e3bd07ca91b0e28ba61ab8 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -195,6 +195,7 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
| use_gpu_rasterization_(false), |
| use_msaa_(false), |
| gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE), |
| + tree_resources_for_gpu_rasterization_dirty_(false), |
| input_handler_client_(NULL), |
| did_lock_scrolling_layer_(false), |
| should_bubble_scrolls_(false), |
| @@ -308,7 +309,7 @@ void LayerTreeHostImpl::BeginCommit() { |
| void LayerTreeHostImpl::CommitComplete() { |
| TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| - UpdateGpuRasterizationStatus(); |
| + UpdateTreeResourcesForGpuRasterizationIfNeeded(); |
|
danakj
2015/05/13 20:21:57
can you comment that LTH sets stuff and this is ac
Stephen White
2015/05/13 20:38:35
Done.
|
| sync_tree()->set_needs_update_draw_properties(); |
| if (settings_.impl_side_painting) { |
| @@ -1621,6 +1622,14 @@ void LayerTreeHostImpl::UpdateGpuRasterizationStatus() { |
| use_gpu_rasterization_ = use_gpu; |
| use_msaa_ = use_msaa; |
| + tree_resources_for_gpu_rasterization_dirty_ = true; |
| +} |
| + |
| +void LayerTreeHostImpl::UpdateTreeResourcesForGpuRasterizationIfNeeded() { |
| + if (!tree_resources_for_gpu_rasterization_dirty_) { |
|
danakj
2015/05/13 20:21:57
nit: no {}
Stephen White
2015/05/13 20:38:35
Done.
|
| + return; |
| + } |
| + |
| // Clean up and replace existing tile manager with another one that uses |
| // appropriate rasterizer. |
| ReleaseTreeResources(); |
| @@ -1634,6 +1643,8 @@ void LayerTreeHostImpl::UpdateGpuRasterizationStatus() { |
| // We would not have any content to draw until the pending tree is activated. |
| // Prevent the active tree from drawing until activation. |
| SetRequiresHighResToDraw(); |
| + |
| + tree_resources_for_gpu_rasterization_dirty_ = false; |
| } |
| const RendererCapabilitiesImpl& |
| @@ -1990,8 +2001,6 @@ void LayerTreeHostImpl::CreateAndSetRenderer() { |
| } |
| DCHECK(renderer_); |
| - // Since the new renderer may be capable of MSAA, update status here. |
| - UpdateGpuRasterizationStatus(); |
| renderer_->SetVisible(visible_); |
| SetFullRootLayerDamage(); |
| @@ -2176,6 +2185,9 @@ bool LayerTreeHostImpl::InitializeRenderer( |
| CreateAndSetRenderer(); |
| + // Since the new renderer may be capable of MSAA, update status here. |
| + UpdateGpuRasterizationStatus(); |
| + |
| if (settings_.impl_side_painting && settings_.raster_enabled) |
| CreateAndSetTileManager(); |
| RecreateTreeResources(); |