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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 surface_layer2_->SetReplicaLayer(replica_layer2_.get()); | 1517 surface_layer2_->SetReplicaLayer(replica_layer2_.get()); |
1518 | 1518 |
1519 layer_tree_host()->SetRootLayer(root_layer_); | 1519 layer_tree_host()->SetRootLayer(root_layer_); |
1520 LayerTreeHostTest::SetupTree(); | 1520 LayerTreeHostTest::SetupTree(); |
1521 } | 1521 } |
1522 | 1522 |
1523 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1523 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
1524 | 1524 |
1525 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 1525 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
1526 Renderer* renderer = host_impl->renderer(); | 1526 Renderer* renderer = host_impl->renderer(); |
1527 RenderPass::Id surface1_render_pass_id = host_impl->active_tree() | 1527 RenderPassId surface1_render_pass_id = host_impl->active_tree() |
1528 ->root_layer() | 1528 ->root_layer() |
1529 ->children()[0] | 1529 ->children()[0] |
1530 ->render_surface() | 1530 ->render_surface() |
1531 ->RenderPassId(); | 1531 ->GetRenderPassId(); |
1532 RenderPass::Id surface2_render_pass_id = host_impl->active_tree() | 1532 RenderPassId surface2_render_pass_id = host_impl->active_tree() |
1533 ->root_layer() | 1533 ->root_layer() |
1534 ->children()[0] | 1534 ->children()[0] |
1535 ->children()[0] | 1535 ->children()[0] |
1536 ->render_surface() | 1536 ->render_surface() |
1537 ->RenderPassId(); | 1537 ->GetRenderPassId(); |
1538 | 1538 |
1539 switch (host_impl->active_tree()->source_frame_number()) { | 1539 switch (host_impl->active_tree()->source_frame_number()) { |
1540 case 0: | 1540 case 0: |
1541 EXPECT_TRUE( | 1541 EXPECT_TRUE( |
1542 renderer->HasAllocatedResourcesForTesting(surface1_render_pass_id)); | 1542 renderer->HasAllocatedResourcesForTesting(surface1_render_pass_id)); |
1543 EXPECT_TRUE( | 1543 EXPECT_TRUE( |
1544 renderer->HasAllocatedResourcesForTesting(surface2_render_pass_id)); | 1544 renderer->HasAllocatedResourcesForTesting(surface2_render_pass_id)); |
1545 | 1545 |
1546 // Reduce the memory limit to only fit the root layer and one render | 1546 // Reduce the memory limit to only fit the root layer and one render |
1547 // surface. This prevents any contents drawing into surfaces | 1547 // surface. This prevents any contents drawing into surfaces |
(...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5027 const gfx::Size bounds_; | 5027 const gfx::Size bounds_; |
5028 FakeContentLayerClient client_; | 5028 FakeContentLayerClient client_; |
5029 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; | 5029 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; |
5030 scoped_refptr<FakePictureLayer> picture_layer_; | 5030 scoped_refptr<FakePictureLayer> picture_layer_; |
5031 Layer* child_layer_; | 5031 Layer* child_layer_; |
5032 }; | 5032 }; |
5033 | 5033 |
5034 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); | 5034 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); |
5035 | 5035 |
5036 } // namespace cc | 5036 } // namespace cc |
OLD | NEW |