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/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 scoped_refptr<FakePictureLayer> child_layer_; | 1303 scoped_refptr<FakePictureLayer> child_layer_; |
1304 }; | 1304 }; |
1305 | 1305 |
1306 MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers); | 1306 MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers); |
1307 | 1307 |
1308 // TODO(sohanjg) : Remove it once impl-side painting ships everywhere. | 1308 // TODO(sohanjg) : Remove it once impl-side painting ships everywhere. |
1309 // Verify atomicity of commits and reuse of textures. | 1309 // Verify atomicity of commits and reuse of textures. |
1310 class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { | 1310 class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { |
1311 public: | 1311 public: |
1312 void InitializeSettings(LayerTreeSettings* settings) override { | 1312 void InitializeSettings(LayerTreeSettings* settings) override { |
1313 settings->texture_id_allocation_chunk_size = 1; | 1313 settings->renderer_settings.texture_id_allocation_chunk_size = 1; |
1314 // Make sure partial texture updates are turned off. | 1314 // Make sure partial texture updates are turned off. |
1315 settings->max_partial_texture_updates = 0; | 1315 settings->max_partial_texture_updates = 0; |
1316 // Linear fade animator prevents scrollbars from drawing immediately. | 1316 // Linear fade animator prevents scrollbars from drawing immediately. |
1317 settings->scrollbar_animator = LayerTreeSettings::NoAnimator; | 1317 settings->scrollbar_animator = LayerTreeSettings::NoAnimator; |
1318 } | 1318 } |
1319 | 1319 |
1320 void SetupTree() override { | 1320 void SetupTree() override { |
1321 layer_ = FakeContentLayer::Create(&client_); | 1321 layer_ = FakeContentLayer::Create(&client_); |
1322 layer_->SetBounds(gfx::Size(10, 20)); | 1322 layer_->SetBounds(gfx::Size(10, 20)); |
1323 | 1323 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 layer->SetPosition(position); | 1480 layer->SetPosition(position); |
1481 layer->SetBounds(bounds); | 1481 layer->SetBounds(bounds); |
1482 layer->SetContentsOpaque(opaque); | 1482 layer->SetContentsOpaque(opaque); |
1483 } | 1483 } |
1484 | 1484 |
1485 // TODO(sohanjg) : Remove it once impl-side painting ships everywhere. | 1485 // TODO(sohanjg) : Remove it once impl-side painting ships everywhere. |
1486 class LayerTreeHostTestAtomicCommitWithPartialUpdate | 1486 class LayerTreeHostTestAtomicCommitWithPartialUpdate |
1487 : public LayerTreeHostTest { | 1487 : public LayerTreeHostTest { |
1488 public: | 1488 public: |
1489 void InitializeSettings(LayerTreeSettings* settings) override { | 1489 void InitializeSettings(LayerTreeSettings* settings) override { |
1490 settings->texture_id_allocation_chunk_size = 1; | 1490 settings->renderer_settings.texture_id_allocation_chunk_size = 1; |
1491 // Allow one partial texture update. | 1491 // Allow one partial texture update. |
1492 settings->max_partial_texture_updates = 1; | 1492 settings->max_partial_texture_updates = 1; |
1493 // No partial updates when impl side painting is enabled. | 1493 // No partial updates when impl side painting is enabled. |
1494 settings->impl_side_painting = false; | 1494 settings->impl_side_painting = false; |
1495 } | 1495 } |
1496 | 1496 |
1497 void SetupTree() override { | 1497 void SetupTree() override { |
1498 parent_ = FakeContentLayer::Create(&client_); | 1498 parent_ = FakeContentLayer::Create(&client_); |
1499 parent_->SetBounds(gfx::Size(10, 20)); | 1499 parent_->SetBounds(gfx::Size(10, 20)); |
1500 | 1500 |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2975 }; | 2975 }; |
2976 | 2976 |
2977 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitializeWithGpuRasterization); | 2977 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitializeWithGpuRasterization); |
2978 | 2978 |
2979 // Test for UI Resource management. | 2979 // Test for UI Resource management. |
2980 class LayerTreeHostTestUIResource : public LayerTreeHostTest { | 2980 class LayerTreeHostTestUIResource : public LayerTreeHostTest { |
2981 public: | 2981 public: |
2982 LayerTreeHostTestUIResource() : num_ui_resources_(0) {} | 2982 LayerTreeHostTestUIResource() : num_ui_resources_(0) {} |
2983 | 2983 |
2984 void InitializeSettings(LayerTreeSettings* settings) override { | 2984 void InitializeSettings(LayerTreeSettings* settings) override { |
2985 settings->texture_id_allocation_chunk_size = 1; | 2985 settings->renderer_settings.texture_id_allocation_chunk_size = 1; |
2986 } | 2986 } |
2987 | 2987 |
2988 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 2988 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
2989 | 2989 |
2990 void DidCommit() override { | 2990 void DidCommit() override { |
2991 int frame = layer_tree_host()->source_frame_number(); | 2991 int frame = layer_tree_host()->source_frame_number(); |
2992 switch (frame) { | 2992 switch (frame) { |
2993 case 1: | 2993 case 1: |
2994 CreateResource(); | 2994 CreateResource(); |
2995 CreateResource(); | 2995 CreateResource(); |
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5157 } | 5157 } |
5158 | 5158 |
5159 void BeginTest() override { | 5159 void BeginTest() override { |
5160 MainThreadTaskRunner()->PostTask( | 5160 MainThreadTaskRunner()->PostTask( |
5161 FROM_HERE, | 5161 FROM_HERE, |
5162 base::Bind( | 5162 base::Bind( |
5163 &LayerTreeHostTestContinuousPainting::EnableContinuousPainting, | 5163 &LayerTreeHostTestContinuousPainting::EnableContinuousPainting, |
5164 base::Unretained(this))); | 5164 base::Unretained(this))); |
5165 // Wait 50x longer than expected. | 5165 // Wait 50x longer than expected. |
5166 double milliseconds_per_frame = | 5166 double milliseconds_per_frame = |
5167 1000.0 / layer_tree_host()->settings().refresh_rate; | 5167 1000.0 / layer_tree_host()->settings().renderer_settings.refresh_rate; |
5168 MainThreadTaskRunner()->PostDelayedTask( | 5168 MainThreadTaskRunner()->PostDelayedTask( |
5169 FROM_HERE, | 5169 FROM_HERE, |
5170 base::Bind( | 5170 base::Bind( |
5171 &LayerTreeHostTestContinuousPainting::DisableContinuousPainting, | 5171 &LayerTreeHostTestContinuousPainting::DisableContinuousPainting, |
5172 base::Unretained(this)), | 5172 base::Unretained(this)), |
5173 base::TimeDelta::FromMilliseconds(50 * kExpectedNumCommits * | 5173 base::TimeDelta::FromMilliseconds(50 * kExpectedNumCommits * |
5174 milliseconds_per_frame)); | 5174 milliseconds_per_frame)); |
5175 } | 5175 } |
5176 | 5176 |
5177 void BeginMainFrame(const BeginFrameArgs& args) override { | 5177 void BeginMainFrame(const BeginFrameArgs& args) override { |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5782 | 5782 |
5783 FakeContentLayerClient client_; | 5783 FakeContentLayerClient client_; |
5784 int step_; | 5784 int step_; |
5785 int continuous_draws_; | 5785 int continuous_draws_; |
5786 base::WaitableEvent playback_allowed_event_; | 5786 base::WaitableEvent playback_allowed_event_; |
5787 }; | 5787 }; |
5788 | 5788 |
5789 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles); | 5789 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles); |
5790 | 5790 |
5791 } // namespace cc | 5791 } // namespace cc |
OLD | NEW |