| 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 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 scoped_refptr<NoScaleContentLayer> root_layer_; | 1434 scoped_refptr<NoScaleContentLayer> root_layer_; |
| 1435 scoped_refptr<ContentLayer> child_layer_; | 1435 scoped_refptr<ContentLayer> child_layer_; |
| 1436 }; | 1436 }; |
| 1437 | 1437 |
| 1438 MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers); | 1438 MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers); |
| 1439 | 1439 |
| 1440 // Verify atomicity of commits and reuse of textures. | 1440 // Verify atomicity of commits and reuse of textures. |
| 1441 class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { | 1441 class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { |
| 1442 public: | 1442 public: |
| 1443 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 1443 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 1444 settings->texture_id_allocation_chunk_size = 1; |
| 1444 // Make sure partial texture updates are turned off. | 1445 // Make sure partial texture updates are turned off. |
| 1445 settings->max_partial_texture_updates = 0; | 1446 settings->max_partial_texture_updates = 0; |
| 1446 // Linear fade animator prevents scrollbars from drawing immediately. | 1447 // Linear fade animator prevents scrollbars from drawing immediately. |
| 1447 settings->scrollbar_animator = LayerTreeSettings::NoAnimator; | 1448 settings->scrollbar_animator = LayerTreeSettings::NoAnimator; |
| 1448 } | 1449 } |
| 1449 | 1450 |
| 1450 virtual void SetupTree() OVERRIDE { | 1451 virtual void SetupTree() OVERRIDE { |
| 1451 layer_ = FakeContentLayer::Create(&client_); | 1452 layer_ = FakeContentLayer::Create(&client_); |
| 1452 layer_->SetBounds(gfx::Size(10, 20)); | 1453 layer_->SetBounds(gfx::Size(10, 20)); |
| 1453 | 1454 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 layer->SetAnchorPoint(anchor); | 1613 layer->SetAnchorPoint(anchor); |
| 1613 layer->SetPosition(position); | 1614 layer->SetPosition(position); |
| 1614 layer->SetBounds(bounds); | 1615 layer->SetBounds(bounds); |
| 1615 layer->SetContentsOpaque(opaque); | 1616 layer->SetContentsOpaque(opaque); |
| 1616 } | 1617 } |
| 1617 | 1618 |
| 1618 class LayerTreeHostTestAtomicCommitWithPartialUpdate | 1619 class LayerTreeHostTestAtomicCommitWithPartialUpdate |
| 1619 : public LayerTreeHostTest { | 1620 : public LayerTreeHostTest { |
| 1620 public: | 1621 public: |
| 1621 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 1622 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 1623 settings->texture_id_allocation_chunk_size = 1; |
| 1622 // Allow one partial texture update. | 1624 // Allow one partial texture update. |
| 1623 settings->max_partial_texture_updates = 1; | 1625 settings->max_partial_texture_updates = 1; |
| 1624 // No partial updates when impl side painting is enabled. | 1626 // No partial updates when impl side painting is enabled. |
| 1625 settings->impl_side_painting = false; | 1627 settings->impl_side_painting = false; |
| 1626 } | 1628 } |
| 1627 | 1629 |
| 1628 virtual void SetupTree() OVERRIDE { | 1630 virtual void SetupTree() OVERRIDE { |
| 1629 parent_ = FakeContentLayer::Create(&client_); | 1631 parent_ = FakeContentLayer::Create(&client_); |
| 1630 parent_->SetBounds(gfx::Size(10, 20)); | 1632 parent_->SetBounds(gfx::Size(10, 20)); |
| 1631 | 1633 |
| (...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3744 int last_source_frame_number_drawn_; | 3746 int last_source_frame_number_drawn_; |
| 3745 }; | 3747 }; |
| 3746 | 3748 |
| 3747 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); | 3749 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); |
| 3748 | 3750 |
| 3749 // Test for UI Resource management. | 3751 // Test for UI Resource management. |
| 3750 class LayerTreeHostTestUIResource : public LayerTreeHostTest { | 3752 class LayerTreeHostTestUIResource : public LayerTreeHostTest { |
| 3751 public: | 3753 public: |
| 3752 LayerTreeHostTestUIResource() : num_ui_resources_(0), num_commits_(0) {} | 3754 LayerTreeHostTestUIResource() : num_ui_resources_(0), num_commits_(0) {} |
| 3753 | 3755 |
| 3756 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 3757 settings->texture_id_allocation_chunk_size = 1; |
| 3758 } |
| 3759 |
| 3754 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 3760 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
| 3755 | 3761 |
| 3756 virtual void DidCommit() OVERRIDE { | 3762 virtual void DidCommit() OVERRIDE { |
| 3757 int frame = num_commits_; | 3763 int frame = num_commits_; |
| 3758 switch (frame) { | 3764 switch (frame) { |
| 3759 case 1: | 3765 case 1: |
| 3760 CreateResource(); | 3766 CreateResource(); |
| 3761 CreateResource(); | 3767 CreateResource(); |
| 3762 PostSetNeedsCommitToMainThread(); | 3768 PostSetNeedsCommitToMainThread(); |
| 3763 break; | 3769 break; |
| (...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5196 size_t second_output_surface_memory_limit_; | 5202 size_t second_output_surface_memory_limit_; |
| 5197 FakeContentLayerClient client_; | 5203 FakeContentLayerClient client_; |
| 5198 scoped_refptr<FakeContentLayer> root_; | 5204 scoped_refptr<FakeContentLayer> root_; |
| 5199 }; | 5205 }; |
| 5200 | 5206 |
| 5201 // No output to copy for delegated renderers. | 5207 // No output to copy for delegated renderers. |
| 5202 SINGLE_AND_MULTI_THREAD_TEST_F( | 5208 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 5203 LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface); | 5209 LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface); |
| 5204 | 5210 |
| 5205 } // namespace cc | 5211 } // namespace cc |
| OLD | NEW |