| 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <limits> | 11 #include <limits> |
| 12 #include <set> | 12 #include <set> |
| 13 | 13 |
| 14 #include "base/containers/adapters.h" |
| 14 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/timer/elapsed_timer.h" | 16 #include "base/timer/elapsed_timer.h" |
| 16 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 17 #include "base/trace_event/trace_event_argument.h" | 18 #include "base/trace_event/trace_event_argument.h" |
| 18 #include "cc/animation/animation_host.h" | 19 #include "cc/animation/animation_host.h" |
| 19 #include "cc/animation/keyframed_animation_curve.h" | 20 #include "cc/animation/keyframed_animation_curve.h" |
| 20 #include "cc/animation/mutable_properties.h" | 21 #include "cc/animation/mutable_properties.h" |
| 21 #include "cc/base/histograms.h" | 22 #include "cc/base/histograms.h" |
| 22 #include "cc/base/math_util.h" | 23 #include "cc/base/math_util.h" |
| 23 #include "cc/base/synced_property.h" | 24 #include "cc/base/synced_property.h" |
| 24 #include "cc/debug/devtools_instrumentation.h" | 25 #include "cc/debug/devtools_instrumentation.h" |
| 25 #include "cc/debug/traced_value.h" | 26 #include "cc/debug/traced_value.h" |
| 26 #include "cc/input/page_scale_animation.h" | 27 #include "cc/input/page_scale_animation.h" |
| 27 #include "cc/input/scrollbar_animation_controller.h" | 28 #include "cc/input/scrollbar_animation_controller.h" |
| 28 #include "cc/input/scrollbar_animation_controller_linear_fade.h" | 29 #include "cc/input/scrollbar_animation_controller_linear_fade.h" |
| 29 #include "cc/input/scrollbar_animation_controller_thinning.h" | 30 #include "cc/input/scrollbar_animation_controller_thinning.h" |
| 30 #include "cc/layers/heads_up_display_layer_impl.h" | 31 #include "cc/layers/heads_up_display_layer_impl.h" |
| 31 #include "cc/layers/layer.h" | 32 #include "cc/layers/layer.h" |
| 32 #include "cc/layers/layer_iterator.h" | 33 #include "cc/layers/layer_iterator.h" |
| 34 #include "cc/layers/layer_list_iterator.h" |
| 33 #include "cc/layers/render_surface_impl.h" | 35 #include "cc/layers/render_surface_impl.h" |
| 34 #include "cc/layers/scrollbar_layer_impl_base.h" | 36 #include "cc/layers/scrollbar_layer_impl_base.h" |
| 35 #include "cc/resources/ui_resource_request.h" | 37 #include "cc/resources/ui_resource_request.h" |
| 36 #include "cc/trees/draw_property_utils.h" | 38 #include "cc/trees/draw_property_utils.h" |
| 37 #include "cc/trees/layer_tree_host_common.h" | 39 #include "cc/trees/layer_tree_host_common.h" |
| 38 #include "cc/trees/layer_tree_host_impl.h" | 40 #include "cc/trees/layer_tree_host_impl.h" |
| 39 #include "cc/trees/occlusion_tracker.h" | 41 #include "cc/trees/occlusion_tracker.h" |
| 40 #include "cc/trees/property_tree.h" | 42 #include "cc/trees/property_tree.h" |
| 41 #include "cc/trees/property_tree_builder.h" | 43 #include "cc/trees/property_tree_builder.h" |
| 42 #include "ui/gfx/geometry/box_f.h" | 44 #include "ui/gfx/geometry/box_f.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 EventListenerClass::kMouseWheel, | 363 EventListenerClass::kMouseWheel, |
| 362 event_listener_properties(EventListenerClass::kMouseWheel)); | 364 event_listener_properties(EventListenerClass::kMouseWheel)); |
| 363 | 365 |
| 364 if (ViewportSizeInvalid()) | 366 if (ViewportSizeInvalid()) |
| 365 target_tree->SetViewportSizeInvalid(); | 367 target_tree->SetViewportSizeInvalid(); |
| 366 else | 368 else |
| 367 target_tree->ResetViewportSizeInvalid(); | 369 target_tree->ResetViewportSizeInvalid(); |
| 368 | 370 |
| 369 if (hud_layer()) | 371 if (hud_layer()) |
| 370 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( | 372 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( |
| 371 LayerTreeHostCommon::FindLayerInSubtree( | 373 LayerTreeHostCommon::FindLayerInSubtree(target_tree->root_layer(), |
| 372 target_tree->root_layer(), hud_layer()->id()))); | 374 hud_layer()->id()))); |
| 373 else | 375 else |
| 374 target_tree->set_hud_layer(NULL); | 376 target_tree->set_hud_layer(NULL); |
| 375 | 377 |
| 376 target_tree->has_ever_been_drawn_ = false; | 378 target_tree->has_ever_been_drawn_ = false; |
| 377 } | 379 } |
| 378 | 380 |
| 379 LayerListIterator LayerTreeImpl::begin() { | 381 LayerListIterator LayerTreeImpl::begin() { |
| 380 return LayerListIterator(root_layer_.get()); | 382 return LayerListIterator(root_layer_.get()); |
| 381 } | 383 } |
| 382 | 384 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 tile_priorities_updated |= layer->UpdateTiles(); | 897 tile_priorities_updated |= layer->UpdateTiles(); |
| 896 } | 898 } |
| 897 | 899 |
| 898 if (tile_priorities_updated) | 900 if (tile_priorities_updated) |
| 899 DidModifyTilePriorities(); | 901 DidModifyTilePriorities(); |
| 900 | 902 |
| 901 TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", | 903 TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
| 902 "layers_updated_count", layers_updated_count); | 904 "layers_updated_count", layers_updated_count); |
| 903 } | 905 } |
| 904 | 906 |
| 905 DCHECK(!needs_update_draw_properties_) << | 907 DCHECK(!needs_update_draw_properties_) |
| 906 "CalcDrawProperties should not set_needs_update_draw_properties()"; | 908 << "CalcDrawProperties should not set_needs_update_draw_properties()"; |
| 907 return true; | 909 return true; |
| 908 } | 910 } |
| 909 | 911 |
| 910 void LayerTreeImpl::BuildPropertyTreesForTesting() { | 912 void LayerTreeImpl::BuildPropertyTreesForTesting() { |
| 911 LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root_layer_.get()); | 913 LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root_layer_.get()); |
| 912 PropertyTreeBuilder::BuildPropertyTrees( | 914 PropertyTreeBuilder::BuildPropertyTrees( |
| 913 root_layer_.get(), PageScaleLayer(), InnerViewportScrollLayer(), | 915 root_layer_.get(), PageScaleLayer(), InnerViewportScrollLayer(), |
| 914 OuterViewportScrollLayer(), OverscrollElasticityLayer(), | 916 OuterViewportScrollLayer(), OverscrollElasticityLayer(), |
| 915 elastic_overscroll()->Current(IsActiveTree()), | 917 elastic_overscroll()->Current(IsActiveTree()), |
| 916 current_page_scale_factor(), device_scale_factor(), | 918 current_page_scale_factor(), device_scale_factor(), |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 << i << " of " << layers_with_copy_output_request_.size(); | 1406 << i << " of " << layers_with_copy_output_request_.size(); |
| 1405 } | 1407 } |
| 1406 layers_with_copy_output_request_.push_back(layer); | 1408 layers_with_copy_output_request_.push_back(layer); |
| 1407 } | 1409 } |
| 1408 | 1410 |
| 1409 void LayerTreeImpl::RemoveLayerWithCopyOutputRequest(LayerImpl* layer) { | 1411 void LayerTreeImpl::RemoveLayerWithCopyOutputRequest(LayerImpl* layer) { |
| 1410 // Only the active tree needs to know about layers with copy requests, as | 1412 // Only the active tree needs to know about layers with copy requests, as |
| 1411 // they are aborted if not serviced during draw. | 1413 // they are aborted if not serviced during draw. |
| 1412 DCHECK(IsActiveTree()); | 1414 DCHECK(IsActiveTree()); |
| 1413 | 1415 |
| 1414 std::vector<LayerImpl*>::iterator it = std::find( | 1416 std::vector<LayerImpl*>::iterator it = |
| 1415 layers_with_copy_output_request_.begin(), | 1417 std::find(layers_with_copy_output_request_.begin(), |
| 1416 layers_with_copy_output_request_.end(), | 1418 layers_with_copy_output_request_.end(), layer); |
| 1417 layer); | |
| 1418 DCHECK(it != layers_with_copy_output_request_.end()); | 1419 DCHECK(it != layers_with_copy_output_request_.end()); |
| 1419 layers_with_copy_output_request_.erase(it); | 1420 layers_with_copy_output_request_.erase(it); |
| 1420 | 1421 |
| 1421 // TODO(danakj): Remove this once crash is found crbug.com/309777 | 1422 // TODO(danakj): Remove this once crash is found crbug.com/309777 |
| 1422 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { | 1423 for (size_t i = 0; i < layers_with_copy_output_request_.size(); ++i) { |
| 1423 CHECK(layers_with_copy_output_request_[i] != layer) | 1424 CHECK(layers_with_copy_output_request_[i] != layer) |
| 1424 << i << " of " << layers_with_copy_output_request_.size(); | 1425 << i << " of " << layers_with_copy_output_request_.size(); |
| 1425 } | 1426 } |
| 1426 } | 1427 } |
| 1427 | 1428 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 transform_tree, clip_tree)) | 1603 transform_tree, clip_tree)) |
| 1603 return false; | 1604 return false; |
| 1604 | 1605 |
| 1605 // Skip the HUD layer. | 1606 // Skip the HUD layer. |
| 1606 if (layer == layer->layer_tree_impl()->hud_layer()) | 1607 if (layer == layer->layer_tree_impl()->hud_layer()) |
| 1607 return false; | 1608 return false; |
| 1608 | 1609 |
| 1609 return true; | 1610 return true; |
| 1610 } | 1611 } |
| 1611 | 1612 |
| 1612 struct FindClosestMatchingLayerDataForRecursion { | 1613 struct FindClosestMatchingLayerState { |
| 1613 FindClosestMatchingLayerDataForRecursion() | 1614 FindClosestMatchingLayerState() |
| 1614 : closest_match(NULL), | 1615 : closest_match(NULL), |
| 1615 closest_distance(-std::numeric_limits<float>::infinity()) {} | 1616 closest_distance(-std::numeric_limits<float>::infinity()) {} |
| 1616 LayerImpl* closest_match; | 1617 LayerImpl* closest_match; |
| 1617 // Note that the positive z-axis points towards the camera, so bigger means | 1618 // Note that the positive z-axis points towards the camera, so bigger means |
| 1618 // closer in this case, counterintuitively. | 1619 // closer in this case, counterintuitively. |
| 1619 float closest_distance; | 1620 float closest_distance; |
| 1620 }; | 1621 }; |
| 1621 | 1622 |
| 1622 template <typename Functor> | 1623 template <typename Functor> |
| 1623 static void FindClosestMatchingLayer( | 1624 static void FindClosestMatchingLayer(const gfx::PointF& screen_space_point, |
| 1624 const gfx::PointF& screen_space_point, | 1625 LayerImpl* root_layer, |
| 1625 LayerImpl* layer, | 1626 const Functor& func, |
| 1626 const Functor& func, | 1627 const TransformTree& transform_tree, |
| 1627 const TransformTree& transform_tree, | 1628 const ClipTree& clip_tree, |
| 1628 const ClipTree& clip_tree, | 1629 FindClosestMatchingLayerState* state) { |
| 1629 FindClosestMatchingLayerDataForRecursion* data_for_recursion) { | 1630 // We want to iterate from front to back when hit testing. |
| 1630 size_t children_size = layer->children().size(); | 1631 for (auto* layer : base::Reversed(*root_layer->layer_tree_impl())) { |
| 1631 for (size_t i = 0; i < children_size; ++i) { | 1632 if (!func(layer)) |
| 1632 size_t index = children_size - 1 - i; | 1633 continue; |
| 1633 FindClosestMatchingLayer(screen_space_point, layer->children()[index].get(), | |
| 1634 func, transform_tree, clip_tree, | |
| 1635 data_for_recursion); | |
| 1636 } | |
| 1637 | 1634 |
| 1638 if (!func(layer)) | 1635 float distance_to_intersection = 0.f; |
| 1639 return; | 1636 bool hit = false; |
| 1637 if (layer->Is3dSorted()) |
| 1638 hit = PointHitsLayer(layer, screen_space_point, &distance_to_intersection, |
| 1639 transform_tree, clip_tree); |
| 1640 else |
| 1641 hit = PointHitsLayer(layer, screen_space_point, nullptr, transform_tree, |
| 1642 clip_tree); |
| 1640 | 1643 |
| 1641 float distance_to_intersection = 0.f; | 1644 if (!hit) |
| 1642 bool hit = false; | 1645 continue; |
| 1643 if (layer->Is3dSorted()) | |
| 1644 hit = PointHitsLayer(layer, screen_space_point, &distance_to_intersection, | |
| 1645 transform_tree, clip_tree); | |
| 1646 else | |
| 1647 hit = PointHitsLayer(layer, screen_space_point, nullptr, transform_tree, | |
| 1648 clip_tree); | |
| 1649 | 1646 |
| 1650 if (!hit) | 1647 bool in_front_of_previous_candidate = |
| 1651 return; | 1648 state->closest_match && |
| 1649 layer->sorting_context_id() == |
| 1650 state->closest_match->sorting_context_id() && |
| 1651 distance_to_intersection > |
| 1652 state->closest_distance + std::numeric_limits<float>::epsilon(); |
| 1652 | 1653 |
| 1653 bool in_front_of_previous_candidate = | 1654 if (!state->closest_match || in_front_of_previous_candidate) { |
| 1654 data_for_recursion->closest_match && | 1655 state->closest_distance = distance_to_intersection; |
| 1655 layer->sorting_context_id() == | 1656 state->closest_match = layer; |
| 1656 data_for_recursion->closest_match->sorting_context_id() && | 1657 } |
| 1657 distance_to_intersection > data_for_recursion->closest_distance + | |
| 1658 std::numeric_limits<float>::epsilon(); | |
| 1659 | |
| 1660 if (!data_for_recursion->closest_match || in_front_of_previous_candidate) { | |
| 1661 data_for_recursion->closest_distance = distance_to_intersection; | |
| 1662 data_for_recursion->closest_match = layer; | |
| 1663 } | 1658 } |
| 1664 } | 1659 } |
| 1665 | 1660 |
| 1666 static bool ScrollsAnyDrawnRenderSurfaceLayerListMember(LayerImpl* layer) { | 1661 static bool ScrollsAnyDrawnRenderSurfaceLayerListMember(LayerImpl* layer) { |
| 1667 if (!layer->scrollable()) | 1662 if (!layer->scrollable()) |
| 1668 return false; | 1663 return false; |
| 1669 if (layer->layer_or_descendant_is_drawn()) | 1664 if (layer->layer_or_descendant_is_drawn()) |
| 1670 return true; | 1665 return true; |
| 1671 | 1666 |
| 1672 if (!layer->scroll_children()) | 1667 if (!layer->scroll_children()) |
| 1673 return false; | 1668 return false; |
| 1674 for (std::set<LayerImpl*>::const_iterator it = | 1669 for (std::set<LayerImpl*>::const_iterator it = |
| 1675 layer->scroll_children()->begin(); | 1670 layer->scroll_children()->begin(); |
| 1676 it != layer->scroll_children()->end(); | 1671 it != layer->scroll_children()->end(); ++it) { |
| 1677 ++it) { | |
| 1678 if ((*it)->layer_or_descendant_is_drawn()) | 1672 if ((*it)->layer_or_descendant_is_drawn()) |
| 1679 return true; | 1673 return true; |
| 1680 } | 1674 } |
| 1681 return false; | 1675 return false; |
| 1682 } | 1676 } |
| 1683 | 1677 |
| 1684 struct FindScrollingLayerFunctor { | 1678 struct FindScrollingLayerFunctor { |
| 1685 bool operator()(LayerImpl* layer) const { | 1679 bool operator()(LayerImpl* layer) const { |
| 1686 return ScrollsAnyDrawnRenderSurfaceLayerListMember(layer); | 1680 return ScrollsAnyDrawnRenderSurfaceLayerListMember(layer); |
| 1687 } | 1681 } |
| 1688 }; | 1682 }; |
| 1689 | 1683 |
| 1690 LayerImpl* LayerTreeImpl::FindFirstScrollingLayerThatIsHitByPoint( | 1684 LayerImpl* LayerTreeImpl::FindFirstScrollingLayerThatIsHitByPoint( |
| 1691 const gfx::PointF& screen_space_point) { | 1685 const gfx::PointF& screen_space_point) { |
| 1692 FindClosestMatchingLayerDataForRecursion data_for_recursion; | 1686 FindClosestMatchingLayerState state; |
| 1693 FindClosestMatchingLayer(screen_space_point, root_layer(), | 1687 FindClosestMatchingLayer( |
| 1694 FindScrollingLayerFunctor(), | 1688 screen_space_point, root_layer(), FindScrollingLayerFunctor(), |
| 1695 property_trees_.transform_tree, | 1689 property_trees_.transform_tree, property_trees_.clip_tree, &state); |
| 1696 property_trees_.clip_tree, &data_for_recursion); | 1690 return state.closest_match; |
| 1697 return data_for_recursion.closest_match; | |
| 1698 } | 1691 } |
| 1699 | 1692 |
| 1700 struct HitTestVisibleScrollableOrTouchableFunctor { | 1693 struct HitTestVisibleScrollableOrTouchableFunctor { |
| 1701 bool operator()(LayerImpl* layer) const { | 1694 bool operator()(LayerImpl* layer) const { |
| 1702 return layer->IsDrawnRenderSurfaceLayerListMember() || | 1695 return layer->IsDrawnRenderSurfaceLayerListMember() || |
| 1703 ScrollsAnyDrawnRenderSurfaceLayerListMember(layer) || | 1696 ScrollsAnyDrawnRenderSurfaceLayerListMember(layer) || |
| 1704 !layer->touch_event_handler_region().IsEmpty() || | 1697 !layer->touch_event_handler_region().IsEmpty() || |
| 1705 layer->layer_tree_impl()->event_listener_properties( | 1698 layer->layer_tree_impl()->event_listener_properties( |
| 1706 EventListenerClass::kMouseWheel) != | 1699 EventListenerClass::kMouseWheel) != |
| 1707 EventListenerProperties::kNone; | 1700 EventListenerProperties::kNone; |
| 1708 } | 1701 } |
| 1709 }; | 1702 }; |
| 1710 | 1703 |
| 1711 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint( | 1704 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint( |
| 1712 const gfx::PointF& screen_space_point) { | 1705 const gfx::PointF& screen_space_point) { |
| 1713 if (!root_layer()) | 1706 if (!root_layer()) |
| 1714 return NULL; | 1707 return NULL; |
| 1715 bool update_lcd_text = false; | 1708 bool update_lcd_text = false; |
| 1716 if (!UpdateDrawProperties(update_lcd_text)) | 1709 if (!UpdateDrawProperties(update_lcd_text)) |
| 1717 return NULL; | 1710 return NULL; |
| 1718 FindClosestMatchingLayerDataForRecursion data_for_recursion; | 1711 FindClosestMatchingLayerState state; |
| 1719 FindClosestMatchingLayer(screen_space_point, root_layer(), | 1712 FindClosestMatchingLayer(screen_space_point, root_layer(), |
| 1720 HitTestVisibleScrollableOrTouchableFunctor(), | 1713 HitTestVisibleScrollableOrTouchableFunctor(), |
| 1721 property_trees_.transform_tree, | 1714 property_trees_.transform_tree, |
| 1722 property_trees_.clip_tree, &data_for_recursion); | 1715 property_trees_.clip_tree, &state); |
| 1723 return data_for_recursion.closest_match; | 1716 return state.closest_match; |
| 1724 } | 1717 } |
| 1725 | 1718 |
| 1726 static bool LayerHasTouchEventHandlersAt(const gfx::PointF& screen_space_point, | 1719 static bool LayerHasTouchEventHandlersAt(const gfx::PointF& screen_space_point, |
| 1727 LayerImpl* layer_impl, | 1720 LayerImpl* layer_impl, |
| 1728 const TransformTree& transform_tree, | 1721 const TransformTree& transform_tree, |
| 1729 const ClipTree& clip_tree) { | 1722 const ClipTree& clip_tree) { |
| 1730 if (layer_impl->touch_event_handler_region().IsEmpty()) | 1723 if (layer_impl->touch_event_handler_region().IsEmpty()) |
| 1731 return false; | 1724 return false; |
| 1732 | 1725 |
| 1733 if (!PointHitsRegion(screen_space_point, layer_impl->ScreenSpaceTransform(), | 1726 if (!PointHitsRegion(screen_space_point, layer_impl->ScreenSpaceTransform(), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1758 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( | 1751 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( |
| 1759 const gfx::PointF& screen_space_point) { | 1752 const gfx::PointF& screen_space_point) { |
| 1760 if (!root_layer()) | 1753 if (!root_layer()) |
| 1761 return NULL; | 1754 return NULL; |
| 1762 bool update_lcd_text = false; | 1755 bool update_lcd_text = false; |
| 1763 if (!UpdateDrawProperties(update_lcd_text)) | 1756 if (!UpdateDrawProperties(update_lcd_text)) |
| 1764 return NULL; | 1757 return NULL; |
| 1765 FindTouchEventLayerFunctor func = {screen_space_point, | 1758 FindTouchEventLayerFunctor func = {screen_space_point, |
| 1766 property_trees_.transform_tree, | 1759 property_trees_.transform_tree, |
| 1767 property_trees_.clip_tree}; | 1760 property_trees_.clip_tree}; |
| 1768 FindClosestMatchingLayerDataForRecursion data_for_recursion; | 1761 FindClosestMatchingLayerState state; |
| 1769 FindClosestMatchingLayer(screen_space_point, root_layer(), func, | 1762 FindClosestMatchingLayer(screen_space_point, root_layer(), func, |
| 1770 property_trees_.transform_tree, | 1763 property_trees_.transform_tree, |
| 1771 property_trees_.clip_tree, &data_for_recursion); | 1764 property_trees_.clip_tree, &state); |
| 1772 return data_for_recursion.closest_match; | 1765 return state.closest_match; |
| 1773 } | 1766 } |
| 1774 | 1767 |
| 1775 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { | 1768 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { |
| 1776 selection_ = selection; | 1769 selection_ = selection; |
| 1777 } | 1770 } |
| 1778 | 1771 |
| 1779 static ViewportSelectionBound ComputeViewportSelectionBound( | 1772 static ViewportSelectionBound ComputeViewportSelectionBound( |
| 1780 const LayerSelectionBound& layer_bound, | 1773 const LayerSelectionBound& layer_bound, |
| 1781 LayerImpl* layer, | 1774 LayerImpl* layer, |
| 1782 float device_scale_factor, | 1775 float device_scale_factor, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1867 const { | 1860 const { |
| 1868 return layer_tree_host_impl_; | 1861 return layer_tree_host_impl_; |
| 1869 } | 1862 } |
| 1870 | 1863 |
| 1871 void LayerTreeImpl::SetPendingPageScaleAnimation( | 1864 void LayerTreeImpl::SetPendingPageScaleAnimation( |
| 1872 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1865 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
| 1873 pending_page_scale_animation_ = std::move(pending_animation); | 1866 pending_page_scale_animation_ = std::move(pending_animation); |
| 1874 } | 1867 } |
| 1875 | 1868 |
| 1876 scoped_ptr<PendingPageScaleAnimation> | 1869 scoped_ptr<PendingPageScaleAnimation> |
| 1877 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1870 LayerTreeImpl::TakePendingPageScaleAnimation() { |
| 1878 return std::move(pending_page_scale_animation_); | 1871 return std::move(pending_page_scale_animation_); |
| 1879 } | 1872 } |
| 1880 | 1873 |
| 1881 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { | 1874 bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { |
| 1882 LayerTreeType tree_type = | 1875 LayerTreeType tree_type = |
| 1883 IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; | 1876 IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; |
| 1884 return layer_tree_host_impl_->animation_host() | 1877 return layer_tree_host_impl_->animation_host() |
| 1885 ? layer_tree_host_impl_->animation_host() | 1878 ? layer_tree_host_impl_->animation_host() |
| 1886 ->IsAnimatingFilterProperty(layer->id(), tree_type) | 1879 ->IsAnimatingFilterProperty(layer->id(), tree_type) |
| 1887 : false; | 1880 : false; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2053 const gfx::BoxF& box, | 2046 const gfx::BoxF& box, |
| 2054 gfx::BoxF* bounds) const { | 2047 gfx::BoxF* bounds) const { |
| 2055 *bounds = gfx::BoxF(); | 2048 *bounds = gfx::BoxF(); |
| 2056 return layer_tree_host_impl_->animation_host() | 2049 return layer_tree_host_impl_->animation_host() |
| 2057 ? layer_tree_host_impl_->animation_host() | 2050 ? layer_tree_host_impl_->animation_host() |
| 2058 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 2051 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
| 2059 : true; | 2052 : true; |
| 2060 } | 2053 } |
| 2061 | 2054 |
| 2062 } // namespace cc | 2055 } // namespace cc |
| OLD | NEW |