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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
782 root_surface->content_rect()); | 782 root_surface->content_rect()); |
783 bool root_surface_has_contributing_layers = | 783 bool root_surface_has_contributing_layers = |
784 !root_surface->layer_list().empty(); | 784 !root_surface->layer_list().empty(); |
785 bool hud_wants_to_draw_ = active_tree_->hud_layer() && | 785 bool hud_wants_to_draw_ = active_tree_->hud_layer() && |
786 active_tree_->hud_layer()->IsAnimatingHUDContents(); | 786 active_tree_->hud_layer()->IsAnimatingHUDContents(); |
787 bool resources_must_be_resent = | 787 bool resources_must_be_resent = |
788 compositor_frame_sink_->capabilities().can_force_reclaim_resources; | 788 compositor_frame_sink_->capabilities().can_force_reclaim_resources; |
789 if (root_surface_has_contributing_layers && | 789 if (root_surface_has_contributing_layers && |
790 root_surface_has_no_visible_damage && | 790 root_surface_has_no_visible_damage && |
791 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && | 791 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && |
792 !resources_must_be_resent && !hud_wants_to_draw_) { | 792 !resources_must_be_resent && !hud_wants_to_draw_ && |
793 !frame->handle_visibility_changed) { | |
danakj
2016/10/20 22:40:26
I think you could use a local variable here instea
| |
793 TRACE_EVENT0("cc", | 794 TRACE_EVENT0("cc", |
794 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); | 795 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); |
795 frame->has_no_damage = true; | 796 frame->has_no_damage = true; |
796 DCHECK(!resourceless_software_draw_); | 797 DCHECK(!resourceless_software_draw_); |
797 return DRAW_SUCCESS; | 798 return DRAW_SUCCESS; |
798 } | 799 } |
799 | 800 |
800 TRACE_EVENT_BEGIN2( | 801 TRACE_EVENT_BEGIN2( |
801 "cc", "LayerTreeHostImpl::CalculateRenderPasses", | 802 "cc", "LayerTreeHostImpl::CalculateRenderPasses", |
802 "render_surface_layer_list.size()", | 803 "render_surface_layer_list.size()", |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1081 // This will cause NotifyTileStateChanged() to be called for any tiles that | 1082 // This will cause NotifyTileStateChanged() to be called for any tiles that |
1082 // completed, which will add damage for visible tiles to the frame for them so | 1083 // completed, which will add damage for visible tiles to the frame for them so |
1083 // they appear as part of the current frame being drawn. | 1084 // they appear as part of the current frame being drawn. |
1084 tile_manager_.Flush(); | 1085 tile_manager_.Flush(); |
1085 | 1086 |
1086 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); | 1087 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); |
1087 frame->render_passes.clear(); | 1088 frame->render_passes.clear(); |
1088 frame->will_draw_layers.clear(); | 1089 frame->will_draw_layers.clear(); |
1089 frame->has_no_damage = false; | 1090 frame->has_no_damage = false; |
1090 frame->may_contain_video = false; | 1091 frame->may_contain_video = false; |
1092 frame->handle_visibility_changed = handle_visibility_changed_; | |
1093 | |
1094 handle_visibility_changed_ = false; | |
1091 | 1095 |
1092 if (active_tree_->RootRenderSurface()) { | 1096 if (active_tree_->RootRenderSurface()) { |
1093 gfx::Rect device_viewport_damage_rect = viewport_damage_rect_; | 1097 gfx::Rect device_viewport_damage_rect = viewport_damage_rect_; |
1094 viewport_damage_rect_ = gfx::Rect(); | 1098 viewport_damage_rect_ = gfx::Rect(); |
1095 | 1099 |
1096 active_tree_->RootRenderSurface()->damage_tracker()->AddDamageNextUpdate( | 1100 active_tree_->RootRenderSurface()->damage_tracker()->AddDamageNextUpdate( |
1097 device_viewport_damage_rect); | 1101 device_viewport_damage_rect); |
1098 } | 1102 } |
1099 | 1103 |
1100 DrawResult draw_result = CalculateRenderPasses(frame); | 1104 DrawResult draw_result = CalculateRenderPasses(frame); |
(...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4102 if (is_visible) { | 4106 if (is_visible) { |
4103 worker_context_visibility_ = | 4107 worker_context_visibility_ = |
4104 worker_context->CacheController()->ClientBecameVisible(); | 4108 worker_context->CacheController()->ClientBecameVisible(); |
4105 } else { | 4109 } else { |
4106 worker_context->CacheController()->ClientBecameNotVisible( | 4110 worker_context->CacheController()->ClientBecameNotVisible( |
4107 std::move(worker_context_visibility_)); | 4111 std::move(worker_context_visibility_)); |
4108 } | 4112 } |
4109 } | 4113 } |
4110 | 4114 |
4111 } // namespace cc | 4115 } // namespace cc |
OLD | NEW |