OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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.h" | 5 #include "cc/layers/layer.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 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility); | 1176 layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility); |
1177 layer->SetUseLocalTransformForBackfaceVisibility( | 1177 layer->SetUseLocalTransformForBackfaceVisibility( |
1178 use_local_transform_for_backface_visibility_); | 1178 use_local_transform_for_backface_visibility_); |
1179 layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_); | 1179 layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_); |
1180 | 1180 |
1181 layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id); | 1181 layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id); |
1182 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal); | 1182 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal); |
1183 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical); | 1183 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical); |
1184 layer->SetMutableProperties(inputs_.mutable_properties); | 1184 layer->SetMutableProperties(inputs_.mutable_properties); |
1185 | 1185 |
| 1186 // The property trees must be safe to access because they will be used below |
| 1187 // to call |SetScrollOffsetClobberActiveValue|. |
| 1188 DCHECK(layer->layer_tree_impl()->PropertyTreeSyncComplete()); |
| 1189 |
1186 // When a scroll offset animation is interrupted the new scroll position on | 1190 // When a scroll offset animation is interrupted the new scroll position on |
1187 // the pending tree will clobber any impl-side scrolling occuring on the | 1191 // the pending tree will clobber any impl-side scrolling occuring on the |
1188 // active tree. To do so, avoid scrolling the pending tree along with it | 1192 // active tree. To do so, avoid scrolling the pending tree along with it |
1189 // instead of trying to undo that scrolling later. | 1193 // instead of trying to undo that scrolling later. |
1190 if (ScrollOffsetAnimationWasInterrupted()) | 1194 if (ScrollOffsetAnimationWasInterrupted()) |
1191 layer->layer_tree_impl() | 1195 layer->layer_tree_impl() |
1192 ->property_trees() | 1196 ->property_trees() |
1193 ->scroll_tree.SetScrollOffsetClobberActiveValue(layer->id()); | 1197 ->scroll_tree.SetScrollOffsetClobberActiveValue(layer->id()); |
1194 | 1198 |
1195 if (needs_show_scrollbars_) | 1199 if (needs_show_scrollbars_) |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 ->subtree_has_copy_request; | 1445 ->subtree_has_copy_request; |
1442 } | 1446 } |
1443 | 1447 |
1444 gfx::Transform Layer::ScreenSpaceTransform() const { | 1448 gfx::Transform Layer::ScreenSpaceTransform() const { |
1445 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1449 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
1446 return draw_property_utils::ScreenSpaceTransform( | 1450 return draw_property_utils::ScreenSpaceTransform( |
1447 this, layer_tree_host_->property_trees()->transform_tree); | 1451 this, layer_tree_host_->property_trees()->transform_tree); |
1448 } | 1452 } |
1449 | 1453 |
1450 } // namespace cc | 1454 } // namespace cc |
OLD | NEW |