| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/animation.h" | 5 #include "cc/animation/animation.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 char state_buffer[256]; | 118 char state_buffer[256]; |
| 119 base::snprintf(state_buffer, | 119 base::snprintf(state_buffer, |
| 120 sizeof(state_buffer), | 120 sizeof(state_buffer), |
| 121 "%s->%s", | 121 "%s->%s", |
| 122 old_run_state_name, | 122 old_run_state_name, |
| 123 new_run_state_name); | 123 new_run_state_name); |
| 124 | 124 |
| 125 TRACE_EVENT_INSTANT2("cc", | 125 TRACE_EVENT_INSTANT2("cc", |
| 126 "LayerAnimationController::SetRunState", | 126 "LayerAnimationController::SetRunState", |
| 127 TRACE_EVENT_SCOPE_THREAD, |
| 127 "Name", | 128 "Name", |
| 128 TRACE_STR_COPY(name_buffer), | 129 TRACE_STR_COPY(name_buffer), |
| 129 "State", | 130 "State", |
| 130 TRACE_STR_COPY(state_buffer)); | 131 TRACE_STR_COPY(state_buffer)); |
| 131 } | 132 } |
| 132 | 133 |
| 133 void Animation::Suspend(double monotonic_time) { | 134 void Animation::Suspend(double monotonic_time) { |
| 134 SetRunState(Paused, monotonic_time); | 135 SetRunState(Paused, monotonic_time); |
| 135 suspended_ = true; | 136 suspended_ = true; |
| 136 } | 137 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // the main thread. | 228 // the main thread. |
| 228 if (run_state_ == Animation::Paused || | 229 if (run_state_ == Animation::Paused || |
| 229 other->run_state_ == Animation::Paused) { | 230 other->run_state_ == Animation::Paused) { |
| 230 other->run_state_ = run_state_; | 231 other->run_state_ = run_state_; |
| 231 other->pause_time_ = pause_time_; | 232 other->pause_time_ = pause_time_; |
| 232 other->total_paused_time_ = total_paused_time_; | 233 other->total_paused_time_ = total_paused_time_; |
| 233 } | 234 } |
| 234 } | 235 } |
| 235 | 236 |
| 236 } // namespace cc | 237 } // namespace cc |
| OLD | NEW |