| 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); | 766 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); |
| 767 bool root_surface_has_no_visible_damage = | 767 bool root_surface_has_no_visible_damage = |
| 768 !root_surface->damage_tracker()->current_damage_rect().Intersects( | 768 !root_surface->damage_tracker()->current_damage_rect().Intersects( |
| 769 root_surface->content_rect()); | 769 root_surface->content_rect()); |
| 770 bool root_surface_has_contributing_layers = | 770 bool root_surface_has_contributing_layers = |
| 771 !root_surface->layer_list().empty(); | 771 !root_surface->layer_list().empty(); |
| 772 bool hud_wants_to_draw_ = active_tree_->hud_layer() && | 772 bool hud_wants_to_draw_ = active_tree_->hud_layer() && |
| 773 active_tree_->hud_layer()->IsAnimatingHUDContents(); | 773 active_tree_->hud_layer()->IsAnimatingHUDContents(); |
| 774 bool resources_must_be_resent = | 774 bool resources_must_be_resent = |
| 775 compositor_frame_sink_->capabilities().can_force_reclaim_resources; | 775 compositor_frame_sink_->capabilities().can_force_reclaim_resources; |
| 776 // When touch handle visibility changes there is no visible damage |
| 777 // because touch handles are composited in the browser. However we |
| 778 // still want the browser to be notified that the handles changed |
| 779 // through the |ViewHostMsg_SwapCompositorFrame| IPC so we keep |
| 780 // track of handle visibility changes through |handle_visibility_changed|. |
| 781 bool handle_visibility_changed = |
| 782 active_tree_->GetAndResetHandleVisibilityChanged(); |
| 776 if (root_surface_has_contributing_layers && | 783 if (root_surface_has_contributing_layers && |
| 777 root_surface_has_no_visible_damage && | 784 root_surface_has_no_visible_damage && |
| 778 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && | 785 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && |
| 779 !resources_must_be_resent && !hud_wants_to_draw_) { | 786 !resources_must_be_resent && !hud_wants_to_draw_ && |
| 787 !handle_visibility_changed) { |
| 780 TRACE_EVENT0("cc", | 788 TRACE_EVENT0("cc", |
| 781 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); | 789 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); |
| 782 frame->has_no_damage = true; | 790 frame->has_no_damage = true; |
| 783 DCHECK(!resourceless_software_draw_); | 791 DCHECK(!resourceless_software_draw_); |
| 784 return DRAW_SUCCESS; | 792 return DRAW_SUCCESS; |
| 785 } | 793 } |
| 786 | 794 |
| 787 TRACE_EVENT_BEGIN2( | 795 TRACE_EVENT_BEGIN2( |
| 788 "cc", "LayerTreeHostImpl::CalculateRenderPasses", | 796 "cc", "LayerTreeHostImpl::CalculateRenderPasses", |
| 789 "render_surface_layer_list.size()", | 797 "render_surface_layer_list.size()", |
| (...skipping 3285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4075 worker_context_visibility_ = | 4083 worker_context_visibility_ = |
| 4076 worker_context->CacheController()->ClientBecameVisible(); | 4084 worker_context->CacheController()->ClientBecameVisible(); |
| 4077 } else { | 4085 } else { |
| 4078 worker_context->CacheController()->ClientBecameNotVisible( | 4086 worker_context->CacheController()->ClientBecameNotVisible( |
| 4079 std::move(worker_context_visibility_)); | 4087 std::move(worker_context_visibility_)); |
| 4080 } | 4088 } |
| 4081 } | 4089 } |
| 4082 } | 4090 } |
| 4083 | 4091 |
| 4084 } // namespace cc | 4092 } // namespace cc |
| OLD | NEW |