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

Side by Side Diff: cc/layers/layer.cc

Issue 231133002: CC::Animations should use TimeTicks & TimeDelta to represent time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 return false; 1111 return false;
1112 1112
1113 UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer", 1113 UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer",
1114 !layer_tree_host_); 1114 !layer_tree_host_);
1115 layer_animation_controller_->AddAnimation(animation.Pass()); 1115 layer_animation_controller_->AddAnimation(animation.Pass());
1116 SetNeedsCommit(); 1116 SetNeedsCommit();
1117 return true; 1117 return true;
1118 } 1118 }
1119 1119
1120 void Layer::PauseAnimation(int animation_id, double time_offset) { 1120 void Layer::PauseAnimation(int animation_id, double time_offset) {
1121 layer_animation_controller_->PauseAnimation(animation_id, time_offset); 1121 layer_animation_controller_->PauseAnimation(
1122 animation_id,
1123 base::TimeTicks::FromInternalValue(time_offset *
danakj 2014/04/09 16:34:15 Is converting back and forth from double to time t
Sikugu_ 2014/04/10 14:04:57 Keeping this as it is to avoid jitter. Will take c
1124 base::Time::kMicrosecondsPerSecond));
1122 SetNeedsCommit(); 1125 SetNeedsCommit();
1123 } 1126 }
1124 1127
1125 void Layer::RemoveAnimation(int animation_id) { 1128 void Layer::RemoveAnimation(int animation_id) {
1126 layer_animation_controller_->RemoveAnimation(animation_id); 1129 layer_animation_controller_->RemoveAnimation(animation_id);
1127 SetNeedsCommit(); 1130 SetNeedsCommit();
1128 } 1131 }
1129 1132
1130 void Layer::SetLayerAnimationControllerForTest( 1133 void Layer::SetLayerAnimationControllerForTest(
1131 scoped_refptr<LayerAnimationController> controller) { 1134 scoped_refptr<LayerAnimationController> controller) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 if (clip_parent_) 1193 if (clip_parent_)
1191 clip_parent_->RemoveClipChild(this); 1194 clip_parent_->RemoveClipChild(this);
1192 1195
1193 clip_parent_ = NULL; 1196 clip_parent_ = NULL;
1194 } 1197 }
1195 1198
1196 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { 1199 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) {
1197 benchmark->RunOnLayer(this); 1200 benchmark->RunOnLayer(this);
1198 } 1201 }
1199 } // namespace cc 1202 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698