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/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "cc/animation/animation.h" | 15 #include "cc/animation/animation.h" |
16 #include "cc/animation/animation_events.h" | 16 #include "cc/animation/animation_events.h" |
| 17 #include "cc/animation/animation_registrar.h" |
17 #include "cc/animation/keyframed_animation_curve.h" | 18 #include "cc/animation/keyframed_animation_curve.h" |
18 #include "cc/animation/layer_animation_controller.h" | 19 #include "cc/animation/layer_animation_controller.h" |
19 #include "cc/layers/layer_client.h" | 20 #include "cc/layers/layer_client.h" |
20 #include "cc/layers/layer_impl.h" | 21 #include "cc/layers/layer_impl.h" |
21 #include "cc/layers/scrollbar_layer_interface.h" | 22 #include "cc/layers/scrollbar_layer_interface.h" |
22 #include "cc/output/copy_output_request.h" | 23 #include "cc/output/copy_output_request.h" |
23 #include "cc/output/copy_output_result.h" | 24 #include "cc/output/copy_output_result.h" |
24 #include "cc/trees/layer_tree_host.h" | 25 #include "cc/trees/layer_tree_host.h" |
25 #include "cc/trees/layer_tree_impl.h" | 26 #include "cc/trees/layer_tree_impl.h" |
26 #include "third_party/skia/include/core/SkImageFilter.h" | 27 #include "third_party/skia/include/core/SkImageFilter.h" |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 } | 1093 } |
1093 | 1094 |
1094 bool Layer::IsActive() const { | 1095 bool Layer::IsActive() const { |
1095 return true; | 1096 return true; |
1096 } | 1097 } |
1097 | 1098 |
1098 bool Layer::AddAnimation(scoped_ptr <Animation> animation) { | 1099 bool Layer::AddAnimation(scoped_ptr <Animation> animation) { |
1099 if (!layer_animation_controller_->animation_registrar()) | 1100 if (!layer_animation_controller_->animation_registrar()) |
1100 return false; | 1101 return false; |
1101 | 1102 |
| 1103 if (animation->target_property() == Animation::ScrollOffset && |
| 1104 !layer_animation_controller_->animation_registrar() |
| 1105 ->supports_scroll_animations()) |
| 1106 return false; |
| 1107 |
1102 UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer", | 1108 UMA_HISTOGRAM_BOOLEAN("Renderer.AnimationAddedToOrphanLayer", |
1103 !layer_tree_host_); | 1109 !layer_tree_host_); |
1104 layer_animation_controller_->AddAnimation(animation.Pass()); | 1110 layer_animation_controller_->AddAnimation(animation.Pass()); |
1105 SetNeedsCommit(); | 1111 SetNeedsCommit(); |
1106 return true; | 1112 return true; |
1107 } | 1113 } |
1108 | 1114 |
1109 void Layer::PauseAnimation(int animation_id, double time_offset) { | 1115 void Layer::PauseAnimation(int animation_id, double time_offset) { |
1110 layer_animation_controller_->PauseAnimation( | 1116 layer_animation_controller_->PauseAnimation( |
1111 animation_id, base::TimeDelta::FromSecondsD(time_offset)); | 1117 animation_id, base::TimeDelta::FromSecondsD(time_offset)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 if (clip_parent_) | 1186 if (clip_parent_) |
1181 clip_parent_->RemoveClipChild(this); | 1187 clip_parent_->RemoveClipChild(this); |
1182 | 1188 |
1183 clip_parent_ = NULL; | 1189 clip_parent_ = NULL; |
1184 } | 1190 } |
1185 | 1191 |
1186 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1192 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1187 benchmark->RunOnLayer(this); | 1193 benchmark->RunOnLayer(this); |
1188 } | 1194 } |
1189 } // namespace cc | 1195 } // namespace cc |
OLD | NEW |