Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 frame_generator_->DrawWindowTree(pass, root_window_.get(), gfx::Vector2d(), | 77 frame_generator_->DrawWindowTree(pass, root_window_.get(), gfx::Vector2d(), |
| 78 1.0f); | 78 1.0f); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void FrameGeneratorTest::SetUp() { | 81 void FrameGeneratorTest::SetUp() { |
| 82 testing::Test::SetUp(); | 82 testing::Test::SetUp(); |
| 83 frame_generator_delegate_ = base::MakeUnique<TestFrameGeneratorDelegate>(); | 83 frame_generator_delegate_ = base::MakeUnique<TestFrameGeneratorDelegate>(); |
| 84 PlatformDisplayInitParams init_params; | 84 PlatformDisplayInitParams init_params; |
| 85 frame_generator_ = base::MakeUnique<FrameGenerator>( | 85 frame_generator_ = base::MakeUnique<FrameGenerator>( |
| 86 frame_generator_delegate_.get(), root_window_.get()); | 86 frame_generator_delegate_.get(), root_window_.get()); |
| 87 frame_generator_->set_device_scale_factor( | |
| 88 init_params.metrics.device_scale_factor); | |
|
Fady Samuel
2016/12/15 18:27:51
I would actually make the device_scale_factor a pa
riajiang
2016/12/15 19:01:43
We are also updating DSF in PlatformDisplayDefault
| |
| 87 InitWindow(root_window()); | 89 InitWindow(root_window()); |
| 88 } | 90 } |
| 89 | 91 |
| 90 void FrameGeneratorTest::TearDown() { | 92 void FrameGeneratorTest::TearDown() { |
| 91 frame_generator_.reset(); | 93 frame_generator_.reset(); |
| 92 frame_generator_delegate_.reset(); | 94 frame_generator_delegate_.reset(); |
| 93 } | 95 } |
| 94 | 96 |
| 95 // Tests correctness of the SharedQuadStateList generated by | 97 // Tests correctness of the SharedQuadStateList generated by |
| 96 // FrameGenerator::DrawWindowTree(). | 98 // FrameGenerator::DrawWindowTree(). |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 EXPECT_EQ(3u, quad_state_list->size()); | 137 EXPECT_EQ(3u, quad_state_list->size()); |
| 136 auto it = quad_state_list->begin(); | 138 auto it = quad_state_list->begin(); |
| 137 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity); | 139 EXPECT_EQ(child_opacity * root_opacity, (*it)->opacity); |
| 138 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity); | 140 EXPECT_EQ(child_opacity * root_opacity, (*++it)->opacity); |
| 139 EXPECT_EQ(root_opacity, (*++it)->opacity); | 141 EXPECT_EQ(root_opacity, (*++it)->opacity); |
| 140 } | 142 } |
| 141 | 143 |
| 142 } // namespace test | 144 } // namespace test |
| 143 } // namespace ws | 145 } // namespace ws |
| 144 } // namespace ui | 146 } // namespace ui |
| OLD | NEW |