| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 | 1888 |
| 1889 // Tests Layer::AddThreadedAnimation and Layer::RemoveThreadedAnimation. | 1889 // Tests Layer::AddThreadedAnimation and Layer::RemoveThreadedAnimation. |
| 1890 TEST_F(LayerWithRealCompositorTest, AddRemoveThreadedAnimations) { | 1890 TEST_F(LayerWithRealCompositorTest, AddRemoveThreadedAnimations) { |
| 1891 std::unique_ptr<Layer> root(CreateLayer(LAYER_TEXTURED)); | 1891 std::unique_ptr<Layer> root(CreateLayer(LAYER_TEXTURED)); |
| 1892 std::unique_ptr<Layer> l1(CreateLayer(LAYER_TEXTURED)); | 1892 std::unique_ptr<Layer> l1(CreateLayer(LAYER_TEXTURED)); |
| 1893 std::unique_ptr<Layer> l2(CreateLayer(LAYER_TEXTURED)); | 1893 std::unique_ptr<Layer> l2(CreateLayer(LAYER_TEXTURED)); |
| 1894 | 1894 |
| 1895 l1->SetAnimator(LayerAnimator::CreateImplicitAnimator()); | 1895 l1->SetAnimator(LayerAnimator::CreateImplicitAnimator()); |
| 1896 l2->SetAnimator(LayerAnimator::CreateImplicitAnimator()); | 1896 l2->SetAnimator(LayerAnimator::CreateImplicitAnimator()); |
| 1897 | 1897 |
| 1898 auto player1 = l1->GetAnimator()->GetAnimationPlayerForTesting(); | 1898 auto* player1 = l1->GetAnimator()->GetAnimationPlayerForTesting(); |
| 1899 auto player2 = l2->GetAnimator()->GetAnimationPlayerForTesting(); | 1899 auto* player2 = l2->GetAnimator()->GetAnimationPlayerForTesting(); |
| 1900 | 1900 |
| 1901 EXPECT_FALSE(player1->has_any_animation()); | 1901 EXPECT_FALSE(player1->has_any_animation()); |
| 1902 | 1902 |
| 1903 // Trigger a threaded animation. | 1903 // Trigger a threaded animation. |
| 1904 l1->SetOpacity(0.5f); | 1904 l1->SetOpacity(0.5f); |
| 1905 | 1905 |
| 1906 EXPECT_TRUE(player1->has_any_animation()); | 1906 EXPECT_TRUE(player1->has_any_animation()); |
| 1907 | 1907 |
| 1908 // Ensure we can remove a pending threaded animation. | 1908 // Ensure we can remove a pending threaded animation. |
| 1909 l1->GetAnimator()->StopAnimating(); | 1909 l1->GetAnimator()->StopAnimating(); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2279 layer.set_name("foo"); | 2279 layer.set_name("foo"); |
| 2280 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info = | 2280 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info = |
| 2281 layer.TakeDebugInfo(nullptr); | 2281 layer.TakeDebugInfo(nullptr); |
| 2282 std::string trace_format("bar,"); | 2282 std::string trace_format("bar,"); |
| 2283 debug_info->AppendAsTraceFormat(&trace_format); | 2283 debug_info->AppendAsTraceFormat(&trace_format); |
| 2284 std::string expected("bar,{\"layer_name\":\"foo\"}"); | 2284 std::string expected("bar,{\"layer_name\":\"foo\"}"); |
| 2285 EXPECT_EQ(expected, trace_format); | 2285 EXPECT_EQ(expected, trace_format); |
| 2286 } | 2286 } |
| 2287 | 2287 |
| 2288 } // namespace ui | 2288 } // namespace ui |
| OLD | NEW |