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

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

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Let CC clients generate their own ElementIds locally. Created 4 years, 7 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
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 #include "cc/animation/element_animations.h" 5 #include "cc/animation/element_animations.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 ->curve() 560 ->curve()
561 ->ToScrollOffsetAnimationCurve() 561 ->ToScrollOffsetAnimationCurve()
562 ->HasSetInitialValue()) { 562 ->HasSetInitialValue()) {
563 gfx::ScrollOffset current_scroll_offset; 563 gfx::ScrollOffset current_scroll_offset;
564 if (element_animations_impl->has_element_in_active_list()) { 564 if (element_animations_impl->has_element_in_active_list()) {
565 current_scroll_offset = 565 current_scroll_offset =
566 element_animations_impl->ScrollOffsetForAnimation(); 566 element_animations_impl->ScrollOffsetForAnimation();
567 } else { 567 } else {
568 // The owning layer isn't yet in the active tree, so the main thread 568 // The owning layer isn't yet in the active tree, so the main thread
569 // scroll offset will be up-to-date. 569 // scroll offset will be up-to-date.
570 DCHECK(has_element_in_active_list());
570 current_scroll_offset = ScrollOffsetForAnimation(); 571 current_scroll_offset = ScrollOffsetForAnimation();
571 } 572 }
572 animations_[i]->curve()->ToScrollOffsetAnimationCurve()->SetInitialValue( 573 animations_[i]->curve()->ToScrollOffsetAnimationCurve()->SetInitialValue(
573 current_scroll_offset); 574 current_scroll_offset);
574 } 575 }
575 576
576 // The new animation should be set to run as soon as possible. 577 // The new animation should be set to run as soon as possible.
577 Animation::RunState initial_run_state = 578 Animation::RunState initial_run_state =
578 Animation::WAITING_FOR_TARGET_AVAILABILITY; 579 Animation::WAITING_FOR_TARGET_AVAILABILITY;
579 std::unique_ptr<Animation> to_add( 580 std::unique_ptr<Animation> to_add(
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 if (animation_host()) { 1352 if (animation_host()) {
1352 DCHECK(animation_host()->mutator_host_client()); 1353 DCHECK(animation_host()->mutator_host_client());
1353 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( 1354 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation(
1354 element_id()); 1355 element_id());
1355 } 1356 }
1356 1357
1357 return gfx::ScrollOffset(); 1358 return gfx::ScrollOffset();
1358 } 1359 }
1359 1360
1360 } // namespace cc 1361 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698