OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 6644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6655 // frame's metadata. | 6655 // frame's metadata. |
6656 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { | 6656 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { |
6657 protected: | 6657 protected: |
6658 void BeginTest() override { | 6658 void BeginTest() override { |
6659 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f); | 6659 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f); |
6660 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor()); | 6660 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor()); |
6661 PostSetNeedsCommitToMainThread(); | 6661 PostSetNeedsCommitToMainThread(); |
6662 } | 6662 } |
6663 | 6663 |
6664 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { | 6664 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { |
6665 EXPECT_EQ(2.0f, | 6665 EXPECT_EQ( |
6666 output_surface()->last_sent_frame().metadata.device_scale_factor); | 6666 2.0f, |
| 6667 output_surface()->last_sent_frame()->metadata.device_scale_factor); |
6667 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); | 6668 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); |
6668 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); | 6669 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); |
6669 EndTest(); | 6670 EndTest(); |
6670 } | 6671 } |
6671 | 6672 |
6672 void AfterTest() override {} | 6673 void AfterTest() override {} |
6673 }; | 6674 }; |
6674 | 6675 |
6675 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6676 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
6676 | 6677 |
6677 } // namespace | 6678 } // namespace |
6678 } // namespace cc | 6679 } // namespace cc |
OLD | NEW |