| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 // Create the render passes in dependency order. | 802 // Create the render passes in dependency order. |
| 803 size_t render_surface_layer_list_size = | 803 size_t render_surface_layer_list_size = |
| 804 frame->render_surface_layer_list->size(); | 804 frame->render_surface_layer_list->size(); |
| 805 for (size_t i = 0; i < render_surface_layer_list_size; ++i) { | 805 for (size_t i = 0; i < render_surface_layer_list_size; ++i) { |
| 806 size_t surface_index = render_surface_layer_list_size - 1 - i; | 806 size_t surface_index = render_surface_layer_list_size - 1 - i; |
| 807 LayerImpl* render_surface_layer = | 807 LayerImpl* render_surface_layer = |
| 808 (*frame->render_surface_layer_list)[surface_index]; | 808 (*frame->render_surface_layer_list)[surface_index]; |
| 809 RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); | 809 RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); |
| 810 | 810 |
| 811 bool should_draw_into_render_pass = | 811 bool should_draw_into_render_pass = |
| 812 render_surface_layer->parent() == NULL || | 812 active_tree_->IsRootLayer(render_surface_layer) || |
| 813 render_surface->contributes_to_drawn_surface() || | 813 render_surface->contributes_to_drawn_surface() || |
| 814 render_surface_layer->HasCopyRequest(); | 814 render_surface_layer->HasCopyRequest(); |
| 815 if (should_draw_into_render_pass) | 815 if (should_draw_into_render_pass) |
| 816 render_surface->AppendRenderPasses(frame); | 816 render_surface->AppendRenderPasses(frame); |
| 817 } | 817 } |
| 818 | 818 |
| 819 // When we are displaying the HUD, change the root damage rect to cover the | 819 // When we are displaying the HUD, change the root damage rect to cover the |
| 820 // entire root surface. This will disable partial-swap/scissor optimizations | 820 // entire root surface. This will disable partial-swap/scissor optimizations |
| 821 // that would prevent the HUD from updating, since the HUD does not cause | 821 // that would prevent the HUD from updating, since the HUD does not cause |
| 822 // damage itself, to prevent it from messing with damage visualizations. Since | 822 // damage itself, to prevent it from messing with damage visualizations. Since |
| (...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3922 return task_runner_provider_->HasImplThread(); | 3922 return task_runner_provider_->HasImplThread(); |
| 3923 } | 3923 } |
| 3924 | 3924 |
| 3925 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3925 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 3926 // In single threaded mode we skip the pending tree and commit directly to the | 3926 // In single threaded mode we skip the pending tree and commit directly to the |
| 3927 // active tree. | 3927 // active tree. |
| 3928 return !task_runner_provider_->HasImplThread(); | 3928 return !task_runner_provider_->HasImplThread(); |
| 3929 } | 3929 } |
| 3930 | 3930 |
| 3931 } // namespace cc | 3931 } // namespace cc |
| OLD | NEW |