| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 DrawResult LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) { | 774 DrawResult LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) { |
| 775 DCHECK(frame->render_passes.empty()); | 775 DCHECK(frame->render_passes.empty()); |
| 776 DCHECK(CanDraw()); | 776 DCHECK(CanDraw()); |
| 777 DCHECK(!active_tree_->LayerListIsEmpty()); | 777 DCHECK(!active_tree_->LayerListIsEmpty()); |
| 778 | 778 |
| 779 TrackDamageForAllSurfaces(*frame->render_surface_layer_list); | 779 TrackDamageForAllSurfaces(*frame->render_surface_layer_list); |
| 780 | 780 |
| 781 // If the root render surface has no visible damage, then don't generate a | 781 // If the root render surface has no visible damage, then don't generate a |
| 782 // frame at all. | 782 // frame at all. |
| 783 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); | 783 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); |
| 784 gfx::Rect damage_rect; |
| 785 bool is_rect_valid = |
| 786 root_surface->damage_tracker()->GetDamageRectIfValid(&damage_rect); |
| 784 bool root_surface_has_no_visible_damage = | 787 bool root_surface_has_no_visible_damage = |
| 785 !root_surface->damage_tracker()->current_damage_rect().Intersects( | 788 is_rect_valid && !damage_rect.Intersects(root_surface->content_rect()); |
| 786 root_surface->content_rect()); | |
| 787 bool root_surface_has_contributing_layers = | 789 bool root_surface_has_contributing_layers = |
| 788 !root_surface->layer_list().empty(); | 790 !root_surface->layer_list().empty(); |
| 789 bool hud_wants_to_draw_ = active_tree_->hud_layer() && | 791 bool hud_wants_to_draw_ = active_tree_->hud_layer() && |
| 790 active_tree_->hud_layer()->IsAnimatingHUDContents(); | 792 active_tree_->hud_layer()->IsAnimatingHUDContents(); |
| 791 bool resources_must_be_resent = | 793 bool resources_must_be_resent = |
| 792 compositor_frame_sink_->capabilities().can_force_reclaim_resources; | 794 compositor_frame_sink_->capabilities().can_force_reclaim_resources; |
| 793 // When touch handle visibility changes there is no visible damage | 795 // When touch handle visibility changes there is no visible damage |
| 794 // because touch handles are composited in the browser. However we | 796 // because touch handles are composited in the browser. However we |
| 795 // still want the browser to be notified that the handles changed | 797 // still want the browser to be notified that the handles changed |
| 796 // through the |ViewHostMsg_SwapCompositorFrame| IPC so we keep | 798 // through the |ViewHostMsg_SwapCompositorFrame| IPC so we keep |
| (...skipping 3303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4100 worker_context_visibility_ = | 4102 worker_context_visibility_ = |
| 4101 worker_context->CacheController()->ClientBecameVisible(); | 4103 worker_context->CacheController()->ClientBecameVisible(); |
| 4102 } else { | 4104 } else { |
| 4103 worker_context->CacheController()->ClientBecameNotVisible( | 4105 worker_context->CacheController()->ClientBecameNotVisible( |
| 4104 std::move(worker_context_visibility_)); | 4106 std::move(worker_context_visibility_)); |
| 4105 } | 4107 } |
| 4106 } | 4108 } |
| 4107 } | 4109 } |
| 4108 | 4110 |
| 4109 } // namespace cc | 4111 } // namespace cc |
| OLD | NEW |