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 6929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6940 // Makes sure that painted_device_scale_factor is propagated to the | 6940 // Makes sure that painted_device_scale_factor is propagated to the |
6941 // frame's metadata. | 6941 // frame's metadata. |
6942 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { | 6942 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { |
6943 protected: | 6943 protected: |
6944 void BeginTest() override { | 6944 void BeginTest() override { |
6945 layer_tree()->SetPaintedDeviceScaleFactor(2.0f); | 6945 layer_tree()->SetPaintedDeviceScaleFactor(2.0f); |
6946 EXPECT_EQ(1.0f, layer_tree()->device_scale_factor()); | 6946 EXPECT_EQ(1.0f, layer_tree()->device_scale_factor()); |
6947 PostSetNeedsCommitToMainThread(); | 6947 PostSetNeedsCommitToMainThread(); |
6948 } | 6948 } |
6949 | 6949 |
6950 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 6950 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
| 6951 LayerTreeHostImpl::FrameData* frame_data, |
| 6952 DrawResult draw_result) override { |
| 6953 EXPECT_EQ(DRAW_SUCCESS, draw_result); |
6951 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); | 6954 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); |
6952 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); | 6955 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); |
| 6956 return draw_result; |
6953 } | 6957 } |
6954 | 6958 |
6955 void DisplayReceivedCompositorFrameOnThread( | 6959 void DisplayReceivedCompositorFrameOnThread( |
6956 const CompositorFrame& frame) override { | 6960 const CompositorFrame& frame) override { |
6957 EXPECT_EQ(2.0f, frame.metadata.device_scale_factor); | 6961 EXPECT_EQ(2.0f, frame.metadata.device_scale_factor); |
6958 EndTest(); | 6962 EndTest(); |
6959 } | 6963 } |
6960 | 6964 |
6961 void AfterTest() override {} | 6965 void AfterTest() override {} |
6962 }; | 6966 }; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7036 private: | 7040 private: |
7037 FakeContentLayerClient client_; | 7041 FakeContentLayerClient client_; |
7038 const gfx::Size viewport_size_; | 7042 const gfx::Size viewport_size_; |
7039 const gfx::Size large_image_size_; | 7043 const gfx::Size large_image_size_; |
7040 }; | 7044 }; |
7041 | 7045 |
7042 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage); | 7046 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage); |
7043 | 7047 |
7044 } // namespace | 7048 } // namespace |
7045 } // namespace cc | 7049 } // namespace cc |
OLD | NEW |