| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CC_TREES_MUTATOR_HOST_CLIENT_H_ | 5 #ifndef CC_TREES_MUTATOR_HOST_CLIENT_H_ |
| 6 #define CC_TREES_MUTATOR_HOST_CLIENT_H_ | 6 #define CC_TREES_MUTATOR_HOST_CLIENT_H_ |
| 7 | 7 |
| 8 namespace gfx { | 8 namespace gfx { |
| 9 class Transform; | 9 class Transform; |
| 10 class ScrollOffset; | 10 class ScrollOffset; |
| 11 } | 11 } |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class FilterOperations; | 15 class FilterOperations; |
| 16 class Layer; | |
| 17 | 16 |
| 18 using ElementId = int; | 17 using ElementId = int; |
| 19 | 18 |
| 20 enum class LayerTreeType { ACTIVE, PENDING }; | 19 enum class ElementListType { ACTIVE, PENDING }; |
| 21 | 20 |
| 22 class MutatorHostClient { | 21 class MutatorHostClient { |
| 23 public: | 22 public: |
| 24 virtual bool IsLayerInTree(int layer_id, LayerTreeType tree_type) const = 0; | 23 virtual bool IsElementInList(ElementId element_id, |
| 24 ElementListType list_type) const = 0; |
| 25 |
| 25 virtual void SetMutatorsNeedCommit() = 0; | 26 virtual void SetMutatorsNeedCommit() = 0; |
| 26 virtual void SetMutatorsNeedRebuildPropertyTrees() = 0; | 27 virtual void SetMutatorsNeedRebuildPropertyTrees() = 0; |
| 27 | 28 |
| 28 virtual void SetLayerFilterMutated(int layer_id, | 29 virtual void SetElementFilterMutated(ElementId element_id, |
| 29 LayerTreeType tree_type, | 30 ElementListType list_type, |
| 30 const FilterOperations& filters) = 0; | 31 const FilterOperations& filters) = 0; |
| 31 virtual void SetLayerOpacityMutated(int layer_id, | 32 virtual void SetElementOpacityMutated(ElementId element_id, |
| 32 LayerTreeType tree_type, | 33 ElementListType list_type, |
| 33 float opacity) = 0; | 34 float opacity) = 0; |
| 34 virtual void SetLayerTransformMutated(int layer_id, | 35 virtual void SetElementTransformMutated(ElementId element_id, |
| 35 LayerTreeType tree_type, | 36 ElementListType list_type, |
| 36 const gfx::Transform& transform) = 0; | 37 const gfx::Transform& transform) = 0; |
| 37 virtual void SetLayerScrollOffsetMutated( | 38 virtual void SetElementScrollOffsetMutated( |
| 38 int layer_id, | 39 ElementId element_id, |
| 39 LayerTreeType tree_type, | 40 ElementListType list_type, |
| 40 const gfx::ScrollOffset& scroll_offset) = 0; | 41 const gfx::ScrollOffset& scroll_offset) = 0; |
| 41 | 42 |
| 42 virtual void LayerTransformIsPotentiallyAnimatingChanged( | 43 virtual void ElementTransformIsPotentiallyAnimatingChanged( |
| 43 int layer_id, | 44 ElementId element_id, |
| 44 LayerTreeType tree_type, | 45 ElementListType list_type, |
| 45 bool is_animating) = 0; | 46 bool is_animating) = 0; |
| 46 | 47 |
| 47 virtual void ScrollOffsetAnimationFinished() = 0; | 48 virtual void ScrollOffsetAnimationFinished() = 0; |
| 48 virtual gfx::ScrollOffset GetScrollOffsetForAnimation(int layer_id) const = 0; | 49 virtual gfx::ScrollOffset GetScrollOffsetForAnimation( |
| 50 ElementId element_id) const = 0; |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 } // namespace cc | 53 } // namespace cc |
| 52 | 54 |
| 53 #endif // CC_TREES_MUTATOR_HOST_CLIENT_H_ | 55 #endif // CC_TREES_MUTATOR_HOST_CLIENT_H_ |
| OLD | NEW |