| 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 } | 726 } |
| 727 | 727 |
| 728 void Layer::SetTouchEventHandlerRegion(const Region& region) { | 728 void Layer::SetTouchEventHandlerRegion(const Region& region) { |
| 729 DCHECK(IsPropertyChangeAllowed()); | 729 DCHECK(IsPropertyChangeAllowed()); |
| 730 if (touch_event_handler_region_ == region) | 730 if (touch_event_handler_region_ == region) |
| 731 return; | 731 return; |
| 732 touch_event_handler_region_ = region; | 732 touch_event_handler_region_ = region; |
| 733 SetNeedsCommit(); | 733 SetNeedsCommit(); |
| 734 } | 734 } |
| 735 | 735 |
| 736 void Layer::SetDrawFrameRequestRects(const DrawFrameRequestRectsType& rects) { |
| 737 DCHECK(IsPropertyChangeAllowed()); |
| 738 if (draw_frame_request_rects_ == rects) |
| 739 return; |
| 740 draw_frame_request_rects_ = rects; |
| 741 SetNeedsCommit(); |
| 742 } |
| 743 |
| 736 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { | 744 void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) { |
| 737 DCHECK(IsPropertyChangeAllowed()); | 745 DCHECK(IsPropertyChangeAllowed()); |
| 738 if (draw_checkerboard_for_missing_tiles_ == checkerboard) | 746 if (draw_checkerboard_for_missing_tiles_ == checkerboard) |
| 739 return; | 747 return; |
| 740 draw_checkerboard_for_missing_tiles_ = checkerboard; | 748 draw_checkerboard_for_missing_tiles_ = checkerboard; |
| 741 SetNeedsCommit(); | 749 SetNeedsCommit(); |
| 742 } | 750 } |
| 743 | 751 |
| 744 void Layer::SetForceRenderSurface(bool force) { | 752 void Layer::SetForceRenderSurface(bool force) { |
| 745 DCHECK(IsPropertyChangeAllowed()); | 753 DCHECK(IsPropertyChangeAllowed()); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 885 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
| 878 layer->SetFilters(filters_); | 886 layer->SetFilters(filters_); |
| 879 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 887 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
| 880 layer->SetBackgroundFilters(background_filters()); | 888 layer->SetBackgroundFilters(background_filters()); |
| 881 layer->SetMasksToBounds(masks_to_bounds_); | 889 layer->SetMasksToBounds(masks_to_bounds_); |
| 882 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 890 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
| 883 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 891 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
| 884 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); | 892 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); |
| 885 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 893 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
| 886 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 894 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
| 895 layer->SetDrawFrameRequestRects(draw_frame_request_rects_); |
| 887 layer->SetContentsOpaque(contents_opaque_); | 896 layer->SetContentsOpaque(contents_opaque_); |
| 888 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) | 897 if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) |
| 889 layer->SetOpacity(opacity_); | 898 layer->SetOpacity(opacity_); |
| 890 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); | 899 DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); |
| 891 layer->SetBlendMode(blend_mode_); | 900 layer->SetBlendMode(blend_mode_); |
| 892 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); | 901 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); |
| 893 layer->SetPosition(position_); | 902 layer->SetPosition(position_); |
| 894 layer->SetIsContainerForFixedPositionLayers( | 903 layer->SetIsContainerForFixedPositionLayers( |
| 895 IsContainerForFixedPositionLayers()); | 904 IsContainerForFixedPositionLayers()); |
| 896 layer->SetPositionConstraint(position_constraint_); | 905 layer->SetPositionConstraint(position_constraint_); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 if (clip_parent_) | 1195 if (clip_parent_) |
| 1187 clip_parent_->RemoveClipChild(this); | 1196 clip_parent_->RemoveClipChild(this); |
| 1188 | 1197 |
| 1189 clip_parent_ = NULL; | 1198 clip_parent_ = NULL; |
| 1190 } | 1199 } |
| 1191 | 1200 |
| 1192 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1201 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 1193 benchmark->RunOnLayer(this); | 1202 benchmark->RunOnLayer(this); |
| 1194 } | 1203 } |
| 1195 } // namespace cc | 1204 } // namespace cc |
| OLD | NEW |