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

Side by Side Diff: ui/gfx/compositor/layer_animation_sequence.cc

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/gfx/compositor/layer_animation_sequence.h" 5 #include "ui/gfx/compositor/layer_animation_sequence.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "ui/gfx/compositor/layer_animation_delegate.h" 10 #include "ui/gfx/compositor/layer_animation_delegate.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 elements_[current_index]->Progress(t, delegate); 62 elements_[current_index]->Progress(t, delegate);
63 } 63 }
64 64
65 if (!is_cyclic_ && elapsed == duration_) { 65 if (!is_cyclic_ && elapsed == duration_) {
66 last_element_ = 0; 66 last_element_ = 0;
67 last_start_ = base::TimeDelta::FromMilliseconds(0); 67 last_start_ = base::TimeDelta::FromMilliseconds(0);
68 } 68 }
69 } 69 }
70 70
71 void LayerAnimationSequence::GetTargetValue(
72 LayerAnimationElement::TargetValue* target) const {
73 if (is_cyclic_)
74 return;
75
76 for (size_t i = last_element_; i < elements_.size(); ++i)
77 elements_[i]->GetTargetValue(target);
78 }
79
71 void LayerAnimationSequence::Abort() { 80 void LayerAnimationSequence::Abort() {
72 size_t current_index = last_element_ % elements_.size(); 81 size_t current_index = last_element_ % elements_.size();
73 while (current_index < elements_.size()) { 82 while (current_index < elements_.size()) {
74 elements_[current_index]->Abort(); 83 elements_[current_index]->Abort();
75 ++current_index; 84 ++current_index;
76 } 85 }
77 last_element_ = 0; 86 last_element_ = 0;
78 last_start_ = base::TimeDelta::FromMilliseconds(0); 87 last_start_ = base::TimeDelta::FromMilliseconds(0);
79 } 88 }
80 89
(...skipping 10 matching lines...) Expand all
91 LayerAnimationElement::AnimatableProperties intersection; 100 LayerAnimationElement::AnimatableProperties intersection;
92 std::insert_iterator<LayerAnimationElement::AnimatableProperties> ii( 101 std::insert_iterator<LayerAnimationElement::AnimatableProperties> ii(
93 intersection, intersection.begin()); 102 intersection, intersection.begin());
94 std::set_intersection(properties_.begin(), properties_.end(), 103 std::set_intersection(properties_.begin(), properties_.end(),
95 other.begin(), other.end(), 104 other.begin(), other.end(),
96 ii); 105 ii);
97 return intersection.size() > 0; 106 return intersection.size() > 0;
98 } 107 }
99 108
100 } // namespace ui 109 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698