OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resource_provider.h" | 5 #include "cc/resource_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "cc/output_surface.h" | 9 #include "cc/output_surface.h" |
10 #include "cc/scoped_ptr_deque.h" | 10 #include "cc/scoped_ptr_deque.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 674 |
675 TEST_P(ResourceProviderTest, TransferMailboxResources) | 675 TEST_P(ResourceProviderTest, TransferMailboxResources) |
676 { | 676 { |
677 // Resource transfer is only supported with GL textures for now. | 677 // Resource transfer is only supported with GL textures for now. |
678 if (GetParam() != ResourceProvider::GLTexture) | 678 if (GetParam() != ResourceProvider::GLTexture) |
679 return; | 679 return; |
680 unsigned texture = context()->createTexture(); | 680 unsigned texture = context()->createTexture(); |
681 context()->bindTexture(GL_TEXTURE_2D, texture); | 681 context()->bindTexture(GL_TEXTURE_2D, texture); |
682 uint8_t data[4] = {1, 2, 3, 4}; | 682 uint8_t data[4] = {1, 2, 3, 4}; |
683 context()->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGN
ED_BYTE, &data); | 683 context()->texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGN
ED_BYTE, &data); |
684 Mailbox mailbox; | 684 gpu::Mailbox mailbox; |
685 context()->genMailboxCHROMIUM(mailbox.name); | 685 context()->genMailboxCHROMIUM(mailbox.name); |
686 context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 686 context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
687 unsigned syncPoint = context()->insertSyncPoint(); | 687 unsigned syncPoint = context()->insertSyncPoint(); |
688 | 688 |
689 // All the logic below assumes that the sync points are all positive. | 689 // All the logic below assumes that the sync points are all positive. |
690 EXPECT_LT(0u, syncPoint); | 690 EXPECT_LT(0u, syncPoint); |
691 | 691 |
692 unsigned releaseSyncPoint = 0; | 692 unsigned releaseSyncPoint = 0; |
693 TextureMailbox::ReleaseCallback callback = base::Bind(ReleaseTextureMailbox,
&releaseSyncPoint); | 693 TextureMailbox::ReleaseCallback callback = base::Bind(ReleaseTextureMailbox,
&releaseSyncPoint); |
694 ResourceProvider::ResourceId resource = m_resourceProvider->createResourceFr
omTextureMailbox(TextureMailbox(mailbox, callback, syncPoint)); | 694 ResourceProvider::ResourceId resource = m_resourceProvider->createResourceFr
omTextureMailbox(TextureMailbox(mailbox, callback, syncPoint)); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 Mock::VerifyAndClearExpectations(context); | 948 Mock::VerifyAndClearExpectations(context); |
949 } | 949 } |
950 | 950 |
951 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, | 951 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, |
952 ResourceProviderTest, | 952 ResourceProviderTest, |
953 ::testing::Values(ResourceProvider::GLTexture, | 953 ::testing::Values(ResourceProvider::GLTexture, |
954 ResourceProvider::Bitmap)); | 954 ResourceProvider::Bitmap)); |
955 | 955 |
956 } // namespace | 956 } // namespace |
957 } // namespace cc | 957 } // namespace cc |
OLD | NEW |