Chromium Code Reviews| Index: cc/trees/layer_tree_host.cc |
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
| index 367a84758691e0c35123ee287630b2f8557b9e7c..d82727f78dae79e12a0e3b191baebe077d3fa4c3 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -165,29 +165,7 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) { |
| DCHECK(output_surface_lost_); |
| if (success) { |
| output_surface_lost_ = false; |
| - |
| - // Update settings_ based on capabilities that we got back from the |
| - // renderer. |
| - settings_.accelerate_painting = |
| - proxy_->GetRendererCapabilities().using_accelerated_painting; |
| - |
| - // Update settings_ based on partial update capability. |
| - size_t max_partial_texture_updates = 0; |
| - if (proxy_->GetRendererCapabilities().allow_partial_texture_updates && |
| - !settings_.impl_side_painting) { |
| - max_partial_texture_updates = std::min( |
| - settings_.max_partial_texture_updates, |
| - proxy_->MaxPartialTextureUpdates()); |
| - } |
| - settings_.max_partial_texture_updates = max_partial_texture_updates; |
| - |
| - if (!contents_texture_manager_) { |
| - contents_texture_manager_ = |
| - PrioritizedResourceManager::Create(proxy_.get()); |
| - surface_memory_placeholder_ = |
| - contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA); |
| - } |
| - |
| + DidUpdateCapabilities(); |
| client_->DidInitializeOutputSurface(true); |
| return CreateSucceeded; |
| } |
| @@ -210,6 +188,29 @@ LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) { |
| return CreateFailedButTryAgain; |
| } |
| +void LayerTreeHost::DidUpdateCapabilities() { |
| + // Update settings_ based on capabilities that we got back from the |
| + // renderer. |
|
danakj
2013/05/21 14:00:49
weird indenting going on here
|
| + settings_.accelerate_painting = |
| + proxy_->GetRendererCapabilities().using_accelerated_painting; |
| + // Update settings_ based on partial update capability. |
| + size_t max_partial_texture_updates = 0; |
| + if (proxy_->GetRendererCapabilities().allow_partial_texture_updates && |
| + !settings_.impl_side_painting) { |
| + max_partial_texture_updates = std::min( |
| + settings_.max_partial_texture_updates, |
| + proxy_->MaxPartialTextureUpdates()); |
| + } |
| + settings_.max_partial_texture_updates = max_partial_texture_updates; |
| + |
| + if (!contents_texture_manager_) { |
|
danakj
2013/05/21 14:00:49
i don't really get why this would belong here, thi
|
| + contents_texture_manager_ = |
| + PrioritizedResourceManager::Create(proxy_.get()); |
| + surface_memory_placeholder_ = |
| + contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA); |
| + } |
| +} |
| + |
| void LayerTreeHost::DeleteContentsTexturesOnImplThread( |
| ResourceProvider* resource_provider) { |
| DCHECK(proxy_->IsImplThread()); |