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

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

Issue 2193293004: cc: Make LayerTreeTests use a DelegatingRenderer and Display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: display-layertreetest: self-nits Created 4 years, 4 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 // If the root render surface has no visible damage, then don't generate a 788 // If the root render surface has no visible damage, then don't generate a
789 // frame at all. 789 // frame at all.
790 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface(); 790 RenderSurfaceImpl* root_surface = active_tree_->RootRenderSurface();
791 bool root_surface_has_no_visible_damage = 791 bool root_surface_has_no_visible_damage =
792 !root_surface->damage_tracker()->current_damage_rect().Intersects( 792 !root_surface->damage_tracker()->current_damage_rect().Intersects(
793 root_surface->content_rect()); 793 root_surface->content_rect());
794 bool root_surface_has_contributing_layers = 794 bool root_surface_has_contributing_layers =
795 !root_surface->layer_list().empty(); 795 !root_surface->layer_list().empty();
796 bool hud_wants_to_draw_ = active_tree_->hud_layer() && 796 bool hud_wants_to_draw_ = active_tree_->hud_layer() &&
797 active_tree_->hud_layer()->IsAnimatingHUDContents(); 797 active_tree_->hud_layer()->IsAnimatingHUDContents();
798 bool resources_must_be_resent =
799 output_surface_->capabilities().can_force_reclaim_resources;
798 if (root_surface_has_contributing_layers && 800 if (root_surface_has_contributing_layers &&
799 root_surface_has_no_visible_damage && 801 root_surface_has_no_visible_damage &&
800 !active_tree_->property_trees()->effect_tree.HasCopyRequests() && 802 !active_tree_->property_trees()->effect_tree.HasCopyRequests() &&
801 !output_surface_->capabilities().can_force_reclaim_resources && 803 !resources_must_be_resent && !hud_wants_to_draw_) {
802 !hud_wants_to_draw_) {
803 TRACE_EVENT0("cc", 804 TRACE_EVENT0("cc",
804 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect"); 805 "LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect");
805 frame->has_no_damage = true; 806 frame->has_no_damage = true;
806 DCHECK(!resourceless_software_draw_); 807 DCHECK(!resourceless_software_draw_);
807 return DRAW_SUCCESS; 808 return DRAW_SUCCESS;
808 } 809 }
809 810
810 TRACE_EVENT_BEGIN2( 811 TRACE_EVENT_BEGIN2(
811 "cc", "LayerTreeHostImpl::CalculateRenderPasses", 812 "cc", "LayerTreeHostImpl::CalculateRenderPasses",
812 "render_surface_layer_list.size()", 813 "render_surface_layer_list.size()",
(...skipping 3223 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 return task_runner_provider_->HasImplThread(); 4037 return task_runner_provider_->HasImplThread();
4037 } 4038 }
4038 4039
4039 bool LayerTreeHostImpl::CommitToActiveTree() const { 4040 bool LayerTreeHostImpl::CommitToActiveTree() const {
4040 // In single threaded mode we skip the pending tree and commit directly to the 4041 // In single threaded mode we skip the pending tree and commit directly to the
4041 // active tree. 4042 // active tree.
4042 return !task_runner_provider_->HasImplThread(); 4043 return !task_runner_provider_->HasImplThread();
4043 } 4044 }
4044 4045
4045 } // namespace cc 4046 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698