| OLD | NEW |
| 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_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } | 551 } |
| 552 | 552 |
| 553 draw_property_utils::BuildPropertyTreesAndComputeVisibleRects( | 553 draw_property_utils::BuildPropertyTreesAndComputeVisibleRects( |
| 554 inputs->root_layer, inputs->page_scale_layer, | 554 inputs->root_layer, inputs->page_scale_layer, |
| 555 inputs->inner_viewport_scroll_layer, | 555 inputs->inner_viewport_scroll_layer, |
| 556 inputs->outer_viewport_scroll_layer, | 556 inputs->outer_viewport_scroll_layer, |
| 557 inputs->elastic_overscroll_application_layer, | 557 inputs->elastic_overscroll_application_layer, |
| 558 inputs->elastic_overscroll, inputs->page_scale_factor, | 558 inputs->elastic_overscroll, inputs->page_scale_factor, |
| 559 inputs->device_scale_factor, gfx::Rect(inputs->device_viewport_size), | 559 inputs->device_scale_factor, gfx::Rect(inputs->device_viewport_size), |
| 560 inputs->device_transform, inputs->can_render_to_separate_surface, | 560 inputs->device_transform, inputs->can_render_to_separate_surface, |
| 561 inputs->verify_visible_rect_calculations, inputs->property_trees, | 561 inputs->property_trees, &visible_layer_list); |
| 562 &visible_layer_list); | |
| 563 | 562 |
| 564 // Property trees are normally constructed on the main thread and | 563 // Property trees are normally constructed on the main thread and |
| 565 // passed to compositor thread. Source to parent updates on them are not | 564 // passed to compositor thread. Source to parent updates on them are not |
| 566 // allowed in the compositor thread. Some tests build them on the | 565 // allowed in the compositor thread. Some tests build them on the |
| 567 // compositor thread, so we need to explicitly disallow source to parent | 566 // compositor thread, so we need to explicitly disallow source to parent |
| 568 // updates when they are built on compositor thread. | 567 // updates when they are built on compositor thread. |
| 569 inputs->property_trees->transform_tree | 568 inputs->property_trees->transform_tree |
| 570 .set_source_to_parent_updates_allowed(false); | 569 .set_source_to_parent_updates_allowed(false); |
| 571 if (should_measure_property_tree_performance) { | 570 if (should_measure_property_tree_performance) { |
| 572 TRACE_EVENT_END0( | 571 TRACE_EVENT_END0( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 594 // Similarly, the device viewport and device transform are shared | 593 // Similarly, the device viewport and device transform are shared |
| 595 // by both trees. | 594 // by both trees. |
| 596 inputs->property_trees->clip_tree.SetViewportClip( | 595 inputs->property_trees->clip_tree.SetViewportClip( |
| 597 gfx::RectF(gfx::SizeF(inputs->device_viewport_size))); | 596 gfx::RectF(gfx::SizeF(inputs->device_viewport_size))); |
| 598 inputs->property_trees->transform_tree.SetDeviceTransform( | 597 inputs->property_trees->transform_tree.SetDeviceTransform( |
| 599 inputs->device_transform, inputs->root_layer->position()); | 598 inputs->device_transform, inputs->root_layer->position()); |
| 600 inputs->property_trees->transform_tree.SetDeviceTransformScaleFactor( | 599 inputs->property_trees->transform_tree.SetDeviceTransformScaleFactor( |
| 601 inputs->device_transform); | 600 inputs->device_transform); |
| 602 draw_property_utils::ComputeVisibleRects( | 601 draw_property_utils::ComputeVisibleRects( |
| 603 inputs->root_layer, inputs->property_trees, | 602 inputs->root_layer, inputs->property_trees, |
| 604 inputs->can_render_to_separate_surface, | 603 inputs->can_render_to_separate_surface, &visible_layer_list); |
| 605 inputs->verify_visible_rect_calculations, &visible_layer_list); | |
| 606 break; | 604 break; |
| 607 } | 605 } |
| 608 } | 606 } |
| 609 | 607 |
| 610 if (should_measure_property_tree_performance) { | 608 if (should_measure_property_tree_performance) { |
| 611 TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"), | 609 TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"), |
| 612 "LayerTreeHostCommon::CalculateDrawProperties"); | 610 "LayerTreeHostCommon::CalculateDrawProperties"); |
| 613 } | 611 } |
| 614 | 612 |
| 615 DCHECK(inputs->can_render_to_separate_surface == | 613 DCHECK(inputs->can_render_to_separate_surface == |
| 616 inputs->property_trees->non_root_surfaces_enabled); | 614 inputs->property_trees->non_root_surfaces_enabled); |
| 617 for (LayerImpl* layer : visible_layer_list) { | 615 for (LayerImpl* layer : visible_layer_list) { |
| 618 draw_property_utils::ComputeLayerDrawProperties(layer, | 616 draw_property_utils::ComputeLayerDrawProperties(layer, |
| 619 inputs->property_trees); | 617 inputs->property_trees); |
| 620 } | 618 } |
| 621 | 619 |
| 622 CalculateRenderSurfaceLayerList( | 620 CalculateRenderSurfaceLayerList( |
| 623 inputs->root_layer->layer_tree_impl(), inputs->property_trees, | 621 inputs->root_layer->layer_tree_impl(), inputs->property_trees, |
| 624 inputs->render_surface_layer_list, inputs->can_render_to_separate_surface, | 622 inputs->render_surface_layer_list, inputs->can_render_to_separate_surface, |
| 625 inputs->max_texture_size); | 623 inputs->max_texture_size); |
| 626 | 624 |
| 627 if (inputs->verify_clip_tree_calculations) | 625 if (inputs->verify_clip_tree_calculations) |
| 628 draw_property_utils::VerifyClipTreeCalculations(visible_layer_list, | 626 draw_property_utils::VerifyClipTreeCalculations(visible_layer_list, |
| 629 inputs->property_trees); | 627 inputs->property_trees); |
| 628 if (inputs->verify_visible_rect_calculations) |
| 629 draw_property_utils::VerifyVisibleRectsCalculations(visible_layer_list, |
| 630 inputs->property_trees); |
| 630 if (inputs->verify_transform_tree_calculations) | 631 if (inputs->verify_transform_tree_calculations) |
| 631 draw_property_utils::VerifyTransformTreeCalculations( | 632 draw_property_utils::VerifyTransformTreeCalculations( |
| 632 visible_layer_list, inputs->property_trees); | 633 visible_layer_list, inputs->property_trees); |
| 633 | 634 |
| 634 if (should_measure_property_tree_performance) { | 635 if (should_measure_property_tree_performance) { |
| 635 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"), | 636 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cc.debug.cdp-perf"), |
| 636 "LayerTreeHostCommon::CalculateDrawProperties"); | 637 "LayerTreeHostCommon::CalculateDrawProperties"); |
| 637 } | 638 } |
| 638 | 639 |
| 639 // A root layer render_surface should always exist after | 640 // A root layer render_surface should always exist after |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 | 722 |
| 722 PropertyTrees* GetPropertyTrees(Layer* layer) { | 723 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 723 return layer->GetLayerTree()->property_trees(); | 724 return layer->GetLayerTree()->property_trees(); |
| 724 } | 725 } |
| 725 | 726 |
| 726 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 727 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 727 return layer->layer_tree_impl()->property_trees(); | 728 return layer->layer_tree_impl()->property_trees(); |
| 728 } | 729 } |
| 729 | 730 |
| 730 } // namespace cc | 731 } // namespace cc |
| OLD | NEW |