OLD | NEW |
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 Loading... |
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 * |
| 1124 base::Time::kMicrosecondsPerSecond) - |
| 1125 base::TimeTicks()); |
1122 SetNeedsCommit(); | 1126 SetNeedsCommit(); |
1123 } | 1127 } |
1124 | 1128 |
1125 void Layer::RemoveAnimation(int animation_id) { | 1129 void Layer::RemoveAnimation(int animation_id) { |
1126 layer_animation_controller_->RemoveAnimation(animation_id); | 1130 layer_animation_controller_->RemoveAnimation(animation_id); |
1127 SetNeedsCommit(); | 1131 SetNeedsCommit(); |
1128 } | 1132 } |
1129 | 1133 |
1130 void Layer::SetLayerAnimationControllerForTest( | 1134 void Layer::SetLayerAnimationControllerForTest( |
1131 scoped_refptr<LayerAnimationController> controller) { | 1135 scoped_refptr<LayerAnimationController> controller) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 if (clip_parent_) | 1194 if (clip_parent_) |
1191 clip_parent_->RemoveClipChild(this); | 1195 clip_parent_->RemoveClipChild(this); |
1192 | 1196 |
1193 clip_parent_ = NULL; | 1197 clip_parent_ = NULL; |
1194 } | 1198 } |
1195 | 1199 |
1196 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1200 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1197 benchmark->RunOnLayer(this); | 1201 benchmark->RunOnLayer(this); |
1198 } | 1202 } |
1199 } // namespace cc | 1203 } // namespace cc |
OLD | NEW |