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

Side by Side Diff: cc/animation/animation.cc

Issue 1904653002: CC Animation: Merge LayerAnimationController into ElementAnimations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor optimization: Don't init value observations if same host. Created 4 years, 8 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
« no previous file with comments | « cc/BUILD.gn ('k') | cc/animation/animation_host.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 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
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
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
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/animation/animation_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698