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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 layer_surface_property_changed_(false), | 43 layer_surface_property_changed_(false), |
44 masks_to_bounds_(false), | 44 masks_to_bounds_(false), |
45 contents_opaque_(false), | 45 contents_opaque_(false), |
46 opacity_(1.0), | 46 opacity_(1.0), |
47 preserves_3d_(false), | 47 preserves_3d_(false), |
48 use_parent_backface_visibility_(false), | 48 use_parent_backface_visibility_(false), |
49 draw_checkerboard_for_missing_tiles_(false), | 49 draw_checkerboard_for_missing_tiles_(false), |
50 draws_content_(false), | 50 draws_content_(false), |
51 force_render_surface_(false), | 51 force_render_surface_(false), |
52 is_container_for_fixed_position_layers_(false), | 52 is_container_for_fixed_position_layers_(false), |
53 fixed_to_container_layer_(false), | |
54 draw_depth_(0.f), | 53 draw_depth_(0.f), |
55 #ifndef NDEBUG | 54 #ifndef NDEBUG |
56 between_will_draw_and_did_draw_(false), | 55 between_will_draw_and_did_draw_(false), |
57 #endif | 56 #endif |
58 horizontal_scrollbar_layer_(NULL), | 57 horizontal_scrollbar_layer_(NULL), |
59 vertical_scrollbar_layer_(NULL) { | 58 vertical_scrollbar_layer_(NULL) { |
60 DCHECK(layer_id_ > 0); | 59 DCHECK(layer_id_ > 0); |
61 DCHECK(layer_tree_impl_); | 60 DCHECK(layer_tree_impl_); |
62 layer_tree_impl_->RegisterLayer(this); | 61 layer_tree_impl_->RegisterLayer(this); |
63 AnimationRegistrar* registrar = layer_tree_impl_->animationRegistrar(); | 62 AnimationRegistrar* registrar = layer_tree_impl_->animationRegistrar(); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 layer->SetMasksToBounds(masks_to_bounds_); | 329 layer->SetMasksToBounds(masks_to_bounds_); |
331 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 330 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
332 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 331 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
333 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 332 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
334 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 333 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
335 layer->SetContentsOpaque(contents_opaque_); | 334 layer->SetContentsOpaque(contents_opaque_); |
336 layer->SetOpacity(opacity_); | 335 layer->SetOpacity(opacity_); |
337 layer->SetPosition(position_); | 336 layer->SetPosition(position_); |
338 layer->SetIsContainerForFixedPositionLayers( | 337 layer->SetIsContainerForFixedPositionLayers( |
339 is_container_for_fixed_position_layers_); | 338 is_container_for_fixed_position_layers_); |
340 layer->SetFixedToContainerLayer(fixed_to_container_layer_); | 339 layer->SetFixedContainerSizeDelta(fixed_container_size_delta_); |
| 340 layer->SetPositionConstraint(position_constraint_); |
341 layer->SetPreserves3d(preserves_3d()); | 341 layer->SetPreserves3d(preserves_3d()); |
342 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); | 342 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); |
343 layer->SetSublayerTransform(sublayer_transform_); | 343 layer->SetSublayerTransform(sublayer_transform_); |
344 layer->SetTransform(transform_); | 344 layer->SetTransform(transform_); |
345 | 345 |
346 layer->SetScrollable(scrollable_); | 346 layer->SetScrollable(scrollable_); |
347 layer->SetScrollOffset(scroll_offset_); | 347 layer->SetScrollOffset(scroll_offset_); |
348 layer->SetMaxScrollOffset(max_scroll_offset_); | 348 layer->SetMaxScrollOffset(max_scroll_offset_); |
349 | 349 |
350 // If the main thread commits multiple times before the impl thread actually | 350 // If the main thread commits multiple times before the impl thread actually |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 957 |
958 } | 958 } |
959 | 959 |
960 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 960 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
961 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 961 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
962 AsValueInto(state.get()); | 962 AsValueInto(state.get()); |
963 return state.PassAs<base::Value>(); | 963 return state.PassAs<base::Value>(); |
964 } | 964 } |
965 | 965 |
966 } // namespace cc | 966 } // namespace cc |
OLD | NEW |