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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); | 783 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); |
784 bool root_surface_has_no_visible_damage = | 784 bool root_surface_has_no_visible_damage = |
785 !root_surface->damage_tracker()->current_damage_rect().Intersects( | 785 !root_surface->damage_tracker()->current_damage_rect().Intersects( |
786 root_surface->content_rect()); | 786 root_surface->content_rect()); |
787 bool root_surface_has_contributing_layers = | 787 bool root_surface_has_contributing_layers = |
788 !root_surface->layer_list().empty(); | 788 !root_surface->layer_list().empty(); |
789 bool hud_wants_to_draw_ = active_tree_->hud_layer() && | 789 bool hud_wants_to_draw_ = active_tree_->hud_layer() && |
790 active_tree_->hud_layer()->IsAnimatingHUDContents(); | 790 active_tree_->hud_layer()->IsAnimatingHUDContents(); |
791 bool resources_must_be_resent = | 791 bool resources_must_be_resent = |
792 compositor_frame_sink_->capabilities().can_force_reclaim_resources; | 792 compositor_frame_sink_->capabilities().can_force_reclaim_resources; |
| 793 // When touch handle visibility changes there is no visible damage |
| 794 // because touch handles are composited in the browser. However we |
| 795 // still want the browser to be notified that the handles changed |
| 796 // through the |ViewHostMsg_SwapCompositorFrame| IPC so we keep |
| 797 // track of handle visibility changes through |handle_visibility_changed|. |
| 798 bool handle_visibility_changed = |
| 799 active_tree_->GetAndResetHandleVisibilityChanged(); |
793 if (root_surface_has_contributing_layers && | 800 if (root_surface_has_contributing_layers && |
794 root_surface_has_no_visible_damage && | 801 root_surface_has_no_visible_damage && |
795 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && | 802 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && |
796 !resources_must_be_resent && !hud_wants_to_draw_) { | 803 !resources_must_be_resent && !hud_wants_to_draw_ && |
| 804 !handle_visibility_changed) { |
797 TRACE_EVENT0("cc", | 805 TRACE_EVENT0("cc", |
798 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); | 806 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); |
799 frame->has_no_damage = true; | 807 frame->has_no_damage = true; |
800 DCHECK(!resourceless_software_draw_); | 808 DCHECK(!resourceless_software_draw_); |
801 return DRAW_SUCCESS; | 809 return DRAW_SUCCESS; |
802 } | 810 } |
803 | 811 |
804 TRACE_EVENT_BEGIN2( | 812 TRACE_EVENT_BEGIN2( |
805 "cc", "LayerTreeHostImpl::CalculateRenderPasses", | 813 "cc", "LayerTreeHostImpl::CalculateRenderPasses", |
806 "render_surface_layer_list.size()", | 814 "render_surface_layer_list.size()", |
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4094 worker_context_visibility_ = | 4102 worker_context_visibility_ = |
4095 worker_context->CacheController()->ClientBecameVisible(); | 4103 worker_context->CacheController()->ClientBecameVisible(); |
4096 } else { | 4104 } else { |
4097 worker_context->CacheController()->ClientBecameNotVisible( | 4105 worker_context->CacheController()->ClientBecameNotVisible( |
4098 std::move(worker_context_visibility_)); | 4106 std::move(worker_context_visibility_)); |
4099 } | 4107 } |
4100 } | 4108 } |
4101 } | 4109 } |
4102 | 4110 |
4103 } // namespace cc | 4111 } // namespace cc |
OLD | NEW |