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

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

Issue 2861593004: Replace three callsites to LayerImpl::GetRenderSurface with effect tree calls. (Closed)
Patch Set: Created 3 years, 7 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/trees/layer_tree_impl.h ('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_impl.h" 5 #include "cc/trees/layer_tree_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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 scrollbar->SetScrollLayerLength(scroll_size.height()); 254 scrollbar->SetScrollLayerLength(scroll_size.height());
255 } 255 }
256 scrollbar->SetVerticalAdjust(clip_layer->ViewportBoundsDelta().y()); 256 scrollbar->SetVerticalAdjust(clip_layer->ViewportBoundsDelta().y());
257 } 257 }
258 258
259 if (y_offset_did_change && IsViewportLayerId(scroll_layer_id)) 259 if (y_offset_did_change && IsViewportLayerId(scroll_layer_id))
260 TRACE_COUNTER_ID1("cc", "scroll_offset_y", scroll_layer->id(), 260 TRACE_COUNTER_ID1("cc", "scroll_offset_y", scroll_layer->id(),
261 current_offset.y()); 261 current_offset.y());
262 } 262 }
263 263
264 RenderSurfaceImpl* LayerTreeImpl::RootRenderSurface() const { 264 const RenderSurfaceImpl* LayerTreeImpl::RootRenderSurface() const {
265 return layer_list_.empty() ? nullptr : layer_list_[0]->GetRenderSurface(); 265 return property_trees_.effect_tree.GetRenderSurface(
266 EffectTree::kContentsRootNodeId);
266 } 267 }
267 268
268 bool LayerTreeImpl::LayerListIsEmpty() const { 269 bool LayerTreeImpl::LayerListIsEmpty() const {
269 return layer_list_.empty(); 270 return layer_list_.empty();
270 } 271 }
271 272
272 void LayerTreeImpl::SetRootLayerForTesting(std::unique_ptr<LayerImpl> layer) { 273 void LayerTreeImpl::SetRootLayerForTesting(std::unique_ptr<LayerImpl> layer) {
273 if (root_layer_for_testing_ && layer.get() != root_layer_for_testing_) 274 if (root_layer_for_testing_ && layer.get() != root_layer_for_testing_)
274 RemoveLayer(root_layer_for_testing_->id()); 275 RemoveLayer(root_layer_for_testing_->id());
275 root_layer_for_testing_ = layer.get(); 276 root_layer_for_testing_ = layer.get();
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 UMA_HISTOGRAM_COUNTS_100( 1053 UMA_HISTOGRAM_COUNTS_100(
1053 base::StringPrintf("Compositing.%s.NumRenderSurfaces", client_name), 1054 base::StringPrintf("Compositing.%s.NumRenderSurfaces", client_name),
1054 base::saturated_cast<int>(render_surface_list_.size())); 1055 base::saturated_cast<int>(render_surface_list_.size()));
1055 } 1056 }
1056 } 1057 }
1057 1058
1058 { 1059 {
1059 TRACE_EVENT2("cc", "LayerTreeImpl::UpdateDrawProperties::Occlusion", 1060 TRACE_EVENT2("cc", "LayerTreeImpl::UpdateDrawProperties::Occlusion",
1060 "IsActive", IsActiveTree(), "SourceFrameNumber", 1061 "IsActive", IsActiveTree(), "SourceFrameNumber",
1061 source_frame_number_); 1062 source_frame_number_);
1062 OcclusionTracker occlusion_tracker( 1063 OcclusionTracker occlusion_tracker(RootRenderSurface()->content_rect());
1063 layer_list_[0]->GetRenderSurface()->content_rect());
1064 occlusion_tracker.set_minimum_tracking_size( 1064 occlusion_tracker.set_minimum_tracking_size(
1065 settings().minimum_occlusion_tracking_size); 1065 settings().minimum_occlusion_tracking_size);
1066 1066
1067 for (EffectTreeLayerListIterator it(this); 1067 for (EffectTreeLayerListIterator it(this);
1068 it.state() != EffectTreeLayerListIterator::State::END; ++it) { 1068 it.state() != EffectTreeLayerListIterator::State::END; ++it) {
1069 occlusion_tracker.EnterLayer(it); 1069 occlusion_tracker.EnterLayer(it);
1070 1070
1071 if (it.state() == EffectTreeLayerListIterator::State::LAYER) { 1071 if (it.state() == EffectTreeLayerListIterator::State::LAYER) {
1072 LayerImpl* layer = it.current_layer(); 1072 LayerImpl* layer = it.current_layer();
1073 layer->draw_properties().occlusion_in_content_space = 1073 layer->draw_properties().occlusion_in_content_space =
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 2120
2121 void LayerTreeImpl::ResetAllChangeTracking() { 2121 void LayerTreeImpl::ResetAllChangeTracking() {
2122 layers_that_should_push_properties_.clear(); 2122 layers_that_should_push_properties_.clear();
2123 // Iterate over all layers, including masks. 2123 // Iterate over all layers, including masks.
2124 for (auto& layer : *layers_) 2124 for (auto& layer : *layers_)
2125 layer->ResetChangeTracking(); 2125 layer->ResetChangeTracking();
2126 property_trees_.ResetAllChangeTracking(); 2126 property_trees_.ResetAllChangeTracking();
2127 } 2127 }
2128 2128
2129 } // namespace cc 2129 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698