Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: cc/test/animation_timelines_test_common.h

Issue 2110683004: cc: Move filters to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/proto/property_tree.proto ('k') | cc/test/animation_timelines_test_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ 5 #ifndef CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_
6 #define CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ 6 #define CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 opacity_is_currently_animating_ = is_animating; 72 opacity_is_currently_animating_ = is_animating;
73 } 73 }
74 74
75 bool has_potential_opacity_animation() const { 75 bool has_potential_opacity_animation() const {
76 return has_potential_opacity_animation_; 76 return has_potential_opacity_animation_;
77 } 77 }
78 void set_has_potential_opacity_animation(bool is_animating) { 78 void set_has_potential_opacity_animation(bool is_animating) {
79 has_potential_opacity_animation_ = is_animating; 79 has_potential_opacity_animation_ = is_animating;
80 } 80 }
81 81
82 bool filter_is_currently_animating() const {
83 return filter_is_currently_animating_;
84 }
85 void set_filter_is_currently_animating(bool is_animating) {
86 filter_is_currently_animating_ = is_animating;
87 }
88
89 bool has_potential_filter_animation() const {
90 return has_potential_filter_animation_;
91 }
92 void set_has_potential_filter_animation(bool is_animating) {
93 has_potential_filter_animation_ = is_animating;
94 }
95
82 bool is_property_mutated(TargetProperty::Type property) const { 96 bool is_property_mutated(TargetProperty::Type property) const {
83 return mutated_properties_[property]; 97 return mutated_properties_[property];
84 } 98 }
85 99
86 private: 100 private:
87 TestLayer(); 101 TestLayer();
88 102
89 gfx::Transform transform_; 103 gfx::Transform transform_;
90 float opacity_; 104 float opacity_;
91 FilterOperations filters_; 105 FilterOperations filters_;
92 gfx::ScrollOffset scroll_offset_; 106 gfx::ScrollOffset scroll_offset_;
93 bool has_potential_transform_animation_; 107 bool has_potential_transform_animation_;
94 bool transform_is_currently_animating_; 108 bool transform_is_currently_animating_;
95 bool has_potential_opacity_animation_; 109 bool has_potential_opacity_animation_;
96 bool opacity_is_currently_animating_; 110 bool opacity_is_currently_animating_;
111 bool has_potential_filter_animation_;
112 bool filter_is_currently_animating_;
97 113
98 bool mutated_properties_[TargetProperty::LAST_TARGET_PROPERTY + 1]; 114 bool mutated_properties_[TargetProperty::LAST_TARGET_PROPERTY + 1];
99 }; 115 };
100 116
101 class TestHostClient : public MutatorHostClient { 117 class TestHostClient : public MutatorHostClient {
102 public: 118 public:
103 explicit TestHostClient(ThreadInstance thread_instance); 119 explicit TestHostClient(ThreadInstance thread_instance);
104 ~TestHostClient(); 120 ~TestHostClient();
105 121
106 void ClearMutatedProperties(); 122 void ClearMutatedProperties();
(...skipping 24 matching lines...) Expand all
131 void ElementTransformIsAnimatingChanged(ElementId element_id, 147 void ElementTransformIsAnimatingChanged(ElementId element_id,
132 ElementListType list_type, 148 ElementListType list_type,
133 AnimationChangeType change_type, 149 AnimationChangeType change_type,
134 bool is_animating) override; 150 bool is_animating) override;
135 151
136 void ElementOpacityIsAnimatingChanged(ElementId element_id, 152 void ElementOpacityIsAnimatingChanged(ElementId element_id,
137 ElementListType list_type, 153 ElementListType list_type,
138 AnimationChangeType change_type, 154 AnimationChangeType change_type,
139 bool is_animating) override; 155 bool is_animating) override;
140 156
157 void ElementFilterIsAnimatingChanged(ElementId element_id,
158 ElementListType list_type,
159 AnimationChangeType change_type,
160 bool is_animating) override;
161
141 void ScrollOffsetAnimationFinished() override {} 162 void ScrollOffsetAnimationFinished() override {}
142 163
143 void SetScrollOffsetForAnimation(const gfx::ScrollOffset& scroll_offset); 164 void SetScrollOffsetForAnimation(const gfx::ScrollOffset& scroll_offset);
144 gfx::ScrollOffset GetScrollOffsetForAnimation( 165 gfx::ScrollOffset GetScrollOffsetForAnimation(
145 ElementId element_id) const override; 166 ElementId element_id) const override;
146 167
147 bool mutators_need_commit() const { return mutators_need_commit_; } 168 bool mutators_need_commit() const { return mutators_need_commit_; }
148 void set_mutators_need_commit(bool need) { mutators_need_commit_ = need; } 169 void set_mutators_need_commit(bool need) { mutators_need_commit_ = need; }
149 170
150 void RegisterElement(ElementId element_id, ElementListType list_type); 171 void RegisterElement(ElementId element_id, ElementListType list_type);
(...skipping 16 matching lines...) Expand all
167 gfx::ScrollOffset GetScrollOffset(ElementId element_id, 188 gfx::ScrollOffset GetScrollOffset(ElementId element_id,
168 ElementListType list_type) const; 189 ElementListType list_type) const;
169 bool GetHasPotentialTransformAnimation(ElementId element_id, 190 bool GetHasPotentialTransformAnimation(ElementId element_id,
170 ElementListType list_type) const; 191 ElementListType list_type) const;
171 bool GetTransformIsCurrentlyAnimating(ElementId element_id, 192 bool GetTransformIsCurrentlyAnimating(ElementId element_id,
172 ElementListType list_type) const; 193 ElementListType list_type) const;
173 bool GetOpacityIsCurrentlyAnimating(ElementId element_id, 194 bool GetOpacityIsCurrentlyAnimating(ElementId element_id,
174 ElementListType list_type) const; 195 ElementListType list_type) const;
175 bool GetHasPotentialOpacityAnimation(ElementId element_id, 196 bool GetHasPotentialOpacityAnimation(ElementId element_id,
176 ElementListType list_type) const; 197 ElementListType list_type) const;
198 bool GetHasPotentialFilterAnimation(ElementId element_id,
199 ElementListType list_type) const;
200 bool GetFilterIsCurrentlyAnimating(ElementId element_id,
201 ElementListType list_type) const;
177 202
178 void ExpectFilterPropertyMutated(ElementId element_id, 203 void ExpectFilterPropertyMutated(ElementId element_id,
179 ElementListType list_type, 204 ElementListType list_type,
180 float brightness) const; 205 float brightness) const;
181 void ExpectOpacityPropertyMutated(ElementId element_id, 206 void ExpectOpacityPropertyMutated(ElementId element_id,
182 ElementListType list_type, 207 ElementListType list_type,
183 float opacity) const; 208 float opacity) const;
184 void ExpectTransformPropertyMutated(ElementId element_id, 209 void ExpectTransformPropertyMutated(ElementId element_id,
185 ElementListType list_type, 210 ElementListType list_type,
186 int transform_x, 211 int transform_x,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 scoped_refptr<AnimationTimeline> timeline_; 309 scoped_refptr<AnimationTimeline> timeline_;
285 scoped_refptr<AnimationPlayer> player_; 310 scoped_refptr<AnimationPlayer> player_;
286 311
287 scoped_refptr<AnimationTimeline> timeline_impl_; 312 scoped_refptr<AnimationTimeline> timeline_impl_;
288 scoped_refptr<AnimationPlayer> player_impl_; 313 scoped_refptr<AnimationPlayer> player_impl_;
289 }; 314 };
290 315
291 } // namespace cc 316 } // namespace cc
292 317
293 #endif // CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ 318 #endif // CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/proto/property_tree.proto ('k') | cc/test/animation_timelines_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698