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

Side by Side Diff: cc/animation/element_animations.h

Issue 2291463003: Revert "CC Animation: Introduce some dirty flags to optimize PushProperties on commit" (Closed)
Patch Set: Created 4 years, 3 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/animation/animation_timeline.cc ('k') | cc/animation/element_animations.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_ANIMATION_ELEMENT_ANIMATIONS_H_ 5 #ifndef CC_ANIMATION_ELEMENT_ANIMATIONS_H_
6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ 6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_
7 7
8 #include <bitset> 8 #include <bitset>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // the removed animation. This is to provide the illusion of synchronicity to 171 // the removed animation. This is to provide the illusion of synchronicity to
172 // JS that simultaneously removes an animation and sets the scroll offset. 172 // JS that simultaneously removes an animation and sets the scroll offset.
173 bool scroll_offset_animation_was_interrupted() const { 173 bool scroll_offset_animation_was_interrupted() const {
174 return scroll_offset_animation_was_interrupted_; 174 return scroll_offset_animation_was_interrupted_;
175 } 175 }
176 176
177 bool needs_to_start_animations_for_testing() { 177 bool needs_to_start_animations_for_testing() {
178 return needs_to_start_animations_; 178 return needs_to_start_animations_;
179 } 179 }
180 180
181 void SetNeedsPushProperties();
182 bool needs_push_properties() const { return needs_push_properties_; }
183
184 private: 181 private:
185 friend class base::RefCounted<ElementAnimations>; 182 friend class base::RefCounted<ElementAnimations>;
186 183
187 ElementAnimations(); 184 ElementAnimations();
188 ~ElementAnimations(); 185 ~ElementAnimations();
189 186
190 // A set of target properties. TargetProperty must be 0-based enum. 187 // A set of target properties. TargetProperty must be 0-based enum.
191 using TargetProperties = 188 using TargetProperties =
192 std::bitset<TargetProperty::LAST_TARGET_PROPERTY + 1>; 189 std::bitset<TargetProperty::LAST_TARGET_PROPERTY + 1>;
193 190
(...skipping 23 matching lines...) Expand all
217 bool notify_pending_elements); 214 bool notify_pending_elements);
218 void NotifyClientTransformAnimated(const gfx::Transform& transform, 215 void NotifyClientTransformAnimated(const gfx::Transform& transform,
219 bool notify_active_elements, 216 bool notify_active_elements,
220 bool notify_pending_elements); 217 bool notify_pending_elements);
221 void NotifyClientFilterAnimated(const FilterOperations& filter, 218 void NotifyClientFilterAnimated(const FilterOperations& filter,
222 bool notify_active_elements, 219 bool notify_active_elements,
223 bool notify_pending_elements); 220 bool notify_pending_elements);
224 void NotifyClientScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset, 221 void NotifyClientScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset,
225 bool notify_active_elements, 222 bool notify_active_elements,
226 bool notify_pending_elements); 223 bool notify_pending_elements);
224
225 void NotifyClientAnimationWaitingForDeletion();
226
227 void NotifyClientAnimationChanged( 227 void NotifyClientAnimationChanged(
228 TargetProperty::Type property, 228 TargetProperty::Type property,
229 ElementListType list_type, 229 ElementListType list_type,
230 bool notify_elements_about_potential_animation, 230 bool notify_elements_about_potential_animation,
231 bool notify_elements_about_running_animation); 231 bool notify_elements_about_running_animation);
232 232
233 void UpdateClientAnimationState(TargetProperty::Type property); 233 void UpdateClientAnimationState(TargetProperty::Type property);
234 234
235 void OnFilterAnimated(ElementListType list_type, 235 void OnFilterAnimated(ElementListType list_type,
236 const FilterOperations& filters); 236 const FilterOperations& filters);
237 void OnOpacityAnimated(ElementListType list_type, float opacity); 237 void OnOpacityAnimated(ElementListType list_type, float opacity);
238 void OnTransformAnimated(ElementListType list_type, 238 void OnTransformAnimated(ElementListType list_type,
239 const gfx::Transform& transform); 239 const gfx::Transform& transform);
240 void OnScrollOffsetAnimated(ElementListType list_type, 240 void OnScrollOffsetAnimated(ElementListType list_type,
241 const gfx::ScrollOffset& scroll_offset); 241 const gfx::ScrollOffset& scroll_offset);
242 void OnAnimationWaitingForDeletion();
242 void IsAnimatingChanged(ElementListType list_type, 243 void IsAnimatingChanged(ElementListType list_type,
243 TargetProperty::Type property, 244 TargetProperty::Type property,
244 AnimationChangeType change_type, 245 AnimationChangeType change_type,
245 bool is_animating); 246 bool is_animating);
246 gfx::ScrollOffset ScrollOffsetForAnimation() const; 247 gfx::ScrollOffset ScrollOffsetForAnimation() const;
247 248
248 void NotifyPlayersAnimationStarted(base::TimeTicks monotonic_time, 249 void NotifyPlayersAnimationStarted(base::TimeTicks monotonic_time,
249 TargetProperty::Type target_property, 250 TargetProperty::Type target_property,
250 int group); 251 int group);
251 void NotifyPlayersAnimationFinished(base::TimeTicks monotonic_time, 252 void NotifyPlayersAnimationFinished(base::TimeTicks monotonic_time,
252 TargetProperty::Type target_property, 253 TargetProperty::Type target_property,
253 int group); 254 int group);
254 void NotifyPlayersAnimationAborted(base::TimeTicks monotonic_time, 255 void NotifyPlayersAnimationAborted(base::TimeTicks monotonic_time,
255 TargetProperty::Type target_property, 256 TargetProperty::Type target_property,
256 int group); 257 int group);
257 void NotifyPlayersAnimationWaitingForDeletion();
258 void NotifyPlayersAnimationPropertyUpdate(const AnimationEvent& event); 258 void NotifyPlayersAnimationPropertyUpdate(const AnimationEvent& event);
259 void NotifyPlayersAnimationTakeover(base::TimeTicks monotonic_time, 259 void NotifyPlayersAnimationTakeover(base::TimeTicks monotonic_time,
260 TargetProperty::Type target_property, 260 TargetProperty::Type target_property,
261 double animation_start_time, 261 double animation_start_time,
262 std::unique_ptr<AnimationCurve> curve); 262 std::unique_ptr<AnimationCurve> curve);
263 263
264 std::unique_ptr<PlayersList> players_list_; 264 std::unique_ptr<PlayersList> players_list_;
265 AnimationHost* animation_host_; 265 AnimationHost* animation_host_;
266 ElementId element_id_; 266 ElementId element_id_;
267 std::vector<std::unique_ptr<Animation>> animations_; 267 std::vector<std::unique_ptr<Animation>> animations_;
268 268
269 // This is used to ensure that we don't spam the animation host. 269 // This is used to ensure that we don't spam the animation host.
270 bool is_active_; 270 bool is_active_;
271 271
272 base::TimeTicks last_tick_time_; 272 base::TimeTicks last_tick_time_;
273 273
274 bool has_element_in_active_list_; 274 bool has_element_in_active_list_;
275 bool has_element_in_pending_list_; 275 bool has_element_in_pending_list_;
276 276
277 // Only try to start animations when new animations are added or when the 277 // Only try to start animations when new animations are added or when the
278 // previous attempt at starting animations failed to start all animations. 278 // previous attempt at starting animations failed to start all animations.
279 bool needs_to_start_animations_; 279 bool needs_to_start_animations_;
280 280
281 bool scroll_offset_animation_was_interrupted_; 281 bool scroll_offset_animation_was_interrupted_;
282 282
283 bool needs_push_properties_;
284
285 struct PropertyAnimationState { 283 struct PropertyAnimationState {
286 bool currently_running_for_active_elements = false; 284 bool currently_running_for_active_elements = false;
287 bool currently_running_for_pending_elements = false; 285 bool currently_running_for_pending_elements = false;
288 bool potentially_animating_for_active_elements = false; 286 bool potentially_animating_for_active_elements = false;
289 bool potentially_animating_for_pending_elements = false; 287 bool potentially_animating_for_pending_elements = false;
290 void Clear() { 288 void Clear() {
291 currently_running_for_active_elements = false; 289 currently_running_for_active_elements = false;
292 currently_running_for_pending_elements = false; 290 currently_running_for_pending_elements = false;
293 potentially_animating_for_active_elements = false; 291 potentially_animating_for_active_elements = false;
294 potentially_animating_for_pending_elements = false; 292 potentially_animating_for_pending_elements = false;
295 } 293 }
296 }; 294 };
297 295
298 struct PropertyAnimationState filter_animation_state_; 296 struct PropertyAnimationState filter_animation_state_;
299 struct PropertyAnimationState opacity_animation_state_; 297 struct PropertyAnimationState opacity_animation_state_;
300 struct PropertyAnimationState transform_animation_state_; 298 struct PropertyAnimationState transform_animation_state_;
301 299
302 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); 300 DISALLOW_COPY_AND_ASSIGN(ElementAnimations);
303 }; 301 };
304 302
305 } // namespace cc 303 } // namespace cc
306 304
307 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ 305 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_
OLDNEW
« no previous file with comments | « cc/animation/animation_timeline.cc ('k') | cc/animation/element_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698