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.h" | 5 #include "cc/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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 m_runState = runState; | 95 m_runState = runState; |
96 | 96 |
97 const char* newRunStateName = s_runStateNames[runState]; | 97 const char* newRunStateName = s_runStateNames[runState]; |
98 | 98 |
99 if (!wasFinished && isFinished()) | 99 if (!wasFinished && isFinished()) |
100 TRACE_EVENT_ASYNC_END0("cc", "Animation", this); | 100 TRACE_EVENT_ASYNC_END0("cc", "Animation", this); |
101 | 101 |
102 char stateBuffer[256]; | 102 char stateBuffer[256]; |
103 base::snprintf(stateBuffer, sizeof(stateBuffer), "%s->%s", oldRunStateName,
newRunStateName); | 103 base::snprintf(stateBuffer, sizeof(stateBuffer), "%s->%s", oldRunStateName,
newRunStateName); |
104 | 104 |
105 TRACE_EVENT_INSTANT2("cc", "LayerAnimationController::setRunState", "Name",
TRACE_STR_COPY(nameBuffer), "State", TRACE_STR_COPY(stateBuffer)); | 105 TRACE_EVENT_INSTANT2("cc", "LayerAnimationController::setRunState", |
| 106 TRACE_EVENT_SCOPE_THREAD, |
| 107 "Name", TRACE_STR_COPY(nameBuffer), |
| 108 "State", TRACE_STR_COPY(stateBuffer)); |
106 } | 109 } |
107 | 110 |
108 void Animation::suspend(double monotonicTime) | 111 void Animation::suspend(double monotonicTime) |
109 { | 112 { |
110 setRunState(Paused, monotonicTime); | 113 setRunState(Paused, monotonicTime); |
111 m_suspended = true; | 114 m_suspended = true; |
112 } | 115 } |
113 | 116 |
114 void Animation::resume(double monotonicTime) | 117 void Animation::resume(double monotonicTime) |
115 { | 118 { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 { | 204 { |
202 // Currently, we only push changes due to pausing and resuming animations on
the main thread. | 205 // Currently, we only push changes due to pausing and resuming animations on
the main thread. |
203 if (m_runState == Animation::Paused || other->m_runState == Animation::Pause
d) { | 206 if (m_runState == Animation::Paused || other->m_runState == Animation::Pause
d) { |
204 other->m_runState = m_runState; | 207 other->m_runState = m_runState; |
205 other->m_pauseTime = m_pauseTime; | 208 other->m_pauseTime = m_pauseTime; |
206 other->m_totalPausedTime = m_totalPausedTime; | 209 other->m_totalPausedTime = m_totalPausedTime; |
207 } | 210 } |
208 } | 211 } |
209 | 212 |
210 } // namespace cc | 213 } // namespace cc |
OLD | NEW |