summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_common.cc
diff options
context:
space:
mode:
authorjaydasika <jaydasika@chromium.org>2015-07-14 08:15:04 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-14 15:16:04 +0000
commitd36e7fa1ce7503fa9c64e3271e1a831c5f3aec50 (patch)
treeeedacbefb51ef514b84e78ad8ef7b98deb397052 /cc/trees/layer_tree_host_common.cc
parenta8c375bf808b8b169e4303deeac4cce20c786d29 (diff)
downloadchromium_src-d36e7fa1ce7503fa9c64e3271e1a831c5f3aec50.zip
chromium_src-d36e7fa1ce7503fa9c64e3271e1a831c5f3aec50.tar.gz
chromium_src-d36e7fa1ce7503fa9c64e3271e1a831c5f3aec50.tar.bz2
Compute if a layer is clipped outside CalcDrawProps
We need to know if a layer is clipped to compute its drawable visible rect. So, we need to compute it outside CalcDrawProps to move drawable visible rect computation outside CalcDrawProps. Committed: https://crrev.com/2af7226e29be65a8ea4a279b9358a6fcfada5cd3 Cr-Commit-Position: refs/heads/master@{#338515} CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1231453002 Cr-Commit-Position: refs/heads/master@{#338691}
Diffstat (limited to 'cc/trees/layer_tree_host_common.cc')
-rw-r--r--cc/trees/layer_tree_host_common.cc38
1 files changed, 20 insertions, 18 deletions
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 427a3c8..9989031 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -2047,7 +2047,7 @@ static void CalculateDrawPropertiesInternal(
// reduce how much would be drawn, and instead it would create unnecessary
// changes to scissor state affecting GPU performance. Our clip information
// is used in the recursion below, so we must set it beforehand.
- layer_draw_properties.is_clipped = layer_or_ancestor_clips_descendants;
+ DCHECK_EQ(layer_or_ancestor_clips_descendants, layer->is_clipped());
if (layer_or_ancestor_clips_descendants) {
layer_draw_properties.clip_rect = clip_rect_in_target_space;
} else {
@@ -2487,6 +2487,7 @@ void VerifyPropertyTreeValuesForLayer(LayerImpl* current_layer,
<< "expected: " << current_layer->draw_opacity()
<< " actual: " << DrawOpacityFromPropertyTrees(
current_layer, property_trees->opacity_tree);
+
const bool can_use_lcd_text_match =
CanUseLcdTextFromPropertyTrees(
current_layer, layers_always_allowed_lcd_text, can_use_lcd_text,
@@ -2536,22 +2537,6 @@ void CalculateDrawPropertiesAndVerify(LayerTreeHostCommon::CalcDrawPropsInputs<
inputs->verify_property_trees &&
(property_tree_option == BUILD_PROPERTY_TREES_IF_NEEDED);
- if (should_measure_property_tree_performance) {
- TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
- "LayerTreeHostCommon::CalculateDrawProperties");
- }
-
- std::vector<AccumulatedSurfaceState<LayerType>> accumulated_surface_state;
- CalculateDrawPropertiesInternal<LayerType>(
- inputs->root_layer, globals, data_for_recursion,
- inputs->render_surface_layer_list, &dummy_layer_list,
- &accumulated_surface_state, inputs->current_render_surface_layer_list_id);
-
- if (should_measure_property_tree_performance) {
- TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
- "LayerTreeHostCommon::CalculateDrawProperties");
- }
-
if (inputs->verify_property_trees) {
typename LayerType::LayerListType update_layer_list;
@@ -2594,10 +2579,27 @@ void CalculateDrawPropertiesAndVerify(LayerTreeHostCommon::CalcDrawPropsInputs<
break;
}
}
+ }
- VerifyPropertyTreeValues(inputs);
+ if (should_measure_property_tree_performance) {
+ TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
+ "LayerTreeHostCommon::CalculateDrawProperties");
}
+ std::vector<AccumulatedSurfaceState<LayerType>> accumulated_surface_state;
+ CalculateDrawPropertiesInternal<LayerType>(
+ inputs->root_layer, globals, data_for_recursion,
+ inputs->render_surface_layer_list, &dummy_layer_list,
+ &accumulated_surface_state, inputs->current_render_surface_layer_list_id);
+
+ if (should_measure_property_tree_performance) {
+ TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
+ "LayerTreeHostCommon::CalculateDrawProperties");
+ }
+
+ if (inputs->verify_property_trees)
+ VerifyPropertyTreeValues(inputs);
+
// The dummy layer list should not have been used.
DCHECK_EQ(0u, dummy_layer_list.size());
// A root layer render_surface should always exist after