| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 | 863 |
| 864 void Layer::AddMainThreadScrollingReasons( | 864 void Layer::AddMainThreadScrollingReasons( |
| 865 uint32_t main_thread_scrolling_reasons) { | 865 uint32_t main_thread_scrolling_reasons) { |
| 866 DCHECK(IsPropertyChangeAllowed()); | 866 DCHECK(IsPropertyChangeAllowed()); |
| 867 DCHECK(main_thread_scrolling_reasons); | 867 DCHECK(main_thread_scrolling_reasons); |
| 868 uint32_t new_reasons = | 868 uint32_t new_reasons = |
| 869 inputs_.main_thread_scrolling_reasons | main_thread_scrolling_reasons; | 869 inputs_.main_thread_scrolling_reasons | main_thread_scrolling_reasons; |
| 870 if (inputs_.main_thread_scrolling_reasons == new_reasons) | 870 if (inputs_.main_thread_scrolling_reasons == new_reasons) |
| 871 return; | 871 return; |
| 872 inputs_.main_thread_scrolling_reasons = new_reasons; | 872 inputs_.main_thread_scrolling_reasons = new_reasons; |
| 873 didUpdateMainThreadScrollingReasons(); |
| 873 SetNeedsCommit(); | 874 SetNeedsCommit(); |
| 874 } | 875 } |
| 875 | 876 |
| 876 void Layer::ClearMainThreadScrollingReasons( | 877 void Layer::ClearMainThreadScrollingReasons( |
| 877 uint32_t main_thread_scrolling_reasons_to_clear) { | 878 uint32_t main_thread_scrolling_reasons_to_clear) { |
| 878 DCHECK(IsPropertyChangeAllowed()); | 879 DCHECK(IsPropertyChangeAllowed()); |
| 879 DCHECK(main_thread_scrolling_reasons_to_clear); | 880 DCHECK(main_thread_scrolling_reasons_to_clear); |
| 880 uint32_t new_reasons = ~main_thread_scrolling_reasons_to_clear & | 881 uint32_t new_reasons = ~main_thread_scrolling_reasons_to_clear & |
| 881 inputs_.main_thread_scrolling_reasons; | 882 inputs_.main_thread_scrolling_reasons; |
| 882 if (new_reasons == inputs_.main_thread_scrolling_reasons) | 883 if (new_reasons == inputs_.main_thread_scrolling_reasons) |
| 883 return; | 884 return; |
| 884 inputs_.main_thread_scrolling_reasons = new_reasons; | 885 inputs_.main_thread_scrolling_reasons = new_reasons; |
| 886 didUpdateMainThreadScrollingReasons(); |
| 885 SetNeedsCommit(); | 887 SetNeedsCommit(); |
| 886 } | 888 } |
| 887 | 889 |
| 888 void Layer::SetNonFastScrollableRegion(const Region& region) { | 890 void Layer::SetNonFastScrollableRegion(const Region& region) { |
| 889 DCHECK(IsPropertyChangeAllowed()); | 891 DCHECK(IsPropertyChangeAllowed()); |
| 890 if (inputs_.non_fast_scrollable_region == region) | 892 if (inputs_.non_fast_scrollable_region == region) |
| 891 return; | 893 return; |
| 892 inputs_.non_fast_scrollable_region = region; | 894 inputs_.non_fast_scrollable_region = region; |
| 893 SetNeedsCommit(); | 895 SetNeedsCommit(); |
| 894 } | 896 } |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 } | 1574 } |
| 1573 | 1575 |
| 1574 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 1576 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 1575 Layer::TakeDebugInfo() { | 1577 Layer::TakeDebugInfo() { |
| 1576 if (inputs_.client) | 1578 if (inputs_.client) |
| 1577 return inputs_.client->TakeDebugInfo(this); | 1579 return inputs_.client->TakeDebugInfo(this); |
| 1578 else | 1580 else |
| 1579 return nullptr; | 1581 return nullptr; |
| 1580 } | 1582 } |
| 1581 | 1583 |
| 1584 void Layer::didUpdateMainThreadScrollingReasons() { |
| 1585 if (inputs_.client) |
| 1586 inputs_.client->didUpdateMainThreadScrollingReasons(); |
| 1587 } |
| 1588 |
| 1582 void Layer::SetSubtreePropertyChanged() { | 1589 void Layer::SetSubtreePropertyChanged() { |
| 1583 if (subtree_property_changed_) | 1590 if (subtree_property_changed_) |
| 1584 return; | 1591 return; |
| 1585 subtree_property_changed_ = true; | 1592 subtree_property_changed_ = true; |
| 1586 SetNeedsPushProperties(); | 1593 SetNeedsPushProperties(); |
| 1587 } | 1594 } |
| 1588 | 1595 |
| 1589 void Layer::SetLayerPropertyChanged() { | 1596 void Layer::SetLayerPropertyChanged() { |
| 1590 if (layer_property_changed_) | 1597 if (layer_property_changed_) |
| 1591 return; | 1598 return; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 ->num_copy_requests_in_subtree; | 1843 ->num_copy_requests_in_subtree; |
| 1837 } | 1844 } |
| 1838 | 1845 |
| 1839 gfx::Transform Layer::screen_space_transform() const { | 1846 gfx::Transform Layer::screen_space_transform() const { |
| 1840 DCHECK_NE(transform_tree_index_, -1); | 1847 DCHECK_NE(transform_tree_index_, -1); |
| 1841 return draw_property_utils::ScreenSpaceTransform( | 1848 return draw_property_utils::ScreenSpaceTransform( |
| 1842 this, layer_tree_host_->property_trees()->transform_tree); | 1849 this, layer_tree_host_->property_trees()->transform_tree); |
| 1843 } | 1850 } |
| 1844 | 1851 |
| 1845 } // namespace cc | 1852 } // namespace cc |
| OLD | NEW |