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