| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // frame at all. | 708 // frame at all. |
| 709 RenderSurfaceImpl* root_surface = | 709 RenderSurfaceImpl* root_surface = |
| 710 active_tree_->root_layer()->render_surface(); | 710 active_tree_->root_layer()->render_surface(); |
| 711 bool root_surface_has_no_visible_damage = | 711 bool root_surface_has_no_visible_damage = |
| 712 !root_surface->damage_tracker()->current_damage_rect().Intersects( | 712 !root_surface->damage_tracker()->current_damage_rect().Intersects( |
| 713 root_surface->content_rect()); | 713 root_surface->content_rect()); |
| 714 bool root_surface_has_contributing_layers = | 714 bool root_surface_has_contributing_layers = |
| 715 !root_surface->layer_list().empty(); | 715 !root_surface->layer_list().empty(); |
| 716 if (root_surface_has_contributing_layers && | 716 if (root_surface_has_contributing_layers && |
| 717 root_surface_has_no_visible_damage && | 717 root_surface_has_no_visible_damage && |
| 718 active_tree_->LayersWithCopyOutputRequest().empty()) { | 718 active_tree_->LayersWithCopyOutputRequest().empty() && |
| 719 (!active_tree_->hud_layer() || |
| 720 !active_tree_->hud_layer()->NeedsUpdate())) { |
| 719 TRACE_EVENT0("cc", | 721 TRACE_EVENT0("cc", |
| 720 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); | 722 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); |
| 721 frame->has_no_damage = true; | 723 frame->has_no_damage = true; |
| 722 DCHECK(!output_surface_->capabilities() | 724 DCHECK(!output_surface_->capabilities() |
| 723 .draw_and_swap_full_viewport_every_frame); | 725 .draw_and_swap_full_viewport_every_frame); |
| 724 return DrawSwapReadbackResult::DRAW_SUCCESS; | 726 return DrawSwapReadbackResult::DRAW_SUCCESS; |
| 725 } | 727 } |
| 726 | 728 |
| 727 TRACE_EVENT1("cc", | 729 TRACE_EVENT1("cc", |
| 728 "LayerTreeHostImpl::CalculateRenderPasses", | 730 "LayerTreeHostImpl::CalculateRenderPasses", |
| (...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3027 swap_promise_monitor_.erase(monitor); | 3029 swap_promise_monitor_.erase(monitor); |
| 3028 } | 3030 } |
| 3029 | 3031 |
| 3030 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3032 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
| 3031 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3033 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 3032 for (; it != swap_promise_monitor_.end(); it++) | 3034 for (; it != swap_promise_monitor_.end(); it++) |
| 3033 (*it)->OnSetNeedsRedrawOnImpl(); | 3035 (*it)->OnSetNeedsRedrawOnImpl(); |
| 3034 } | 3036 } |
| 3035 | 3037 |
| 3036 } // namespace cc | 3038 } // namespace cc |
| OLD | NEW |