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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 6363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6374 // that this works correctly and the output surface is destroyed on | 6374 // that this works correctly and the output surface is destroyed on |
6375 // the correct thread. | 6375 // the correct thread. |
6376 EndTest(); | 6376 EndTest(); |
6377 } | 6377 } |
6378 | 6378 |
6379 void AfterTest() override {} | 6379 void AfterTest() override {} |
6380 }; | 6380 }; |
6381 | 6381 |
6382 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); | 6382 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); |
6383 | 6383 |
| 6384 // Makes sure that painted_device_scale_factor is propagated to the |
| 6385 // frame's metadata. |
| 6386 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { |
| 6387 protected: |
| 6388 void BeginTest() override { |
| 6389 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f); |
| 6390 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor()); |
| 6391 PostSetNeedsCommitToMainThread(); |
| 6392 } |
| 6393 |
| 6394 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { |
| 6395 EXPECT_EQ(2.0f, |
| 6396 output_surface()->last_sent_frame().metadata.device_scale_factor); |
| 6397 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); |
| 6398 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); |
| 6399 EndTest(); |
| 6400 } |
| 6401 |
| 6402 void AfterTest() override {} |
| 6403 }; |
| 6404 |
| 6405 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6406 |
6384 } // namespace | 6407 } // namespace |
6385 } // namespace cc | 6408 } // namespace cc |
OLD | NEW |