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

Side by Side Diff: third_party/WebKit/Source/core/animation/Animation.cpp

Issue 2869183002: Initial implementation of WorkletAnimation (Closed)
Patch Set: Rebase Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 793
794 double time_offset = 0; 794 double time_offset = 0;
795 if (std::isnan(start_time)) { 795 if (std::isnan(start_time)) {
796 time_offset = 796 time_offset =
797 reversed ? EffectEnd() - CurrentTimeInternal() : CurrentTimeInternal(); 797 reversed ? EffectEnd() - CurrentTimeInternal() : CurrentTimeInternal();
798 time_offset = time_offset / fabs(playback_rate_); 798 time_offset = time_offset / fabs(playback_rate_);
799 } 799 }
800 DCHECK_NE(compositor_group_, 0); 800 DCHECK_NE(compositor_group_, 0);
801 return ToKeyframeEffectReadOnly(content_.Get()) 801 return ToKeyframeEffectReadOnly(content_.Get())
802 ->MaybeStartAnimationOnCompositor(compositor_group_, start_time, 802 ->MaybeStartAnimationOnCompositor(compositor_group_, start_time,
803 time_offset, playback_rate_); 803 time_offset, playback_rate_,
804 compositor_player_->Player());
804 } 805 }
805 806
806 void Animation::SetCompositorPending(bool effect_changed) { 807 void Animation::SetCompositorPending(bool effect_changed) {
807 // FIXME: KeyframeEffect could notify this directly? 808 // FIXME: KeyframeEffect could notify this directly?
808 if (!HasActiveAnimationsOnCompositor()) { 809 if (!HasActiveAnimationsOnCompositor()) {
809 DestroyCompositorPlayer(); 810 DestroyCompositorPlayer();
810 compositor_state_.reset(); 811 compositor_state_.reset();
811 } 812 }
812 if (effect_changed && compositor_state_) { 813 if (effect_changed && compositor_state_) {
813 compositor_state_->effect_changed = true; 814 compositor_state_->effect_changed = true;
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 DCHECK(!compositor_player_); 1210 DCHECK(!compositor_player_);
1210 } 1211 }
1211 1212
1212 void Animation::CompositorAnimationPlayerHolder::Detach() { 1213 void Animation::CompositorAnimationPlayerHolder::Detach() {
1213 DCHECK(compositor_player_); 1214 DCHECK(compositor_player_);
1214 compositor_player_->SetAnimationDelegate(nullptr); 1215 compositor_player_->SetAnimationDelegate(nullptr);
1215 animation_ = nullptr; 1216 animation_ = nullptr;
1216 compositor_player_.reset(); 1217 compositor_player_.reset();
1217 } 1218 }
1218 } // namespace blink 1219 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698