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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 2495123002: Make all scrollable layers visible to hit testing. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 7f9740274e8d10f86eb8876be8840694f72a0b80..8fcfccb40fc134d241b735e252a32bc00f60c940 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -212,15 +212,8 @@ static inline void ClearMaskLayersAreDrawnRenderSurfaceLayerListMembers(
static inline void ClearIsDrawnRenderSurfaceLayerListMember(
LayerImplList* layer_list,
ScrollTree* scroll_tree) {
- for (LayerImpl* layer : *layer_list) {
- if (layer->is_drawn_render_surface_layer_list_member()) {
- DCHECK_GT(
- scroll_tree->Node(layer->scroll_tree_index())->num_drawn_descendants,
- 0);
- scroll_tree->Node(layer->scroll_tree_index())->num_drawn_descendants--;
- }
+ for (LayerImpl* layer : *layer_list)
layer->set_is_drawn_render_surface_layer_list_member(false);
- }
}
static bool CdpPerfTracingEnabled() {
@@ -293,33 +286,11 @@ enum PropertyTreeOption {
DONT_BUILD_PROPERTY_TREES
};
-static void ComputeLayerScrollsDrawnDescendants(LayerTreeImpl* layer_tree_impl,
- ScrollTree* scroll_tree) {
- for (int i = static_cast<int>(scroll_tree->size()) - 1; i > 0; --i) {
- ScrollNode* node = scroll_tree->Node(i);
- scroll_tree->parent(node)->num_drawn_descendants +=
- node->num_drawn_descendants;
- }
- for (LayerImpl* layer : *layer_tree_impl) {
- bool scrolls_drawn_descendant = false;
- if (layer->scrollable()) {
- ScrollNode* node = scroll_tree->Node(layer->scroll_tree_index());
- if (node->num_drawn_descendants > 0)
- scrolls_drawn_descendant = true;
- }
- layer->set_scrolls_drawn_descendant(scrolls_drawn_descendant);
- }
-}
-
static void ComputeInitialRenderSurfaceLayerList(
LayerTreeImpl* layer_tree_impl,
PropertyTrees* property_trees,
LayerImplList* render_surface_layer_list,
bool can_render_to_separate_surface) {
- ScrollTree* scroll_tree = &property_trees->scroll_tree;
- for (int i = 0; i < static_cast<int>(scroll_tree->size()); ++i)
- scroll_tree->Node(i)->num_drawn_descendants = 0;
-
// Add all non-skipped surfaces to the initial render surface layer list. Add
// all non-skipped layers to the layer list of their target surface, and
// add their content rect to their target surface's accumulated content rect.
@@ -391,7 +362,6 @@ static void ComputeInitialRenderSurfaceLayerList(
continue;
layer->set_is_drawn_render_surface_layer_list_member(true);
- scroll_tree->Node(layer->scroll_tree_index())->num_drawn_descendants++;
layer->render_target()->layer_list().push_back(layer);
// The layer contributes its drawable content rect to its render target.
@@ -487,9 +457,6 @@ static void CalculateRenderSurfaceLayerList(
ComputeListOfNonEmptySurfaces(layer_tree_impl, property_trees,
&initial_render_surface_list,
render_surface_layer_list);
-
- ComputeLayerScrollsDrawnDescendants(layer_tree_impl,
- &property_trees->scroll_tree);
}
void CalculateDrawPropertiesInternal(
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698