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 6876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6887 // Makes sure that painted_device_scale_factor is propagated to the | 6887 // Makes sure that painted_device_scale_factor is propagated to the |
6888 // frame's metadata. | 6888 // frame's metadata. |
6889 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { | 6889 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { |
6890 protected: | 6890 protected: |
6891 void BeginTest() override { | 6891 void BeginTest() override { |
6892 layer_tree()->SetPaintedDeviceScaleFactor(2.0f); | 6892 layer_tree()->SetPaintedDeviceScaleFactor(2.0f); |
6893 EXPECT_EQ(1.0f, layer_tree()->device_scale_factor()); | 6893 EXPECT_EQ(1.0f, layer_tree()->device_scale_factor()); |
6894 PostSetNeedsCommitToMainThread(); | 6894 PostSetNeedsCommitToMainThread(); |
6895 } | 6895 } |
6896 | 6896 |
6897 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 6897 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
| 6898 LayerTreeHostImpl::FrameData* frame_data, |
| 6899 DrawResult draw_result) override { |
6898 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); | 6900 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); |
6899 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); | 6901 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); |
| 6902 return draw_result; |
6900 } | 6903 } |
6901 | 6904 |
6902 void DisplayReceivedCompositorFrameOnThread( | 6905 void DisplayReceivedCompositorFrameOnThread( |
6903 const CompositorFrame& frame) override { | 6906 const CompositorFrame& frame) override { |
6904 EXPECT_EQ(2.0f, frame.metadata.device_scale_factor); | 6907 EXPECT_EQ(2.0f, frame.metadata.device_scale_factor); |
6905 EndTest(); | 6908 EndTest(); |
6906 } | 6909 } |
6907 | 6910 |
6908 void AfterTest() override {} | 6911 void AfterTest() override {} |
6909 }; | 6912 }; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6983 private: | 6986 private: |
6984 FakeContentLayerClient client_; | 6987 FakeContentLayerClient client_; |
6985 const gfx::Size viewport_size_; | 6988 const gfx::Size viewport_size_; |
6986 const gfx::Size large_image_size_; | 6989 const gfx::Size large_image_size_; |
6987 }; | 6990 }; |
6988 | 6991 |
6989 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage); | 6992 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage); |
6990 | 6993 |
6991 } // namespace | 6994 } // namespace |
6992 } // namespace cc | 6995 } // namespace cc |
OLD | NEW |