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" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/time/time.h" |
13 #include "cc/animation/animation.h" | 14 #include "cc/animation/animation.h" |
14 #include "cc/animation/animation_events.h" | 15 #include "cc/animation/animation_events.h" |
15 #include "cc/animation/keyframed_animation_curve.h" | 16 #include "cc/animation/keyframed_animation_curve.h" |
16 #include "cc/animation/layer_animation_controller.h" | 17 #include "cc/animation/layer_animation_controller.h" |
17 #include "cc/layers/layer_client.h" | 18 #include "cc/layers/layer_client.h" |
18 #include "cc/layers/layer_impl.h" | 19 #include "cc/layers/layer_impl.h" |
19 #include "cc/layers/scrollbar_layer_interface.h" | 20 #include "cc/layers/scrollbar_layer_interface.h" |
20 #include "cc/output/copy_output_request.h" | 21 #include "cc/output/copy_output_request.h" |
21 #include "cc/output/copy_output_result.h" | 22 #include "cc/output/copy_output_result.h" |
22 #include "cc/trees/layer_tree_host.h" | 23 #include "cc/trees/layer_tree_host.h" |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 return false; | 1113 return false; |
1113 | 1114 |
1114 UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer", | 1115 UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer", |
1115 !layer_tree_host_); | 1116 !layer_tree_host_); |
1116 layer_animation_controller_->AddAnimation(animation.Pass()); | 1117 layer_animation_controller_->AddAnimation(animation.Pass()); |
1117 SetNeedsCommit(); | 1118 SetNeedsCommit(); |
1118 return true; | 1119 return true; |
1119 } | 1120 } |
1120 | 1121 |
1121 void Layer::PauseAnimation(int animation_id, double time_offset) { | 1122 void Layer::PauseAnimation(int animation_id, double time_offset) { |
1122 layer_animation_controller_->PauseAnimation(animation_id, time_offset); | 1123 layer_animation_controller_->PauseAnimation( |
| 1124 animation_id, base::TimeDelta::FromSecondsD(time_offset)); |
1123 SetNeedsCommit(); | 1125 SetNeedsCommit(); |
1124 } | 1126 } |
1125 | 1127 |
1126 void Layer::RemoveAnimation(int animation_id) { | 1128 void Layer::RemoveAnimation(int animation_id) { |
1127 layer_animation_controller_->RemoveAnimation(animation_id); | 1129 layer_animation_controller_->RemoveAnimation(animation_id); |
1128 SetNeedsCommit(); | 1130 SetNeedsCommit(); |
1129 } | 1131 } |
1130 | 1132 |
1131 void Layer::SetLayerAnimationControllerForTest( | 1133 void Layer::SetLayerAnimationControllerForTest( |
1132 scoped_refptr<LayerAnimationController> controller) { | 1134 scoped_refptr<LayerAnimationController> controller) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 if (clip_parent_) | 1193 if (clip_parent_) |
1192 clip_parent_->RemoveClipChild(this); | 1194 clip_parent_->RemoveClipChild(this); |
1193 | 1195 |
1194 clip_parent_ = NULL; | 1196 clip_parent_ = NULL; |
1195 } | 1197 } |
1196 | 1198 |
1197 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1199 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1198 benchmark->RunOnLayer(this); | 1200 benchmark->RunOnLayer(this); |
1199 } | 1201 } |
1200 } // namespace cc | 1202 } // namespace cc |
OLD | NEW |