| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/layer_impl.h" | 5 #include "cc/layers/layer_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> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 child->SetParent(this); | 118 child->SetParent(this); |
| 119 DCHECK_EQ(layer_tree_impl(), child->layer_tree_impl()); | 119 DCHECK_EQ(layer_tree_impl(), child->layer_tree_impl()); |
| 120 children_.push_back(child.get()); | 120 children_.push_back(child.get()); |
| 121 layer_tree_impl_->AddLayer(std::move(child)); | 121 layer_tree_impl_->AddLayer(std::move(child)); |
| 122 } | 122 } |
| 123 | 123 |
| 124 std::unique_ptr<LayerImpl> LayerImpl::RemoveChildForTesting(LayerImpl* child) { | 124 std::unique_ptr<LayerImpl> LayerImpl::RemoveChildForTesting(LayerImpl* child) { |
| 125 auto it = std::find(children_.begin(), children_.end(), child); | 125 auto it = std::find(children_.begin(), children_.end(), child); |
| 126 if (it != children_.end()) | 126 if (it != children_.end()) |
| 127 children_.erase(it); | 127 children_.erase(it); |
| 128 layer_tree_impl()->property_trees()->RemoveIdFromIdToIndexMaps(child->id()); |
| 128 return layer_tree_impl_->RemoveLayer(child->id()); | 129 return layer_tree_impl_->RemoveLayer(child->id()); |
| 129 } | 130 } |
| 130 | 131 |
| 131 void LayerImpl::SetParent(LayerImpl* parent) { | 132 void LayerImpl::SetParent(LayerImpl* parent) { |
| 132 parent_ = parent; | 133 parent_ = parent; |
| 133 } | 134 } |
| 134 | 135 |
| 135 void LayerImpl::ClearChildList() { | 136 void LayerImpl::ClearChildList() { |
| 136 if (children_.empty()) | 137 if (children_.empty()) |
| 137 return; | 138 return; |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 618 } |
| 618 | 619 |
| 619 int LayerImpl::num_copy_requests_in_target_subtree() { | 620 int LayerImpl::num_copy_requests_in_target_subtree() { |
| 620 return layer_tree_impl() | 621 return layer_tree_impl() |
| 621 ->property_trees() | 622 ->property_trees() |
| 622 ->effect_tree.Node(effect_tree_index()) | 623 ->effect_tree.Node(effect_tree_index()) |
| 623 ->data.num_copy_requests_in_subtree; | 624 ->data.num_copy_requests_in_subtree; |
| 624 } | 625 } |
| 625 | 626 |
| 626 void LayerImpl::UpdatePropertyTreeTransform() { | 627 void LayerImpl::UpdatePropertyTreeTransform() { |
| 627 if (transform_tree_index_ != -1) { | 628 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 628 TransformTree& transform_tree = | 629 if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, |
| 629 layer_tree_impl()->property_trees()->transform_tree; | 630 id())) { |
| 630 TransformNode* node = transform_tree.Node(transform_tree_index_); | |
| 631 // A LayerImpl's own current state is insufficient for determining whether | 631 // A LayerImpl's own current state is insufficient for determining whether |
| 632 // it owns a TransformNode, since this depends on the state of the | 632 // it owns a TransformNode, since this depends on the state of the |
| 633 // corresponding Layer at the time of the last commit. For example, a | 633 // corresponding Layer at the time of the last commit. For example, a |
| 634 // transform animation might have been in progress at the time the last | 634 // transform animation might have been in progress at the time the last |
| 635 // commit started, but might have finished since then on the compositor | 635 // commit started, but might have finished since then on the compositor |
| 636 // thread. | 636 // thread. |
| 637 if (node->owner_id != id()) | 637 DCHECK_EQ(transform_tree_index(), |
| 638 return; | 638 property_trees->transform_id_to_index_map[id()]); |
| 639 TransformNode* node = |
| 640 property_trees->transform_tree.Node(transform_tree_index()); |
| 639 if (node->data.local != transform_) { | 641 if (node->data.local != transform_) { |
| 640 node->data.local = transform_; | 642 node->data.local = transform_; |
| 641 node->data.needs_local_transform_update = true; | 643 node->data.needs_local_transform_update = true; |
| 642 node->data.transform_changed = true; | 644 node->data.transform_changed = true; |
| 643 layer_tree_impl()->property_trees()->changed = true; | 645 property_trees->changed = true; |
| 644 transform_tree.set_needs_update(true); | 646 property_trees->transform_tree.set_needs_update(true); |
| 645 // TODO(ajuma): The current criteria for creating clip nodes means that | 647 // TODO(ajuma): The current criteria for creating clip nodes means that |
| 646 // property trees may need to be rebuilt when the new transform isn't | 648 // property trees may need to be rebuilt when the new transform isn't |
| 647 // axis-aligned wrt the old transform (see Layer::SetTransform). Since | 649 // axis-aligned wrt the old transform (see Layer::SetTransform). Since |
| 648 // rebuilding property trees every frame of a transform animation is | 650 // rebuilding property trees every frame of a transform animation is |
| 649 // something we should try to avoid, change property tree-building so that | 651 // something we should try to avoid, change property tree-building so that |
| 650 // it doesn't depend on axis aliginment. | 652 // it doesn't depend on axis aliginment. |
| 651 } | 653 } |
| 652 } | 654 } |
| 653 } | 655 } |
| 654 | 656 |
| 655 void LayerImpl::UpdatePropertyTreeTransformIsAnimated(bool is_animated) { | 657 void LayerImpl::UpdatePropertyTreeTransformIsAnimated(bool is_animated) { |
| 656 if (transform_tree_index_ != -1) { | 658 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 657 TransformTree& transform_tree = | 659 if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, |
| 658 layer_tree_impl()->property_trees()->transform_tree; | 660 id())) { |
| 659 TransformNode* node = transform_tree.Node(transform_tree_index_); | 661 DCHECK_EQ(transform_tree_index(), |
| 662 property_trees->transform_id_to_index_map[id()]); |
| 663 TransformNode* node = |
| 664 property_trees->transform_tree.Node(transform_tree_index()); |
| 660 // A LayerImpl's own current state is insufficient for determining whether | 665 // A LayerImpl's own current state is insufficient for determining whether |
| 661 // it owns a TransformNode, since this depends on the state of the | 666 // it owns a TransformNode, since this depends on the state of the |
| 662 // corresponding Layer at the time of the last commit. For example, if | 667 // corresponding Layer at the time of the last commit. For example, if |
| 663 // |is_animated| is false, this might mean a transform animation just ticked | 668 // |is_animated| is false, this might mean a transform animation just ticked |
| 664 // past its finish point (so the LayerImpl still owns a TransformNode) or it | 669 // past its finish point (so the LayerImpl still owns a TransformNode) or it |
| 665 // might mean that a transform animation was removed during commit or | 670 // might mean that a transform animation was removed during commit or |
| 666 // activation (and, in that case, the LayerImpl will no longer own a | 671 // activation (and, in that case, the LayerImpl will no longer own a |
| 667 // TransformNode, unless it has non-animation-related reasons for owning a | 672 // TransformNode, unless it has non-animation-related reasons for owning a |
| 668 // node). | 673 // node). |
| 669 if (node->owner_id != id()) | |
| 670 return; | |
| 671 if (node->data.has_potential_animation != is_animated) { | 674 if (node->data.has_potential_animation != is_animated) { |
| 672 node->data.has_potential_animation = is_animated; | 675 node->data.has_potential_animation = is_animated; |
| 673 if (is_animated) { | 676 if (is_animated) { |
| 674 float maximum_target_scale = 0.f; | 677 float maximum_target_scale = 0.f; |
| 675 node->data.local_maximum_animation_target_scale = | 678 node->data.local_maximum_animation_target_scale = |
| 676 MaximumTargetScale(&maximum_target_scale) ? maximum_target_scale | 679 MaximumTargetScale(&maximum_target_scale) ? maximum_target_scale |
| 677 : 0.f; | 680 : 0.f; |
| 678 | 681 |
| 679 float animation_start_scale = 0.f; | 682 float animation_start_scale = 0.f; |
| 680 node->data.local_starting_animation_scale = | 683 node->data.local_starting_animation_scale = |
| 681 AnimationStartScale(&animation_start_scale) ? animation_start_scale | 684 AnimationStartScale(&animation_start_scale) ? animation_start_scale |
| 682 : 0.f; | 685 : 0.f; |
| 683 | 686 |
| 684 node->data.has_only_translation_animations = | 687 node->data.has_only_translation_animations = |
| 685 HasOnlyTranslationTransforms(); | 688 HasOnlyTranslationTransforms(); |
| 686 } else { | 689 } else { |
| 687 node->data.local_maximum_animation_target_scale = 0.f; | 690 node->data.local_maximum_animation_target_scale = 0.f; |
| 688 node->data.local_starting_animation_scale = 0.f; | 691 node->data.local_starting_animation_scale = 0.f; |
| 689 node->data.has_only_translation_animations = true; | 692 node->data.has_only_translation_animations = true; |
| 690 } | 693 } |
| 691 | 694 |
| 692 transform_tree.set_needs_update(true); | 695 property_trees->transform_tree.set_needs_update(true); |
| 693 layer_tree_impl()->set_needs_update_draw_properties(); | 696 layer_tree_impl()->set_needs_update_draw_properties(); |
| 694 } | 697 } |
| 695 } | 698 } |
| 696 } | 699 } |
| 697 | 700 |
| 698 void LayerImpl::UpdatePropertyTreeOpacity() { | 701 void LayerImpl::UpdatePropertyTreeOpacity() { |
| 699 if (effect_tree_index_ != -1) { | 702 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 700 EffectTree& effect_tree = layer_tree_impl()->property_trees()->effect_tree; | 703 if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) { |
| 701 if (effect_tree_index_ >= static_cast<int>(effect_tree.size())) | |
| 702 return; | |
| 703 EffectNode* node = effect_tree.Node(effect_tree_index_); | |
| 704 // A LayerImpl's own current state is insufficient for determining whether | 704 // A LayerImpl's own current state is insufficient for determining whether |
| 705 // it owns an OpacityNode, since this depends on the state of the | 705 // it owns an OpacityNode, since this depends on the state of the |
| 706 // corresponding Layer at the time of the last commit. For example, an | 706 // corresponding Layer at the time of the last commit. For example, an |
| 707 // opacity animation might have been in progress at the time the last commit | 707 // opacity animation might have been in progress at the time the last commit |
| 708 // started, but might have finished since then on the compositor thread. | 708 // started, but might have finished since then on the compositor thread. |
| 709 if (node->owner_id != id() || node->data.opacity == opacity_) | 709 EffectNode* node = property_trees->effect_tree.Node( |
| 710 return; | 710 property_trees->effect_id_to_index_map[id()]); |
| 711 node->data.opacity = opacity_; | 711 node->data.opacity = opacity_; |
| 712 node->data.effect_changed = true; | 712 node->data.effect_changed = true; |
| 713 layer_tree_impl()->property_trees()->changed = true; | 713 property_trees->changed = true; |
| 714 effect_tree.set_needs_update(true); | 714 property_trees->effect_tree.set_needs_update(true); |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 | 717 |
| 718 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { | 718 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { |
| 719 if (scrollable()) | 719 if (scrollable()) |
| 720 UpdatePropertyTreeScrollOffset(); | 720 UpdatePropertyTreeScrollOffset(); |
| 721 | 721 |
| 722 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { | 722 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { |
| 723 UpdatePropertyTreeTransform(); | 723 UpdatePropertyTreeTransform(); |
| 724 UpdatePropertyTreeTransformIsAnimated( | 724 UpdatePropertyTreeTransformIsAnimated( |
| 725 HasPotentiallyRunningTransformAnimation()); | 725 HasPotentiallyRunningTransformAnimation()); |
| 726 } | 726 } |
| 727 } | 727 } |
| 728 | 728 |
| 729 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { | 729 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { |
| 730 return CurrentScrollOffset(); | 730 return CurrentScrollOffset(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) { | 733 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) { |
| 734 if (filters_ != filters) { | 734 if (filters_ != filters) { |
| 735 SetFilters(filters); | 735 SetFilters(filters); |
| 736 SetNeedsPushProperties(); | 736 SetNeedsPushProperties(); |
| 737 layer_tree_impl()->set_needs_update_draw_properties(); | 737 layer_tree_impl()->set_needs_update_draw_properties(); |
| 738 EffectTree& effect_tree = layer_tree_impl()->property_trees()->effect_tree; | 738 EffectTree& effect_tree = layer_tree_impl()->property_trees()->effect_tree; |
| 739 EffectNode* node = effect_tree.Node(effect_tree_index_); | 739 EffectNode* node = effect_tree.Node(effect_tree_index_); |
| 740 DCHECK_EQ(node->owner_id, id()); | 740 DCHECK(layer_tree_impl()->property_trees()->IsInIdToIndexMap( |
| 741 PropertyTrees::TreeType::EFFECT, id())); |
| 741 node->data.effect_changed = true; | 742 node->data.effect_changed = true; |
| 742 layer_tree_impl()->property_trees()->changed = true; | 743 layer_tree_impl()->property_trees()->changed = true; |
| 743 effect_tree.set_needs_update(true); | 744 effect_tree.set_needs_update(true); |
| 744 } | 745 } |
| 745 } | 746 } |
| 746 | 747 |
| 747 void LayerImpl::OnOpacityAnimated(float opacity) { | 748 void LayerImpl::OnOpacityAnimated(float opacity) { |
| 748 SetOpacity(opacity); | 749 SetOpacity(opacity); |
| 749 UpdatePropertyTreeOpacity(); | 750 UpdatePropertyTreeOpacity(); |
| 750 SetNeedsPushProperties(); | 751 SetNeedsPushProperties(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 771 return; | 772 return; |
| 772 | 773 |
| 773 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); | 774 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); |
| 774 | 775 |
| 775 layer_tree_impl_->DidAnimateScrollOffset(); | 776 layer_tree_impl_->DidAnimateScrollOffset(); |
| 776 } | 777 } |
| 777 | 778 |
| 778 void LayerImpl::OnTransformIsCurrentlyAnimatingChanged( | 779 void LayerImpl::OnTransformIsCurrentlyAnimatingChanged( |
| 779 bool is_currently_animating) { | 780 bool is_currently_animating) { |
| 780 DCHECK(layer_tree_impl_); | 781 DCHECK(layer_tree_impl_); |
| 781 TransformTree& transform_tree = | 782 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 782 layer_tree_impl_->property_trees()->transform_tree; | 783 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, |
| 783 TransformNode* node = transform_tree.Node(transform_tree_index()); | 784 id())) |
| 784 if (!node) | |
| 785 return; | 785 return; |
| 786 | 786 DCHECK_EQ(transform_tree_index(), |
| 787 if (node->owner_id == id()) | 787 property_trees->transform_id_to_index_map[id()]); |
| 788 node->data.is_currently_animating = is_currently_animating; | 788 TransformNode* node = |
| 789 property_trees->transform_tree.Node(transform_tree_index()); |
| 790 node->data.is_currently_animating = is_currently_animating; |
| 789 } | 791 } |
| 790 | 792 |
| 791 void LayerImpl::OnTransformIsPotentiallyAnimatingChanged( | 793 void LayerImpl::OnTransformIsPotentiallyAnimatingChanged( |
| 792 bool has_potential_animation) { | 794 bool has_potential_animation) { |
| 793 UpdatePropertyTreeTransformIsAnimated(has_potential_animation); | 795 UpdatePropertyTreeTransformIsAnimated(has_potential_animation); |
| 794 was_ever_ready_since_last_transform_animation_ = false; | 796 was_ever_ready_since_last_transform_animation_ = false; |
| 795 } | 797 } |
| 796 | 798 |
| 797 void LayerImpl::OnOpacityIsCurrentlyAnimatingChanged( | 799 void LayerImpl::OnOpacityIsCurrentlyAnimatingChanged( |
| 798 bool is_currently_animating) { | 800 bool is_currently_animating) { |
| 799 DCHECK(layer_tree_impl_); | 801 DCHECK(layer_tree_impl_); |
| 800 EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree; | 802 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 801 EffectNode* node = effect_tree.Node(effect_tree_index()); | 803 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) |
| 804 return; |
| 805 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); |
| 806 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); |
| 802 | 807 |
| 803 if (node->owner_id == id()) | 808 node->data.is_currently_animating_opacity = is_currently_animating; |
| 804 node->data.is_currently_animating_opacity = is_currently_animating; | |
| 805 } | 809 } |
| 806 | 810 |
| 807 void LayerImpl::OnOpacityIsPotentiallyAnimatingChanged( | 811 void LayerImpl::OnOpacityIsPotentiallyAnimatingChanged( |
| 808 bool has_potential_animation) { | 812 bool has_potential_animation) { |
| 809 DCHECK(layer_tree_impl_); | 813 DCHECK(layer_tree_impl_); |
| 810 EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree; | 814 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); |
| 811 EffectNode* node = effect_tree.Node(effect_tree_index()); | 815 if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())) |
| 812 if (node->owner_id == id()) { | 816 return; |
| 813 node->data.has_potential_opacity_animation = has_potential_animation; | 817 DCHECK_EQ(effect_tree_index(), property_trees->effect_id_to_index_map[id()]); |
| 814 effect_tree.set_needs_update(true); | 818 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); |
| 815 } | 819 node->data.has_potential_opacity_animation = has_potential_animation; |
| 820 property_trees->effect_tree.set_needs_update(true); |
| 816 } | 821 } |
| 817 | 822 |
| 818 bool LayerImpl::IsActive() const { | 823 bool LayerImpl::IsActive() const { |
| 819 return layer_tree_impl_->IsActiveTree(); | 824 return layer_tree_impl_->IsActiveTree(); |
| 820 } | 825 } |
| 821 | 826 |
| 822 gfx::Size LayerImpl::bounds() const { | 827 gfx::Size LayerImpl::bounds() const { |
| 823 gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_); | 828 gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_); |
| 824 return gfx::Size(bounds_.width() + delta.x(), | 829 return gfx::Size(bounds_.width() + delta.x(), |
| 825 bounds_.height() + delta.y()); | 830 bounds_.height() + delta.y()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 855 property_trees->SetOuterViewportContainerBoundsDelta(bounds_delta); | 860 property_trees->SetOuterViewportContainerBoundsDelta(bounds_delta); |
| 856 else if (this == layer_tree_impl()->InnerViewportScrollLayer()) | 861 else if (this == layer_tree_impl()->InnerViewportScrollLayer()) |
| 857 property_trees->SetInnerViewportScrollBoundsDelta(bounds_delta); | 862 property_trees->SetInnerViewportScrollBoundsDelta(bounds_delta); |
| 858 | 863 |
| 859 layer_tree_impl()->DidUpdateScrollState(id()); | 864 layer_tree_impl()->DidUpdateScrollState(id()); |
| 860 | 865 |
| 861 if (masks_to_bounds()) { | 866 if (masks_to_bounds()) { |
| 862 // If layer is clipping, then update the clip node using the new bounds. | 867 // If layer is clipping, then update the clip node using the new bounds. |
| 863 ClipNode* clip_node = property_trees->clip_tree.Node(clip_tree_index()); | 868 ClipNode* clip_node = property_trees->clip_tree.Node(clip_tree_index()); |
| 864 if (clip_node) { | 869 if (clip_node) { |
| 865 DCHECK(id() == clip_node->owner_id); | 870 DCHECK(property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::CLIP, |
| 871 id())); |
| 866 clip_node->data.clip = gfx::RectF( | 872 clip_node->data.clip = gfx::RectF( |
| 867 gfx::PointF() + offset_to_transform_parent(), gfx::SizeF(bounds())); | 873 gfx::PointF() + offset_to_transform_parent(), gfx::SizeF(bounds())); |
| 868 property_trees->clip_tree.set_needs_update(true); | 874 property_trees->clip_tree.set_needs_update(true); |
| 869 } | 875 } |
| 870 property_trees->full_tree_damaged = true; | 876 property_trees->full_tree_damaged = true; |
| 871 layer_tree_impl()->set_needs_update_draw_properties(); | 877 layer_tree_impl()->set_needs_update_draw_properties(); |
| 872 } else { | 878 } else { |
| 873 NoteLayerPropertyChanged(); | 879 NoteLayerPropertyChanged(); |
| 874 } | 880 } |
| 875 } | 881 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 } | 1147 } |
| 1142 | 1148 |
| 1143 gfx::ScrollOffset LayerImpl::CurrentScrollOffset() const { | 1149 gfx::ScrollOffset LayerImpl::CurrentScrollOffset() const { |
| 1144 return layer_tree_impl()->property_trees()->scroll_tree.current_scroll_offset( | 1150 return layer_tree_impl()->property_trees()->scroll_tree.current_scroll_offset( |
| 1145 id()); | 1151 id()); |
| 1146 } | 1152 } |
| 1147 | 1153 |
| 1148 void LayerImpl::UpdatePropertyTreeScrollOffset() { | 1154 void LayerImpl::UpdatePropertyTreeScrollOffset() { |
| 1149 // TODO(enne): in the future, scrolling should update the scroll tree | 1155 // TODO(enne): in the future, scrolling should update the scroll tree |
| 1150 // directly instead of going through layers. | 1156 // directly instead of going through layers. |
| 1151 if (transform_tree_index_ != -1) { | 1157 TransformTree& transform_tree = |
| 1152 TransformTree& transform_tree = | 1158 layer_tree_impl()->property_trees()->transform_tree; |
| 1153 layer_tree_impl()->property_trees()->transform_tree; | 1159 TransformNode* node = transform_tree.Node(transform_tree_index_); |
| 1154 TransformNode* node = transform_tree.Node(transform_tree_index_); | 1160 gfx::ScrollOffset current_offset = CurrentScrollOffset(); |
| 1155 gfx::ScrollOffset current_offset = CurrentScrollOffset(); | 1161 if (node->data.scroll_offset != current_offset) { |
| 1156 if (node->data.scroll_offset != current_offset) { | 1162 node->data.scroll_offset = current_offset; |
| 1157 node->data.scroll_offset = current_offset; | 1163 node->data.needs_local_transform_update = true; |
| 1158 node->data.needs_local_transform_update = true; | 1164 transform_tree.set_needs_update(true); |
| 1159 transform_tree.set_needs_update(true); | |
| 1160 } | |
| 1161 } | 1165 } |
| 1162 } | 1166 } |
| 1163 | 1167 |
| 1164 SimpleEnclosedRegion LayerImpl::VisibleOpaqueRegion() const { | 1168 SimpleEnclosedRegion LayerImpl::VisibleOpaqueRegion() const { |
| 1165 if (contents_opaque()) | 1169 if (contents_opaque()) |
| 1166 return SimpleEnclosedRegion(visible_layer_rect()); | 1170 return SimpleEnclosedRegion(visible_layer_rect()); |
| 1167 return SimpleEnclosedRegion(); | 1171 return SimpleEnclosedRegion(); |
| 1168 } | 1172 } |
| 1169 | 1173 |
| 1170 void LayerImpl::DidBeginTracing() {} | 1174 void LayerImpl::DidBeginTracing() {} |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 .layer_transforms_should_scale_layer_contents) { | 1418 .layer_transforms_should_scale_layer_contents) { |
| 1415 return default_scale; | 1419 return default_scale; |
| 1416 } | 1420 } |
| 1417 | 1421 |
| 1418 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1422 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1419 DrawTransform(), default_scale); | 1423 DrawTransform(), default_scale); |
| 1420 return std::max(transform_scales.x(), transform_scales.y()); | 1424 return std::max(transform_scales.x(), transform_scales.y()); |
| 1421 } | 1425 } |
| 1422 | 1426 |
| 1423 } // namespace cc | 1427 } // namespace cc |
| OLD | NEW |