| 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 "cc/output/copy_output_request.h" | 5 #include "cc/output/copy_output_request.h" |
| 6 #include "cc/output/copy_output_result.h" | 6 #include "cc/output/copy_output_result.h" |
| 7 #include "cc/test/fake_content_layer.h" | 7 #include "cc/test/fake_content_layer.h" |
| 8 #include "cc/test/fake_content_layer_client.h" | 8 #include "cc/test/fake_content_layer_client.h" |
| 9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
| 10 #include "cc/test/layer_tree_test.h" | 10 #include "cc/test/layer_tree_test.h" |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 // Request a copy to a provided texture. This should not create a new | 799 // Request a copy to a provided texture. This should not create a new |
| 800 // texture. | 800 // texture. |
| 801 scoped_ptr<CopyOutputRequest> request = | 801 scoped_ptr<CopyOutputRequest> request = |
| 802 CopyOutputRequest::CreateRequest(base::Bind( | 802 CopyOutputRequest::CreateRequest(base::Bind( |
| 803 &LayerTreeHostCopyRequestTestProvideTexture::CopyOutputCallback, | 803 &LayerTreeHostCopyRequestTestProvideTexture::CopyOutputCallback, |
| 804 base::Unretained(this))); | 804 base::Unretained(this))); |
| 805 | 805 |
| 806 gpu::Mailbox mailbox; | 806 gpu::Mailbox mailbox; |
| 807 external_context_provider_->Context3d()->genMailboxCHROMIUM(mailbox.name); | 807 external_context_provider_->Context3d()->genMailboxCHROMIUM(mailbox.name); |
| 808 sync_point_ = external_context_provider_->Context3d()->insertSyncPoint(); | 808 sync_point_ = external_context_provider_->Context3d()->insertSyncPoint(); |
| 809 request->SetTextureMailbox(TextureMailbox(mailbox, sync_point_)); | 809 request->SetTextureMailbox( |
| 810 TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point_)); |
| 810 EXPECT_TRUE(request->has_texture_mailbox()); | 811 EXPECT_TRUE(request->has_texture_mailbox()); |
| 811 | 812 |
| 812 copy_layer_->RequestCopyOfOutput(request.Pass()); | 813 copy_layer_->RequestCopyOfOutput(request.Pass()); |
| 813 } | 814 } |
| 814 | 815 |
| 815 virtual void AfterTest() OVERRIDE { | 816 virtual void AfterTest() OVERRIDE { |
| 816 // Expect the compositor to have waited for the sync point in the provided | 817 // Expect the compositor to have waited for the sync point in the provided |
| 817 // TextureMailbox. | 818 // TextureMailbox. |
| 818 EXPECT_EQ(sync_point_, waited_sync_point_after_readback_); | 819 EXPECT_EQ(sync_point_, waited_sync_point_after_readback_); |
| 819 // Except the copy to have *not* made another texture. | 820 // Except the copy to have *not* made another texture. |
| 820 EXPECT_EQ(num_textures_without_readback_, num_textures_with_readback_); | 821 EXPECT_EQ(num_textures_without_readback_, num_textures_with_readback_); |
| 821 } | 822 } |
| 822 | 823 |
| 823 scoped_refptr<TestContextProvider> external_context_provider_; | 824 scoped_refptr<TestContextProvider> external_context_provider_; |
| 824 unsigned sync_point_; | 825 unsigned sync_point_; |
| 825 }; | 826 }; |
| 826 | 827 |
| 827 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( | 828 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( |
| 828 LayerTreeHostCopyRequestTestProvideTexture); | 829 LayerTreeHostCopyRequestTestProvideTexture); |
| 829 | 830 |
| 830 } // namespace | 831 } // namespace |
| 831 } // namespace cc | 832 } // namespace cc |
| OLD | NEW |