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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1413153014: Add a flag for enabling compositor property trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 6ba1153b0b2022b5783b0f975c1582918511524a..3432a23bc37c66fe43c581f8eebdf7d4693f559d 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -646,8 +646,9 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
settings().can_use_lcd_text, settings().layers_always_allowed_lcd_text,
can_render_to_separate_surface,
settings().layer_transforms_should_scale_layer_contents,
- settings().verify_property_trees, &render_surface_layer_list_,
- render_surface_layer_list_id_, &property_trees_);
+ settings().verify_property_trees, settings().use_property_trees,
+ &render_surface_layer_list_, render_surface_layer_list_id_,
+ &property_trees_);
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
}
@@ -1538,10 +1539,11 @@ struct FindScrollingLayerFunctor {
LayerImpl* LayerTreeImpl::FindFirstScrollingLayerThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
FindClosestMatchingLayerDataForRecursion data_for_recursion;
+ bool use_property_trees =
+ settings().use_property_trees || settings().verify_property_trees;
FindClosestMatchingLayer(
screen_space_point, root_layer(), FindScrollingLayerFunctor(),
- property_trees_.transform_tree, settings().verify_property_trees,
- &data_for_recursion);
+ property_trees_.transform_tree, use_property_trees, &data_for_recursion);
return data_for_recursion.closest_match;
}
@@ -1561,11 +1563,12 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint(
bool update_lcd_text = false;
if (!UpdateDrawProperties(update_lcd_text))
return NULL;
+ bool use_property_trees =
+ settings().use_property_trees || settings().verify_property_trees;
FindClosestMatchingLayerDataForRecursion data_for_recursion;
FindClosestMatchingLayer(screen_space_point, root_layer(),
HitTestVisibleScrollableOrTouchableFunctor(),
- property_trees_.transform_tree,
- settings().verify_property_trees,
+ property_trees_.transform_tree, use_property_trees,
&data_for_recursion);
return data_for_recursion.closest_match;
}
@@ -1607,11 +1610,13 @@ LayerImpl* LayerTreeImpl::FindLayerWithWheelHandlerThatIsHitByPoint(
bool update_lcd_text = false;
if (!UpdateDrawProperties(update_lcd_text))
return NULL;
+ bool use_property_trees =
+ settings().use_property_trees || settings().verify_property_trees;
FindWheelEventLayerFunctor func;
FindClosestMatchingLayerDataForRecursion data_for_recursion;
- FindClosestMatchingLayer(
- screen_space_point, root_layer(), func, property_trees_.transform_tree,
- settings().verify_property_trees, &data_for_recursion);
+ FindClosestMatchingLayer(screen_space_point, root_layer(), func,
+ property_trees_.transform_tree, use_property_trees,
+ &data_for_recursion);
return data_for_recursion.closest_match;
}
@@ -1632,13 +1637,14 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion(
bool update_lcd_text = false;
if (!UpdateDrawProperties(update_lcd_text))
return NULL;
- FindTouchEventLayerFunctor func = {screen_space_point,
- property_trees_.transform_tree,
- settings().verify_property_trees};
+ bool use_property_trees =
+ settings().use_property_trees || settings().verify_property_trees;
+ FindTouchEventLayerFunctor func = {
+ screen_space_point, property_trees_.transform_tree, use_property_trees};
FindClosestMatchingLayerDataForRecursion data_for_recursion;
- FindClosestMatchingLayer(
- screen_space_point, root_layer(), func, property_trees_.transform_tree,
- settings().verify_property_trees, &data_for_recursion);
+ FindClosestMatchingLayer(screen_space_point, root_layer(), func,
+ property_trees_.transform_tree, use_property_trees,
+ &data_for_recursion);
return data_for_recursion.closest_match;
}
@@ -1705,11 +1711,13 @@ static ViewportSelectionBound ComputeViewportSelectionBound(
void LayerTreeImpl::GetViewportSelection(ViewportSelection* selection) {
DCHECK(selection);
+ bool use_property_trees =
+ settings().use_property_trees || settings().verify_property_trees;
selection->start = ComputeViewportSelectionBound(
selection_.start,
selection_.start.layer_id ? LayerById(selection_.start.layer_id) : NULL,
device_scale_factor(), property_trees_.transform_tree,
- settings().verify_property_trees);
+ use_property_trees);
selection->is_editable = selection_.is_editable;
selection->is_empty_text_form_control = selection_.is_empty_text_form_control;
if (selection->start.type == SELECTION_BOUND_CENTER ||
@@ -1720,7 +1728,7 @@ void LayerTreeImpl::GetViewportSelection(ViewportSelection* selection) {
selection_.end,
selection_.end.layer_id ? LayerById(selection_.end.layer_id) : NULL,
device_scale_factor(), property_trees_.transform_tree,
- settings().verify_property_trees);
+ use_property_trees);
}
}

Powered by Google App Engine
This is Rietveld 408576698