OLD | NEW |
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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "cc/animation/animation_curve.h" | 7 #include "cc/animation/animation_curve.h" |
8 #include "cc/animation/layer_animation_controller.h" | 8 #include "cc/animation/layer_animation_controller.h" |
9 #include "cc/animation/scroll_offset_animation_curve.h" | 9 #include "cc/animation/scroll_offset_animation_curve.h" |
10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 if (layer_tree_host()->source_frame_number() == 1) { | 1157 if (layer_tree_host()->source_frame_number() == 1) { |
1158 AddAnimatedTransformToLayer(layer_tree_host()->root_layer(), 4, 1, 1); | 1158 AddAnimatedTransformToLayer(layer_tree_host()->root_layer(), 4, 1, 1); |
1159 } else if (layer_tree_host()->source_frame_number() == 2) { | 1159 } else if (layer_tree_host()->source_frame_number() == 2) { |
1160 AddOpacityTransitionToLayer( | 1160 AddOpacityTransitionToLayer( |
1161 layer_tree_host()->root_layer(), 1, 0.f, 0.5f, true); | 1161 layer_tree_host()->root_layer(), 1, 0.f, 0.5f, true); |
1162 | 1162 |
1163 scoped_refptr<Layer> layer = Layer::Create(); | 1163 scoped_refptr<Layer> layer = Layer::Create(); |
1164 layer_tree_host()->root_layer()->AddChild(layer); | 1164 layer_tree_host()->root_layer()->AddChild(layer); |
1165 layer->set_layer_animation_delegate(this); | 1165 layer->set_layer_animation_delegate(this); |
1166 layer->SetBounds(gfx::Size(4, 4)); | 1166 layer->SetBounds(gfx::Size(4, 4)); |
1167 AddOpacityTransitionToLayer(layer, 1, 0.f, 0.5f, true); | 1167 AddOpacityTransitionToLayer(layer.get(), 1, 0.f, 0.5f, true); |
1168 } | 1168 } |
1169 } | 1169 } |
1170 | 1170 |
1171 virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 1171 virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
1172 host_impl->BlockNotifyReadyToActivateForTesting(true); | 1172 host_impl->BlockNotifyReadyToActivateForTesting(true); |
1173 } | 1173 } |
1174 | 1174 |
1175 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 1175 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
1176 // For the commit that added animations to new and existing layers, keep | 1176 // For the commit that added animations to new and existing layers, keep |
1177 // blocking activation. We want to verify that even with activation blocked, | 1177 // blocking activation. We want to verify that even with activation blocked, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 private: | 1284 private: |
1285 scoped_refptr<Layer> content_; | 1285 scoped_refptr<Layer> content_; |
1286 int num_swap_buffers_; | 1286 int num_swap_buffers_; |
1287 }; | 1287 }; |
1288 | 1288 |
1289 SINGLE_AND_MULTI_THREAD_TEST_F( | 1289 SINGLE_AND_MULTI_THREAD_TEST_F( |
1290 LayerTreeHostAnimationTestAddAnimationAfterAnimating); | 1290 LayerTreeHostAnimationTestAddAnimationAfterAnimating); |
1291 | 1291 |
1292 } // namespace | 1292 } // namespace |
1293 } // namespace cc | 1293 } // namespace cc |
OLD | NEW |