| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 return LayerImpl::Create(tree_impl, layer_id_); | 305 return LayerImpl::Create(tree_impl, layer_id_); |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool LayerImpl::IsSnapped() { | 308 bool LayerImpl::IsSnapped() { |
| 309 return scrollable(); | 309 return scrollable(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { | 312 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { |
| 313 DCHECK(layer->IsActive()); | 313 DCHECK(layer->IsActive()); |
| 314 | 314 |
| 315 // The ElementId should be set first because other setters depend on it such |
| 316 // as LayerImpl::SetScrollClipLayer. |
| 317 layer->SetElementId(element_id_); |
| 318 |
| 315 layer->offset_to_transform_parent_ = offset_to_transform_parent_; | 319 layer->offset_to_transform_parent_ = offset_to_transform_parent_; |
| 316 layer->main_thread_scrolling_reasons_ = main_thread_scrolling_reasons_; | 320 layer->main_thread_scrolling_reasons_ = main_thread_scrolling_reasons_; |
| 317 layer->user_scrollable_horizontal_ = user_scrollable_horizontal_; | 321 layer->user_scrollable_horizontal_ = user_scrollable_horizontal_; |
| 318 layer->user_scrollable_vertical_ = user_scrollable_vertical_; | 322 layer->user_scrollable_vertical_ = user_scrollable_vertical_; |
| 319 layer->should_flatten_transform_from_property_tree_ = | 323 layer->should_flatten_transform_from_property_tree_ = |
| 320 should_flatten_transform_from_property_tree_; | 324 should_flatten_transform_from_property_tree_; |
| 321 layer->masks_to_bounds_ = masks_to_bounds_; | 325 layer->masks_to_bounds_ = masks_to_bounds_; |
| 322 layer->contents_opaque_ = contents_opaque_; | 326 layer->contents_opaque_ = contents_opaque_; |
| 323 layer->may_contain_video_ = may_contain_video_; | 327 layer->may_contain_video_ = may_contain_video_; |
| 324 layer->use_parent_backface_visibility_ = use_parent_backface_visibility_; | 328 layer->use_parent_backface_visibility_ = use_parent_backface_visibility_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 339 layer->scrollbars_hidden_ = scrollbars_hidden_; | 343 layer->scrollbars_hidden_ = scrollbars_hidden_; |
| 340 layer->needs_show_scrollbars_ = needs_show_scrollbars_; | 344 layer->needs_show_scrollbars_ = needs_show_scrollbars_; |
| 341 | 345 |
| 342 if (layer_property_changed_) { | 346 if (layer_property_changed_) { |
| 343 layer->layer_tree_impl()->set_needs_update_draw_properties(); | 347 layer->layer_tree_impl()->set_needs_update_draw_properties(); |
| 344 layer->layer_property_changed_ = true; | 348 layer->layer_property_changed_ = true; |
| 345 } | 349 } |
| 346 | 350 |
| 347 layer->SetBounds(bounds_); | 351 layer->SetBounds(bounds_); |
| 348 layer->SetScrollClipLayer(scroll_clip_layer_id_); | 352 layer->SetScrollClipLayer(scroll_clip_layer_id_); |
| 349 layer->SetElementId(element_id_); | |
| 350 layer->SetMutableProperties(mutable_properties_); | 353 layer->SetMutableProperties(mutable_properties_); |
| 351 | 354 |
| 352 // If the main thread commits multiple times before the impl thread actually | 355 // If the main thread commits multiple times before the impl thread actually |
| 353 // draws, then damage tracking will become incorrect if we simply clobber the | 356 // draws, then damage tracking will become incorrect if we simply clobber the |
| 354 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. | 357 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. |
| 355 // union) any update changes that have occurred on the main thread. | 358 // union) any update changes that have occurred on the main thread. |
| 356 update_rect_.Union(layer->update_rect()); | 359 update_rect_.Union(layer->update_rect()); |
| 357 layer->SetUpdateRect(update_rect_); | 360 layer->SetUpdateRect(update_rect_); |
| 358 | 361 |
| 359 if (owned_debug_info_) | 362 if (owned_debug_info_) |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 | 977 |
| 975 ScrollTree& LayerImpl::GetScrollTree() const { | 978 ScrollTree& LayerImpl::GetScrollTree() const { |
| 976 return GetPropertyTrees()->scroll_tree; | 979 return GetPropertyTrees()->scroll_tree; |
| 977 } | 980 } |
| 978 | 981 |
| 979 TransformTree& LayerImpl::GetTransformTree() const { | 982 TransformTree& LayerImpl::GetTransformTree() const { |
| 980 return GetPropertyTrees()->transform_tree; | 983 return GetPropertyTrees()->transform_tree; |
| 981 } | 984 } |
| 982 | 985 |
| 983 } // namespace cc | 986 } // namespace cc |
| OLD | NEW |