Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 187343007: Adding fading effect for paint rectangles in HUD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 709
710 // If the root render surface has no visible damage, then don't generate a 710 // If the root render surface has no visible damage, then don't generate a
711 // frame at all. 711 // frame at all.
712 RenderSurfaceImpl* root_surface = 712 RenderSurfaceImpl* root_surface =
713 active_tree_->root_layer()->render_surface(); 713 active_tree_->root_layer()->render_surface();
714 bool root_surface_has_no_visible_damage = 714 bool root_surface_has_no_visible_damage =
715 !root_surface->damage_tracker()->current_damage_rect().Intersects( 715 !root_surface->damage_tracker()->current_damage_rect().Intersects(
716 root_surface->content_rect()); 716 root_surface->content_rect());
717 bool root_surface_has_contributing_layers = 717 bool root_surface_has_contributing_layers =
718 !root_surface->layer_list().empty(); 718 !root_surface->layer_list().empty();
719 bool hud_wants_to_draw_ = active_tree_->hud_layer() &&
720 active_tree_->hud_layer()->IsAnimatingHUDContents();
719 if (root_surface_has_contributing_layers && 721 if (root_surface_has_contributing_layers &&
720 root_surface_has_no_visible_damage && 722 root_surface_has_no_visible_damage &&
721 active_tree_->LayersWithCopyOutputRequest().empty()) { 723 active_tree_->LayersWithCopyOutputRequest().empty() &&
724 !hud_wants_to_draw_) {
722 TRACE_EVENT0("cc", 725 TRACE_EVENT0("cc",
723 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); 726 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect");
724 frame->has_no_damage = true; 727 frame->has_no_damage = true;
725 DCHECK(!output_surface_->capabilities() 728 DCHECK(!output_surface_->capabilities()
726 .draw_and_swap_full_viewport_every_frame); 729 .draw_and_swap_full_viewport_every_frame);
727 return DrawSwapReadbackResult::DRAW_SUCCESS; 730 return DrawSwapReadbackResult::DRAW_SUCCESS;
728 } 731 }
729 732
730 TRACE_EVENT1("cc", 733 TRACE_EVENT1("cc",
731 "LayerTreeHostImpl::CalculateRenderPasses", 734 "LayerTreeHostImpl::CalculateRenderPasses",
(...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 swap_promise_monitor_.erase(monitor); 3032 swap_promise_monitor_.erase(monitor);
3030 } 3033 }
3031 3034
3032 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3035 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3033 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3036 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3034 for (; it != swap_promise_monitor_.end(); it++) 3037 for (; it != swap_promise_monitor_.end(); it++)
3035 (*it)->OnSetNeedsRedrawOnImpl(); 3038 (*it)->OnSetNeedsRedrawOnImpl();
3036 } 3039 }
3037 3040
3038 } // namespace cc 3041 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698