| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 public: | 79 public: |
| 80 void RunCalcDrawProps() { RunTest(CompositorMode::SINGLE_THREADED); } | 80 void RunCalcDrawProps() { RunTest(CompositorMode::SINGLE_THREADED); } |
| 81 | 81 |
| 82 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 82 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 83 | 83 |
| 84 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 84 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
| 85 timer_.Reset(); | 85 timer_.Reset(); |
| 86 LayerTreeImpl* active_tree = host_impl->active_tree(); | 86 LayerTreeImpl* active_tree = host_impl->active_tree(); |
| 87 | 87 |
| 88 do { | 88 do { |
| 89 bool can_render_to_separate_surface = true; | |
| 90 int max_texture_size = 8096; | 89 int max_texture_size = 8096; |
| 91 DoCalcDrawPropertiesImpl(can_render_to_separate_surface, | 90 DoCalcDrawPropertiesImpl(max_texture_size, active_tree, host_impl); |
| 92 max_texture_size, | |
| 93 active_tree, | |
| 94 host_impl); | |
| 95 | 91 |
| 96 timer_.NextLap(); | 92 timer_.NextLap(); |
| 97 } while (!timer_.HasTimeLimitExpired()); | 93 } while (!timer_.HasTimeLimitExpired()); |
| 98 | 94 |
| 99 EndTest(); | 95 EndTest(); |
| 100 } | 96 } |
| 101 | 97 |
| 102 void DoCalcDrawPropertiesImpl(bool can_render_to_separate_surface, | 98 void DoCalcDrawPropertiesImpl(int max_texture_size, |
| 103 int max_texture_size, | |
| 104 LayerTreeImpl* active_tree, | 99 LayerTreeImpl* active_tree, |
| 105 LayerTreeHostImpl* host_impl) { | 100 LayerTreeHostImpl* host_impl) { |
| 106 RenderSurfaceList update_list; | 101 RenderSurfaceList update_list; |
| 107 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( | 102 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( |
| 108 active_tree->root_layer_for_testing(), active_tree->DrawViewportSize(), | 103 active_tree->root_layer_for_testing(), active_tree->DrawViewportSize(), |
| 109 host_impl->DrawTransform(), active_tree->device_scale_factor(), | 104 host_impl->DrawTransform(), active_tree->device_scale_factor(), |
| 110 active_tree->current_page_scale_factor(), | 105 active_tree->current_page_scale_factor(), |
| 111 active_tree->InnerViewportContainerLayer(), | 106 active_tree->InnerViewportContainerLayer(), |
| 112 active_tree->InnerViewportScrollLayer(), | 107 active_tree->InnerViewportScrollLayer(), |
| 113 active_tree->OuterViewportScrollLayer(), | 108 active_tree->OuterViewportScrollLayer(), |
| 114 active_tree->elastic_overscroll()->Current(active_tree->IsActiveTree()), | 109 active_tree->elastic_overscroll()->Current(active_tree->IsActiveTree()), |
| 115 active_tree->OverscrollElasticityLayer(), max_texture_size, | 110 active_tree->OverscrollElasticityLayer(), max_texture_size, |
| 116 can_render_to_separate_surface, | |
| 117 host_impl->settings().layer_transforms_should_scale_layer_contents, | 111 host_impl->settings().layer_transforms_should_scale_layer_contents, |
| 118 &update_list, active_tree->property_trees()); | 112 &update_list, active_tree->property_trees()); |
| 119 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 113 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 120 } | 114 } |
| 121 }; | 115 }; |
| 122 | 116 |
| 123 TEST_F(CalcDrawPropsTest, TenTen) { | 117 TEST_F(CalcDrawPropsTest, TenTen) { |
| 124 SetTestName("10_10"); | 118 SetTestName("10_10"); |
| 125 ReadTestFile("10_10_layer_tree"); | 119 ReadTestFile("10_10_layer_tree"); |
| 126 RunCalcDrawProps(); | 120 RunCalcDrawProps(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 139 } | 133 } |
| 140 | 134 |
| 141 TEST_F(CalcDrawPropsTest, TouchRegionHeavy) { | 135 TEST_F(CalcDrawPropsTest, TouchRegionHeavy) { |
| 142 SetTestName("touch_region_heavy"); | 136 SetTestName("touch_region_heavy"); |
| 143 ReadTestFile("touch_region_heavy"); | 137 ReadTestFile("touch_region_heavy"); |
| 144 RunCalcDrawProps(); | 138 RunCalcDrawProps(); |
| 145 } | 139 } |
| 146 | 140 |
| 147 } // namespace | 141 } // namespace |
| 148 } // namespace cc | 142 } // namespace cc |
| OLD | NEW |