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_GT(layer_id_, 0); | 59 DCHECK_GT(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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 layer->SetMasksToBounds(masks_to_bounds_); | 333 layer->SetMasksToBounds(masks_to_bounds_); |
335 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 334 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
336 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 335 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
337 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 336 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
338 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 337 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
339 layer->SetContentsOpaque(contents_opaque_); | 338 layer->SetContentsOpaque(contents_opaque_); |
340 layer->SetOpacity(opacity_); | 339 layer->SetOpacity(opacity_); |
341 layer->SetPosition(position_); | 340 layer->SetPosition(position_); |
342 layer->SetIsContainerForFixedPositionLayers( | 341 layer->SetIsContainerForFixedPositionLayers( |
343 is_container_for_fixed_position_layers_); | 342 is_container_for_fixed_position_layers_); |
344 layer->SetFixedToContainerLayer(fixed_to_container_layer_); | 343 layer->SetFixedContainerSizeDelta(fixed_container_size_delta_); |
| 344 layer->SetPositionConstraint(position_constraint_); |
345 layer->SetPreserves3d(preserves_3d()); | 345 layer->SetPreserves3d(preserves_3d()); |
346 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); | 346 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); |
347 layer->SetSublayerTransform(sublayer_transform_); | 347 layer->SetSublayerTransform(sublayer_transform_); |
348 layer->SetTransform(transform_); | 348 layer->SetTransform(transform_); |
349 | 349 |
350 layer->SetScrollable(scrollable_); | 350 layer->SetScrollable(scrollable_); |
351 layer->SetScrollOffset(scroll_offset_); | 351 layer->SetScrollOffset(scroll_offset_); |
352 layer->SetMaxScrollOffset(max_scroll_offset_); | 352 layer->SetMaxScrollOffset(max_scroll_offset_); |
353 | 353 |
354 // If the main thread commits multiple times before the impl thread actually | 354 // If the main thread commits multiple times before the impl thread actually |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 dict->Set("layer_quad", MathUtil::AsValue(layer_quad).release()); | 966 dict->Set("layer_quad", MathUtil::AsValue(layer_quad).release()); |
967 } | 967 } |
968 | 968 |
969 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 969 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
970 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 970 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
971 AsValueInto(state.get()); | 971 AsValueInto(state.get()); |
972 return state.PassAs<base::Value>(); | 972 return state.PassAs<base::Value>(); |
973 } | 973 } |
974 | 974 |
975 } // namespace cc | 975 } // namespace cc |
OLD | NEW |