| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (is_controlling_instance_ && !was_finished && is_finished()) | 101 if (is_controlling_instance_ && !was_finished && is_finished()) |
| 102 TRACE_EVENT_ASYNC_END0("cc", "Animation", this); | 102 TRACE_EVENT_ASYNC_END0("cc", "Animation", this); |
| 103 | 103 |
| 104 char state_buffer[256]; | 104 char state_buffer[256]; |
| 105 base::snprintf(state_buffer, | 105 base::snprintf(state_buffer, |
| 106 sizeof(state_buffer), | 106 sizeof(state_buffer), |
| 107 "%s->%s", | 107 "%s->%s", |
| 108 old_run_state_name, | 108 old_run_state_name, |
| 109 new_run_state_name); | 109 new_run_state_name); |
| 110 | 110 |
| 111 TRACE_EVENT_INSTANT2("cc", | 111 TRACE_EVENT_INSTANT2( |
| 112 "LayerAnimationController::SetRunState", | 112 "cc", "ElementAnimations::SetRunState", TRACE_EVENT_SCOPE_THREAD, "Name", |
| 113 TRACE_EVENT_SCOPE_THREAD, | 113 TRACE_STR_COPY(name_buffer), "State", TRACE_STR_COPY(state_buffer)); |
| 114 "Name", | |
| 115 TRACE_STR_COPY(name_buffer), | |
| 116 "State", | |
| 117 TRACE_STR_COPY(state_buffer)); | |
| 118 } | 114 } |
| 119 | 115 |
| 120 void Animation::Suspend(base::TimeTicks monotonic_time) { | 116 void Animation::Suspend(base::TimeTicks monotonic_time) { |
| 121 SetRunState(PAUSED, monotonic_time); | 117 SetRunState(PAUSED, monotonic_time); |
| 122 suspended_ = true; | 118 suspended_ = true; |
| 123 } | 119 } |
| 124 | 120 |
| 125 void Animation::Resume(base::TimeTicks monotonic_time) { | 121 void Animation::Resume(base::TimeTicks monotonic_time) { |
| 126 suspended_ = false; | 122 suspended_ = false; |
| 127 SetRunState(RUNNING, monotonic_time); | 123 SetRunState(RUNNING, monotonic_time); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // the main thread. | 260 // the main thread. |
| 265 if (run_state_ == Animation::PAUSED || | 261 if (run_state_ == Animation::PAUSED || |
| 266 other->run_state_ == Animation::PAUSED) { | 262 other->run_state_ == Animation::PAUSED) { |
| 267 other->run_state_ = run_state_; | 263 other->run_state_ = run_state_; |
| 268 other->pause_time_ = pause_time_; | 264 other->pause_time_ = pause_time_; |
| 269 other->total_paused_time_ = total_paused_time_; | 265 other->total_paused_time_ = total_paused_time_; |
| 270 } | 266 } |
| 271 } | 267 } |
| 272 | 268 |
| 273 } // namespace cc | 269 } // namespace cc |
| OLD | NEW |