| 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 a84cae68e8a9810023078b5d9789d8d731c480a8..e468c07dc6ebe751ed9168f35d84c5166af44c6b 100644
|
| --- a/cc/trees/layer_tree_host_common.cc
|
| +++ b/cc/trees/layer_tree_host_common.cc
|
| @@ -2495,12 +2495,6 @@ static bool ApproximatelyEqual(const gfx::Rect& r1, const gfx::Rect& r2) {
|
| std::abs(r1.height() - r2.height()) <= tolerance;
|
| }
|
|
|
| -static bool ApproximatelyEqual(const gfx::Transform& a,
|
| - const gfx::Transform& b) {
|
| - static const float tolerance = 0.01f;
|
| - return gfx::MatrixDistance(a, b) < tolerance;
|
| -}
|
| -
|
| void LayerTreeHostCommon::CalculateDrawProperties(
|
| CalcDrawPropsMainInputs* inputs) {
|
| UpdateRenderSurfaces(inputs->root_layer,
|
| @@ -2512,30 +2506,42 @@ void LayerTreeHostCommon::CalculateDrawProperties(
|
| ProcessCalcDrawPropsInputs(*inputs, &globals, &data_for_recursion);
|
|
|
| PreCalculateMetaInformationRecursiveData recursive_data;
|
| - PreCalculateMetaInformation(inputs->root_layer, &recursive_data);
|
| - std::vector<AccumulatedSurfaceState<Layer>> accumulated_surface_state;
|
| - CalculateDrawPropertiesInternal<Layer>(
|
| - 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);
|
|
|
| - // 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
|
| - // CalculateDrawProperties.
|
| - DCHECK(inputs->root_layer->render_surface());
|
| + if (!inputs->verify_property_trees) {
|
| + PreCalculateMetaInformation(inputs->root_layer, &recursive_data);
|
| + std::vector<AccumulatedSurfaceState<Layer>> accumulated_surface_state;
|
| + CalculateDrawPropertiesInternal<Layer>(
|
| + 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);
|
| + } else {
|
| + {
|
| + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
|
| + "LayerTreeHostCommon::CalculateDrawProperties");
|
| + PreCalculateMetaInformation(inputs->root_layer, &recursive_data);
|
| + std::vector<AccumulatedSurfaceState<Layer>> accumulated_surface_state;
|
| + CalculateDrawPropertiesInternal<Layer>(
|
| + 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 (inputs->verify_property_trees) {
|
| // The translation from layer to property trees is an intermediate state. We
|
| // will eventually get these data passed directly to the compositor.
|
| TransformTree transform_tree;
|
| ClipTree clip_tree;
|
| OpacityTree opacity_tree;
|
| - ComputeVisibleRectsUsingPropertyTrees(
|
| - inputs->root_layer, inputs->page_scale_application_layer,
|
| - inputs->page_scale_factor, inputs->device_scale_factor,
|
| - gfx::Rect(inputs->device_viewport_size), inputs->device_transform,
|
| - &transform_tree, &clip_tree, &opacity_tree);
|
| + {
|
| + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"),
|
| + "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees");
|
| + ComputeVisibleRectsUsingPropertyTrees(
|
| + inputs->root_layer, inputs->page_scale_application_layer,
|
| + inputs->page_scale_factor, inputs->device_scale_factor,
|
| + gfx::Rect(inputs->device_viewport_size), inputs->device_transform,
|
| + &transform_tree, &clip_tree, &opacity_tree);
|
| + }
|
|
|
| LayerIterator<Layer> it, end;
|
| for (it = LayerIterator<Layer>::Begin(inputs->render_surface_layer_list),
|
| @@ -2550,17 +2556,18 @@ void LayerTreeHostCommon::CalculateDrawProperties(
|
| current_layer->visible_rect_from_property_trees());
|
| CHECK(visible_rects_match);
|
|
|
| - const bool draw_transforms_match = ApproximatelyEqual(
|
| - current_layer->draw_transform(),
|
| - current_layer->draw_transform_from_property_trees(transform_tree));
|
| - CHECK(draw_transforms_match);
|
| -
|
| const bool draw_opacities_match =
|
| current_layer->draw_opacity() ==
|
| current_layer->DrawOpacityFromPropertyTrees(opacity_tree);
|
| CHECK(draw_opacities_match);
|
| }
|
| }
|
| +
|
| + // 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
|
| + // CalculateDrawProperties.
|
| + DCHECK(inputs->root_layer->render_surface());
|
| }
|
|
|
| void LayerTreeHostCommon::CalculateDrawProperties(
|
|
|