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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 hide_layer_and_subtree_(false), | 64 hide_layer_and_subtree_(false), |
65 masks_to_bounds_(false), | 65 masks_to_bounds_(false), |
66 contents_opaque_(false), | 66 contents_opaque_(false), |
67 double_sided_(true), | 67 double_sided_(true), |
68 should_flatten_transform_(true), | 68 should_flatten_transform_(true), |
69 use_parent_backface_visibility_(false), | 69 use_parent_backface_visibility_(false), |
70 draw_checkerboard_for_missing_tiles_(false), | 70 draw_checkerboard_for_missing_tiles_(false), |
71 force_render_surface_(false), | 71 force_render_surface_(false), |
72 transform_is_invertible_(true), | 72 transform_is_invertible_(true), |
73 has_render_surface_(false), | 73 has_render_surface_(false), |
74 scroll_blocks_on_(ScrollBlocksOnNone), | |
jdduke (slow)
2015/02/03 16:43:35
I wonder if it's worth a static assert for ScrollB
Rick Byers
2015/02/05 04:35:53
Sure, done. I also updated my COMPILE_ASSERTs to
| |
74 background_color_(0), | 75 background_color_(0), |
75 opacity_(1.f), | 76 opacity_(1.f), |
76 blend_mode_(SkXfermode::kSrcOver_Mode), | 77 blend_mode_(SkXfermode::kSrcOver_Mode), |
77 scroll_parent_(nullptr), | 78 scroll_parent_(nullptr), |
78 clip_parent_(nullptr), | 79 clip_parent_(nullptr), |
79 replica_layer_(nullptr), | 80 replica_layer_(nullptr), |
80 raster_scale_(0.f), | 81 raster_scale_(0.f), |
81 client_(nullptr), | 82 client_(nullptr), |
82 frame_timing_requests_dirty_(false) { | 83 frame_timing_requests_dirty_(false) { |
83 layer_animation_controller_ = LayerAnimationController::Create(layer_id_); | 84 layer_animation_controller_ = LayerAnimationController::Create(layer_id_); |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
751 } | 752 } |
752 | 753 |
753 void Layer::SetTouchEventHandlerRegion(const Region& region) { | 754 void Layer::SetTouchEventHandlerRegion(const Region& region) { |
754 DCHECK(IsPropertyChangeAllowed()); | 755 DCHECK(IsPropertyChangeAllowed()); |
755 if (touch_event_handler_region_ == region) | 756 if (touch_event_handler_region_ == region) |
756 return; | 757 return; |
757 touch_event_handler_region_ = region; | 758 touch_event_handler_region_ = region; |
758 SetNeedsCommit(); | 759 SetNeedsCommit(); |
759 } | 760 } |
760 | 761 |
762 void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) { | |
763 DCHECK(IsPropertyChangeAllowed()); | |
764 if (scroll_blocks_on_ == scroll_blocks_on) | |
765 return; | |
766 scroll_blocks_on_ = scroll_blocks_on; | |
767 SetNeedsCommit(); | |
768 } | |
769 | |
761 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { | 770 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { |
762 DCHECK(IsPropertyChangeAllowed()); | 771 DCHECK(IsPropertyChangeAllowed()); |
763 if (draw_checkerboard_for_missing_tiles_ == checkerboard) | 772 if (draw_checkerboard_for_missing_tiles_ == checkerboard) |
764 return; | 773 return; |
765 draw_checkerboard_for_missing_tiles_ = checkerboard; | 774 draw_checkerboard_for_missing_tiles_ = checkerboard; |
766 SetNeedsCommit(); | 775 SetNeedsCommit(); |
767 } | 776 } |
768 | 777 |
769 void Layer::SetForceRenderSurface(bool force) { | 778 void Layer::SetForceRenderSurface(bool force) { |
770 DCHECK(IsPropertyChangeAllowed()); | 779 DCHECK(IsPropertyChangeAllowed()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
904 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 913 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
905 layer->SetFilters(filters_); | 914 layer->SetFilters(filters_); |
906 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 915 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
907 layer->SetBackgroundFilters(background_filters()); | 916 layer->SetBackgroundFilters(background_filters()); |
908 layer->SetMasksToBounds(masks_to_bounds_); | 917 layer->SetMasksToBounds(masks_to_bounds_); |
909 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 918 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
910 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 919 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
911 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); | 920 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); |
912 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 921 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
913 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 922 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
923 layer->SetScrollBlocksOn(scroll_blocks_on_); | |
914 layer->SetContentsOpaque(contents_opaque_); | 924 layer->SetContentsOpaque(contents_opaque_); |
915 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) | 925 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) |
916 layer->SetOpacity(opacity_); | 926 layer->SetOpacity(opacity_); |
917 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); | 927 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); |
918 layer->SetBlendMode(blend_mode_); | 928 layer->SetBlendMode(blend_mode_); |
919 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); | 929 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); |
920 layer->SetPosition(position_); | 930 layer->SetPosition(position_); |
921 layer->SetIsContainerForFixedPositionLayers( | 931 layer->SetIsContainerForFixedPositionLayers( |
922 IsContainerForFixedPositionLayers()); | 932 IsContainerForFixedPositionLayers()); |
923 layer->SetPositionConstraint(position_constraint_); | 933 layer->SetPositionConstraint(position_constraint_); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1297 } | 1307 } |
1298 | 1308 |
1299 void Layer::SetFrameTimingRequests( | 1309 void Layer::SetFrameTimingRequests( |
1300 const std::vector<FrameTimingRequest>& requests) { | 1310 const std::vector<FrameTimingRequest>& requests) { |
1301 frame_timing_requests_ = requests; | 1311 frame_timing_requests_ = requests; |
1302 frame_timing_requests_dirty_ = true; | 1312 frame_timing_requests_dirty_ = true; |
1303 SetNeedsCommit(); | 1313 SetNeedsCommit(); |
1304 } | 1314 } |
1305 | 1315 |
1306 } // namespace cc | 1316 } // namespace cc |
OLD | NEW |