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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
657 // If we make it without kicking a frame, we pass! | 657 // If we make it without kicking a frame, we pass! |
658 EndTestAfterDelay(1); | 658 EndTestAfterDelay(1); |
659 } | 659 } |
660 | 660 |
661 virtual void Layout() OVERRIDE { | 661 virtual void Layout() OVERRIDE { |
662 ASSERT_FALSE(true); | 662 ASSERT_FALSE(true); |
663 EndTest(); | 663 EndTest(); |
664 } | 664 } |
665 | 665 |
666 virtual void AfterTest() OVERRIDE {} | 666 virtual void AfterTest() OVERRIDE {} |
667 | |
668 private: | |
669 }; | 667 }; |
670 | 668 |
671 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortFrameWhenInvisible); | 669 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortFrameWhenInvisible); |
672 | 670 |
673 // This test verifies that properties on the layer tree host are commited | 671 // This test verifies that properties on the layer tree host are commited |
674 // to the impl side. | 672 // to the impl side. |
675 class LayerTreeHostTestCommit : public LayerTreeHostTest { | 673 class LayerTreeHostTestCommit : public LayerTreeHostTest { |
676 public: | 674 public: |
677 LayerTreeHostTestCommit() {} | 675 LayerTreeHostTestCommit() {} |
678 | 676 |
(...skipping 3778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4457 } | 4455 } |
4458 | 4456 |
4459 private: | 4457 private: |
4460 int num_will_begin_frames_; | 4458 int num_will_begin_frames_; |
4461 int num_impl_commits_; | 4459 int num_impl_commits_; |
4462 }; | 4460 }; |
4463 | 4461 |
4464 // Commits can only be aborted when using the thread proxy. | 4462 // Commits can only be aborted when using the thread proxy. |
4465 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortEvictedTextures); | 4463 MULTI_THREAD_TEST_F(LayerTreeHostTestAbortEvictedTextures); |
4466 | 4464 |
4465 class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { | |
4466 protected: | |
4467 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | |
4468 settings->impl_side_painting = true; | |
4469 } | |
4470 | |
4471 virtual void SetupTree() OVERRIDE { | |
4472 scoped_refptr<FakePictureLayer> root_layer = | |
4473 FakePictureLayer::Create(&client_); | |
4474 // 6000 * 6000 * 4bpp = 144MB | |
4475 root_layer->SetBounds(gfx::Size(6000, 6000)); | |
4476 root_layer->SetIsDrawable(true); | |
4477 | |
4478 layer_tree_host()->SetRootLayer(root_layer); | |
4479 LayerTreeHostTest::SetupTree(); | |
4480 } | |
4481 | |
4482 virtual void BeginTest() OVERRIDE { | |
4483 PostSetNeedsCommitToMainThread(); | |
4484 } | |
4485 | |
4486 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { | |
4487 TestWebGraphicsContext3D* context = static_cast<TestWebGraphicsContext3D*>( | |
4488 impl->output_surface()->context_provider()->Context3d()); | |
4489 // The default MaxTransferBufferUsageBytes value is 64MB. | |
danakj
2013/09/06 21:48:17
Can you assert this value somewhere int he test so
kaanb
2013/09/06 21:58:45
If I add a getter for to TileManager yes, but reve
danakj
2013/09/06 22:01:13
What I mean is the limit that the we're passing in
reveman
2013/09/06 22:28:27
+1
kaanb
2013/09/07 01:30:31
Done.
| |
4490 // Expect that we're using less than that. | |
4491 EXPECT_GT(64 * 1024 * 1024u, context->transfer_buffer_memory_used_bytes()); | |
4492 EndTest(); | |
4493 } | |
4494 | |
4495 virtual void AfterTest() OVERRIDE {} | |
4496 | |
4497 private: | |
4498 FakeContentLayerClient client_; | |
4499 }; | |
4500 | |
4501 // Impl-side painting is a multi-threaded compositor feature. | |
4502 MULTI_THREAD_TEST_F(LayerTreeHostTestMaxTransferBufferUsageBytes); | |
4503 | |
4467 } // namespace | 4504 } // namespace |
4468 | 4505 |
4469 } // namespace cc | 4506 } // namespace cc |
OLD | NEW |