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

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: 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
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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 712
713 // If the root render surface has no visible damage, then don't generate a 713 // If the root render surface has no visible damage, then don't generate a
714 // frame at all. 714 // frame at all.
715 RenderSurfaceImpl* root_surface = 715 RenderSurfaceImpl* root_surface =
716 active_tree_->root_layer()->render_surface(); 716 active_tree_->root_layer()->render_surface();
717 bool root_surface_has_no_visible_damage = 717 bool root_surface_has_no_visible_damage =
718 !root_surface->damage_tracker()->current_damage_rect().Intersects( 718 !root_surface->damage_tracker()->current_damage_rect().Intersects(
719 root_surface->content_rect()); 719 root_surface->content_rect());
720 bool root_surface_has_contributing_layers = 720 bool root_surface_has_contributing_layers =
721 !root_surface->layer_list().empty(); 721 !root_surface->layer_list().empty();
722 bool hud_wants_to_draw_ = active_tree_->hud_layer() &&
723 active_tree_->hud_layer()->IsAnimatingHUDContents();
722 if (root_surface_has_contributing_layers && 724 if (root_surface_has_contributing_layers &&
723 root_surface_has_no_visible_damage && 725 root_surface_has_no_visible_damage &&
724 active_tree_->LayersWithCopyOutputRequest().empty()) { 726 active_tree_->LayersWithCopyOutputRequest().empty() &&
727 !hud_wants_to_draw_) {
725 TRACE_EVENT0("cc", 728 TRACE_EVENT0("cc",
726 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); 729 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect");
727 frame->has_no_damage = true; 730 frame->has_no_damage = true;
728 DCHECK(!output_surface_->capabilities() 731 DCHECK(!output_surface_->capabilities()
729 .draw_and_swap_full_viewport_every_frame); 732 .draw_and_swap_full_viewport_every_frame);
730 return DrawSwapReadbackResult::DRAW_SUCCESS; 733 return DrawSwapReadbackResult::DRAW_SUCCESS;
731 } 734 }
732 735
733 TRACE_EVENT1("cc", 736 TRACE_EVENT1("cc",
734 "LayerTreeHostImpl::CalculateRenderPasses", 737 "LayerTreeHostImpl::CalculateRenderPasses",
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 swap_promise_monitor_.erase(monitor); 3039 swap_promise_monitor_.erase(monitor);
3037 } 3040 }
3038 3041
3039 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3042 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3040 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3043 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3041 for (; it != swap_promise_monitor_.end(); it++) 3044 for (; it != swap_promise_monitor_.end(); it++)
3042 (*it)->OnSetNeedsRedrawOnImpl(); 3045 (*it)->OnSetNeedsRedrawOnImpl();
3043 } 3046 }
3044 3047
3045 } // namespace cc 3048 } // namespace cc
OLDNEW
« cc/layers/heads_up_display_layer_impl.cc ('K') | « 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