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

Side by Side Diff: app/multi_animation.cc

Issue 5741001: Even more virtual method deinlining. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase (windows) Created 10 years 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
« no previous file with comments | « app/multi_animation.h ('k') | app/tree_model.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/multi_animation.h" 5 #include "app/multi_animation.h"
6 6
7 #include "app/animation_delegate.h" 7 #include "app/animation_delegate.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 // Default interval, in ms. 10 // Default interval, in ms.
(...skipping 13 matching lines...) Expand all
24 parts_(parts), 24 parts_(parts),
25 cycle_time_ms_(TotalTime(parts)), 25 cycle_time_ms_(TotalTime(parts)),
26 current_value_(0), 26 current_value_(0),
27 current_part_index_(0), 27 current_part_index_(0),
28 continuous_(true) { 28 continuous_(true) {
29 DCHECK(!parts_.empty()); 29 DCHECK(!parts_.empty());
30 } 30 }
31 31
32 MultiAnimation::~MultiAnimation() {} 32 MultiAnimation::~MultiAnimation() {}
33 33
34 double MultiAnimation::GetCurrentValue() const {
35 return current_value_;
36 }
37
34 void MultiAnimation::Step(base::TimeTicks time_now) { 38 void MultiAnimation::Step(base::TimeTicks time_now) {
35 double last_value = current_value_; 39 double last_value = current_value_;
36 size_t last_index = current_part_index_; 40 size_t last_index = current_part_index_;
37 41
38 int delta = static_cast<int>((time_now - start_time()).InMilliseconds()); 42 int delta = static_cast<int>((time_now - start_time()).InMilliseconds());
39 if (delta >= cycle_time_ms_ && !continuous_) { 43 if (delta >= cycle_time_ms_ && !continuous_) {
40 current_part_index_ = parts_.size() - 1; 44 current_part_index_ = parts_.size() - 1;
41 current_value_ = Tween::CalculateValue(parts_[current_part_index_].type, 1); 45 current_value_ = Tween::CalculateValue(parts_[current_part_index_].type, 1);
42 Stop(); 46 Stop();
43 return; 47 return;
(...skipping 27 matching lines...) Expand all
71 return parts_[i]; 75 return parts_[i];
72 } 76 }
73 77
74 *time_ms -= parts_[i].time_ms; 78 *time_ms -= parts_[i].time_ms;
75 } 79 }
76 NOTREACHED(); 80 NOTREACHED();
77 *time_ms = 0; 81 *time_ms = 0;
78 *part_index = 0; 82 *part_index = 0;
79 return parts_[0]; 83 return parts_[0];
80 } 84 }
OLDNEW
« no previous file with comments | « app/multi_animation.h ('k') | app/tree_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698