| 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 // If the root render surface has no visible damage, then don't generate a | 788 // If the root render surface has no visible damage, then don't generate a |
| 789 // frame at all. | 789 // frame at all. |
| 790 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); | 790 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); |
| 791 bool root_surface_has_no_visible_damage = | 791 bool root_surface_has_no_visible_damage = |
| 792 !root_surface->damage_tracker()->current_damage_rect().Intersects( | 792 !root_surface->damage_tracker()->current_damage_rect().Intersects( |
| 793 root_surface->content_rect()); | 793 root_surface->content_rect()); |
| 794 bool root_surface_has_contributing_layers = | 794 bool root_surface_has_contributing_layers = |
| 795 !root_surface->layer_list().empty(); | 795 !root_surface->layer_list().empty(); |
| 796 bool hud_wants_to_draw_ = active_tree_->hud_layer() && | 796 bool hud_wants_to_draw_ = active_tree_->hud_layer() && |
| 797 active_tree_->hud_layer()->IsAnimatingHUDContents(); | 797 active_tree_->hud_layer()->IsAnimatingHUDContents(); |
| 798 bool resources_must_be_resent = | |
| 799 output_surface_->capabilities().can_force_reclaim_resources; | |
| 800 if (root_surface_has_contributing_layers && | 798 if (root_surface_has_contributing_layers && |
| 801 root_surface_has_no_visible_damage && | 799 root_surface_has_no_visible_damage && |
| 802 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && | 800 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && |
| 803 !resources_must_be_resent && !hud_wants_to_draw_) { | 801 !output_surface_->capabilities().can_force_reclaim_resources && |
| 802 !hud_wants_to_draw_) { |
| 804 TRACE_EVENT0("cc", | 803 TRACE_EVENT0("cc", |
| 805 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); | 804 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); |
| 806 frame->has_no_damage = true; | 805 frame->has_no_damage = true; |
| 807 DCHECK(!resourceless_software_draw_); | 806 DCHECK(!resourceless_software_draw_); |
| 808 return DRAW_SUCCESS; | 807 return DRAW_SUCCESS; |
| 809 } | 808 } |
| 810 | 809 |
| 811 TRACE_EVENT_BEGIN2( | 810 TRACE_EVENT_BEGIN2( |
| 812 "cc", "LayerTreeHostImpl::CalculateRenderPasses", | 811 "cc", "LayerTreeHostImpl::CalculateRenderPasses", |
| 813 "render_surface_layer_list.size()", | 812 "render_surface_layer_list.size()", |
| (...skipping 3223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4037 return task_runner_provider_->HasImplThread(); | 4036 return task_runner_provider_->HasImplThread(); |
| 4038 } | 4037 } |
| 4039 | 4038 |
| 4040 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4039 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 4041 // In single threaded mode we skip the pending tree and commit directly to the | 4040 // In single threaded mode we skip the pending tree and commit directly to the |
| 4042 // active tree. | 4041 // active tree. |
| 4043 return !task_runner_provider_->HasImplThread(); | 4042 return !task_runner_provider_->HasImplThread(); |
| 4044 } | 4043 } |
| 4045 | 4044 |
| 4046 } // namespace cc | 4045 } // namespace cc |
| OLD | NEW |