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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::gles2::GLES2Interface* gl = external_context_provider_->ContextGL(); | 806 gpu::gles2::GLES2Interface* gl = external_context_provider_->ContextGL(); |
807 gpu::Mailbox mailbox; | 807 gpu::Mailbox mailbox; |
808 gl->GenMailboxCHROMIUM(mailbox.name); | 808 gl->GenMailboxCHROMIUM(mailbox.name); |
809 sync_point_ = gl->InsertSyncPointCHROMIUM(); | 809 sync_point_ = gl->InsertSyncPointCHROMIUM(); |
810 request->SetTextureMailbox(TextureMailbox(mailbox, sync_point_)); | 810 request->SetTextureMailbox( |
| 811 TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point_)); |
811 EXPECT_TRUE(request->has_texture_mailbox()); | 812 EXPECT_TRUE(request->has_texture_mailbox()); |
812 | 813 |
813 copy_layer_->RequestCopyOfOutput(request.Pass()); | 814 copy_layer_->RequestCopyOfOutput(request.Pass()); |
814 } | 815 } |
815 | 816 |
816 virtual void AfterTest() OVERRIDE { | 817 virtual void AfterTest() OVERRIDE { |
817 // Expect the compositor to have waited for the sync point in the provided | 818 // Expect the compositor to have waited for the sync point in the provided |
818 // TextureMailbox. | 819 // TextureMailbox. |
819 EXPECT_EQ(sync_point_, waited_sync_point_after_readback_); | 820 EXPECT_EQ(sync_point_, waited_sync_point_after_readback_); |
820 // Except the copy to have *not* made another texture. | 821 // Except the copy to have *not* made another texture. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 FakeContentLayerClient client_; | 901 FakeContentLayerClient client_; |
901 scoped_refptr<FakeContentLayer> root_; | 902 scoped_refptr<FakeContentLayer> root_; |
902 scoped_refptr<FakeContentLayer> copy_layer_; | 903 scoped_refptr<FakeContentLayer> copy_layer_; |
903 }; | 904 }; |
904 | 905 |
905 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 906 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
906 LayerTreeHostCopyRequestTestDestroyBeforeCopy); | 907 LayerTreeHostCopyRequestTestDestroyBeforeCopy); |
907 | 908 |
908 } // namespace | 909 } // namespace |
909 } // namespace cc | 910 } // namespace cc |
OLD | NEW |