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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 } | 729 } |
730 | 730 |
731 void Layer::SetTouchEventHandlerRegion(const Region& region) { | 731 void Layer::SetTouchEventHandlerRegion(const Region& region) { |
732 DCHECK(IsPropertyChangeAllowed()); | 732 DCHECK(IsPropertyChangeAllowed()); |
733 if (touch_event_handler_region_ == region) | 733 if (touch_event_handler_region_ == region) |
734 return; | 734 return; |
735 touch_event_handler_region_ = region; | 735 touch_event_handler_region_ = region; |
736 SetNeedsCommit(); | 736 SetNeedsCommit(); |
737 } | 737 } |
738 | 738 |
| 739 void Layer::SetSmoothnessTimingRequests( |
| 740 const SmoothnessTimingRequestsType& rects) { |
| 741 DCHECK(IsPropertyChangeAllowed()); |
| 742 if (smoothness_timing_requests_ == rects) |
| 743 return; |
| 744 smoothness_timing_requests_ = rects; |
| 745 SetNeedsCommit(); |
| 746 } |
| 747 |
739 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { | 748 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { |
740 DCHECK(IsPropertyChangeAllowed()); | 749 DCHECK(IsPropertyChangeAllowed()); |
741 if (draw_checkerboard_for_missing_tiles_ == checkerboard) | 750 if (draw_checkerboard_for_missing_tiles_ == checkerboard) |
742 return; | 751 return; |
743 draw_checkerboard_for_missing_tiles_ = checkerboard; | 752 draw_checkerboard_for_missing_tiles_ = checkerboard; |
744 SetNeedsCommit(); | 753 SetNeedsCommit(); |
745 } | 754 } |
746 | 755 |
747 void Layer::SetForceRenderSurface(bool force) { | 756 void Layer::SetForceRenderSurface(bool force) { |
748 DCHECK(IsPropertyChangeAllowed()); | 757 DCHECK(IsPropertyChangeAllowed()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 891 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
883 layer->SetFilters(filters_); | 892 layer->SetFilters(filters_); |
884 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 893 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
885 layer->SetBackgroundFilters(background_filters()); | 894 layer->SetBackgroundFilters(background_filters()); |
886 layer->SetMasksToBounds(masks_to_bounds_); | 895 layer->SetMasksToBounds(masks_to_bounds_); |
887 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 896 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
888 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 897 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
889 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); | 898 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); |
890 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 899 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
891 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 900 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
| 901 layer->SetSmoothnessTimingRequests(smoothness_timing_requests_); |
892 layer->SetContentsOpaque(contents_opaque_); | 902 layer->SetContentsOpaque(contents_opaque_); |
893 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) | 903 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) |
894 layer->SetOpacity(opacity_); | 904 layer->SetOpacity(opacity_); |
895 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); | 905 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); |
896 layer->SetBlendMode(blend_mode_); | 906 layer->SetBlendMode(blend_mode_); |
897 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); | 907 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); |
898 layer->SetPosition(position_); | 908 layer->SetPosition(position_); |
899 layer->SetIsContainerForFixedPositionLayers( | 909 layer->SetIsContainerForFixedPositionLayers( |
900 IsContainerForFixedPositionLayers()); | 910 IsContainerForFixedPositionLayers()); |
901 layer->SetPositionConstraint(position_constraint_); | 911 layer->SetPositionConstraint(position_constraint_); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 | 1247 |
1238 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1248 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1239 benchmark->RunOnLayer(this); | 1249 benchmark->RunOnLayer(this); |
1240 } | 1250 } |
1241 | 1251 |
1242 bool Layer::HasDelegatedContent() const { | 1252 bool Layer::HasDelegatedContent() const { |
1243 return false; | 1253 return false; |
1244 } | 1254 } |
1245 | 1255 |
1246 } // namespace cc | 1256 } // namespace cc |
OLD | NEW |