OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/ws/frame_generator.h" | 5 #include "services/ui/ws/frame_generator.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/test/test_message_loop.h" | 9 #include "base/test/test_message_loop.h" |
10 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 }; | 63 }; |
64 | 64 |
65 void FrameGeneratorTest::DrawWindowTree(cc::RenderPass* pass) { | 65 void FrameGeneratorTest::DrawWindowTree(cc::RenderPass* pass) { |
66 frame_generator_->DrawWindowTree(pass, | 66 frame_generator_->DrawWindowTree(pass, |
67 frame_generator_delegate_->GetRootWindow(), | 67 frame_generator_delegate_->GetRootWindow(), |
68 gfx::Vector2d(), 1.0f, nullptr); | 68 gfx::Vector2d(), 1.0f, nullptr); |
69 } | 69 } |
70 | 70 |
71 void FrameGeneratorTest::SetUp() { | 71 void FrameGeneratorTest::SetUp() { |
72 testing::Test::SetUp(); | 72 testing::Test::SetUp(); |
73 frame_generator_delegate_.reset(new TestFrameGeneratorDelegate( | 73 frame_generator_delegate_ = base::MakeUnique<TestFrameGeneratorDelegate>( |
74 base::MakeUnique<ServerWindow>(&window_delegate_, WindowId()))); | 74 base::MakeUnique<ServerWindow>(&window_delegate_, WindowId())); |
75 PlatformDisplayInitParams init_params; | 75 PlatformDisplayInitParams init_params; |
76 frame_generator_.reset(new FrameGenerator(frame_generator_delegate_.get(), | 76 frame_generator_ = base::MakeUnique<FrameGenerator>( |
77 init_params.surfaces_state)); | 77 frame_generator_delegate_.get(), init_params.surfaces_state); |
78 InitWindow(root_window()); | 78 InitWindow(root_window()); |
79 } | 79 } |
80 | 80 |
81 void FrameGeneratorTest::TearDown() { | 81 void FrameGeneratorTest::TearDown() { |
82 frame_generator_.reset(); | 82 frame_generator_.reset(); |
83 frame_generator_delegate_.reset(); | 83 frame_generator_delegate_.reset(); |
84 } | 84 } |
85 | 85 |
86 // Tests correctness of the SharedQuadStateList generated by | 86 // Tests correctness of the SharedQuadStateList generated by |
87 // FrameGenerator::DrawWindowTree(). | 87 // FrameGenerator::DrawWindowTree(). |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 EXPECT_EQ(3u, quad_state_list->size()); | 121 EXPECT_EQ(3u, quad_state_list->size()); |
122 auto it = quad_state_list->begin(); | 122 auto it = quad_state_list->begin(); |
123 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity); | 123 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity); |
124 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity); | 124 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity); |
125 EXPECT_EQ(root_opacity, (*++it)->opacity); | 125 EXPECT_EQ(root_opacity, (*++it)->opacity); |
126 } | 126 } |
127 | 127 |
128 } // namespace test | 128 } // namespace test |
129 } // namespace ws | 129 } // namespace ws |
130 } // namespace ui | 130 } // namespace ui |
OLD | NEW |