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