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

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

Issue 1882413006: cc: Construct the RSLL without using layer hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 8 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_host_impl_unittest.cc ('k') | cc/trees/property_tree.h » ('j') | 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 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 1753
1754 if (!state->closest_match || in_front_of_previous_candidate) { 1754 if (!state->closest_match || in_front_of_previous_candidate) {
1755 state->closest_distance = distance_to_intersection; 1755 state->closest_distance = distance_to_intersection;
1756 state->closest_match = layer; 1756 state->closest_match = layer;
1757 } 1757 }
1758 } 1758 }
1759 } 1759 }
1760 1760
1761 static bool ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember( 1761 static bool ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(
1762 LayerImpl* layer) { 1762 LayerImpl* layer) {
1763 if (!layer->scrollable() && !layer->ToScrollbarLayer()) 1763 return layer->scrolls_drawn_descendant() ||
1764 return false; 1764 (layer->ToScrollbarLayer() &&
1765 if (layer->layer_or_descendant_is_drawn()) 1765 layer->IsDrawnRenderSurfaceLayerListMember());
1766 return true;
1767
1768 if (!layer->scroll_children())
1769 return false;
1770 for (std::set<LayerImpl*>::const_iterator it =
1771 layer->scroll_children()->begin();
1772 it != layer->scroll_children()->end(); ++it) {
1773 if ((*it)->layer_or_descendant_is_drawn())
1774 return true;
1775 }
1776 return false;
1777 } 1766 }
1778 1767
1779 struct FindScrollingLayerOrScrollbarLayerFunctor { 1768 struct FindScrollingLayerOrScrollbarLayerFunctor {
1780 bool operator()(LayerImpl* layer) const { 1769 bool operator()(LayerImpl* layer) const {
1781 return ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer); 1770 return ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer);
1782 } 1771 }
1783 }; 1772 };
1784 1773
1785 LayerImpl* 1774 LayerImpl*
1786 LayerTreeImpl::FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint( 1775 LayerTreeImpl::FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 } 2097 }
2109 2098
2110 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { 2099 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) {
2111 layers_that_should_push_properties_.clear(); 2100 layers_that_should_push_properties_.clear();
2112 for (auto* layer : *this) 2101 for (auto* layer : *this)
2113 layer->ResetChangeTracking(); 2102 layer->ResetChangeTracking();
2114 property_trees_.ResetAllChangeTracking(flag); 2103 property_trees_.ResetAllChangeTracking(flag);
2115 } 2104 }
2116 2105
2117 } // namespace cc 2106 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698