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/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 std::fill_n(pixels, size.GetArea(), value); | 90 std::fill_n(pixels, size.GetArea(), value); |
91 return shared_bitmap.Pass(); | 91 return shared_bitmap.Pass(); |
92 } | 92 } |
93 | 93 |
94 class TextureStateTrackingContext : public TestWebGraphicsContext3D { | 94 class TextureStateTrackingContext : public TestWebGraphicsContext3D { |
95 public: | 95 public: |
96 MOCK_METHOD2(bindTexture, void(GLenum target, GLuint texture)); | 96 MOCK_METHOD2(bindTexture, void(GLenum target, GLuint texture)); |
97 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); | 97 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); |
98 MOCK_METHOD1(waitSyncPoint, void(GLuint sync_point)); | 98 MOCK_METHOD1(waitSyncPoint, void(GLuint sync_point)); |
99 MOCK_METHOD0(insertSyncPoint, GLuint(void)); | 99 MOCK_METHOD0(insertSyncPoint, GLuint(void)); |
100 MOCK_METHOD2(produceTextureCHROMIUM, | 100 MOCK_METHOD3(produceTextureDirectCHROMIUM, |
101 void(GLenum target, const GLbyte* mailbox)); | 101 void(GLuint texture, GLenum target, const GLbyte* mailbox)); |
102 MOCK_METHOD2(consumeTextureCHROMIUM, | |
danakj
2015/02/13 18:12:22
dont we want consume direct here so we can test th
sohanjg
2015/02/16 13:39:56
Hmm..the thing is we have 2 implementation of crea
danakj
2015/02/18 18:37:28
This would override the one from TestWebGraphicsCo
sohanjg
2015/02/19 14:54:47
Sorry for not being clear.
What i meant was, If w
| |
103 void(GLenum target, const GLbyte* mailbox)); | |
104 | 102 |
105 // Force all textures to be consecutive numbers starting at "1", | 103 // Force all textures to be consecutive numbers starting at "1", |
106 // so we easily can test for them. | 104 // so we easily can test for them. |
107 GLuint NextTextureId() override { | 105 GLuint NextTextureId() override { |
108 base::AutoLock lock(namespace_->lock); | 106 base::AutoLock lock(namespace_->lock); |
109 return namespace_->next_texture_id++; | 107 return namespace_->next_texture_id++; |
110 } | 108 } |
111 void RetireTextureId(GLuint) override {} | 109 void RetireTextureId(GLuint) override {} |
112 }; | 110 }; |
113 | 111 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 ASSERT_EQ(GLDataFormat(BoundTexture(target)->format), format); | 249 ASSERT_EQ(GLDataFormat(BoundTexture(target)->format), format); |
252 } | 250 } |
253 ASSERT_TRUE(pixels); | 251 ASSERT_TRUE(pixels); |
254 SetPixels(xoffset, yoffset, width, height, pixels); | 252 SetPixels(xoffset, yoffset, width, height, pixels); |
255 } | 253 } |
256 | 254 |
257 void genMailboxCHROMIUM(GLbyte* mailbox) override { | 255 void genMailboxCHROMIUM(GLbyte* mailbox) override { |
258 return shared_data_->GenMailbox(mailbox); | 256 return shared_data_->GenMailbox(mailbox); |
259 } | 257 } |
260 | 258 |
261 void produceTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override { | 259 void produceTextureDirectCHROMIUM(GLuint texture, |
262 CheckTextureIsBound(target); | 260 GLenum target, |
263 | 261 const GLbyte* mailbox) override { |
264 // Delay moving the texture into the mailbox until the next | 262 // Delay moving the texture into the mailbox until the next |
265 // InsertSyncPoint, so that it is not visible to other contexts that | 263 // InsertSyncPoint, so that it is not visible to other contexts that |
266 // haven't waited on that sync point. | 264 // haven't waited on that sync point. |
267 scoped_ptr<PendingProduceTexture> pending(new PendingProduceTexture); | 265 scoped_ptr<PendingProduceTexture> pending(new PendingProduceTexture); |
268 memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox)); | 266 memcpy(pending->mailbox, mailbox, sizeof(pending->mailbox)); |
269 base::AutoLock lock_for_texture_access(namespace_->lock); | 267 base::AutoLock lock_for_texture_access(namespace_->lock); |
270 pending->texture = BoundTexture(target); | 268 pending->texture = UnboundTexture(texture); |
271 pending_produce_textures_.push_back(pending.Pass()); | 269 pending_produce_textures_.push_back(pending.Pass()); |
272 } | 270 } |
273 | 271 |
272 GLuint createAndConsumeTextureCHROMIUM(GLenum target, | |
273 const GLbyte* mailbox) override { | |
274 GLuint texture_id = createTexture(); | |
275 base::AutoLock lock_for_texture_access(namespace_->lock); | |
276 scoped_refptr<TestTexture> texture = | |
277 shared_data_->ConsumeTexture(mailbox, last_waited_sync_point_); | |
278 namespace_->textures.Replace(texture_id, texture); | |
279 return texture_id; | |
280 } | |
281 | |
274 void consumeTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override { | 282 void consumeTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override { |
danakj
2015/02/13 18:12:22
no longer used?
sohanjg
2015/02/16 13:39:56
it is still used internally by TestWebGraphicsCont
| |
275 CheckTextureIsBound(target); | 283 CheckTextureIsBound(target); |
276 base::AutoLock lock_for_texture_access(namespace_->lock); | 284 base::AutoLock lock_for_texture_access(namespace_->lock); |
277 scoped_refptr<TestTexture> texture = | 285 scoped_refptr<TestTexture> texture = |
278 shared_data_->ConsumeTexture(mailbox, last_waited_sync_point_); | 286 shared_data_->ConsumeTexture(mailbox, last_waited_sync_point_); |
279 namespace_->textures.Replace(BoundTextureId(target), texture); | 287 namespace_->textures.Replace(BoundTextureId(target), texture); |
280 } | 288 } |
281 | 289 |
282 void GetPixels(const gfx::Size& size, | 290 void GetPixels(const gfx::Size& size, |
283 ResourceFormat format, | 291 ResourceFormat format, |
284 uint8_t* pixels) { | 292 uint8_t* pixels) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 | 462 |
455 ResourceProviderContext* context() { return context3d_; } | 463 ResourceProviderContext* context() { return context3d_; } |
456 | 464 |
457 ResourceProvider::ResourceId CreateChildMailbox(uint32* release_sync_point, | 465 ResourceProvider::ResourceId CreateChildMailbox(uint32* release_sync_point, |
458 bool* lost_resource, | 466 bool* lost_resource, |
459 bool* release_called, | 467 bool* release_called, |
460 uint32* sync_point) { | 468 uint32* sync_point) { |
461 if (GetParam() == ResourceProvider::GLTexture) { | 469 if (GetParam() == ResourceProvider::GLTexture) { |
462 unsigned texture = child_context_->createTexture(); | 470 unsigned texture = child_context_->createTexture(); |
463 gpu::Mailbox gpu_mailbox; | 471 gpu::Mailbox gpu_mailbox; |
464 child_context_->bindTexture(GL_TEXTURE_2D, texture); | |
465 child_context_->genMailboxCHROMIUM(gpu_mailbox.name); | 472 child_context_->genMailboxCHROMIUM(gpu_mailbox.name); |
466 child_context_->produceTextureCHROMIUM(GL_TEXTURE_2D, gpu_mailbox.name); | 473 child_context_->produceTextureDirectCHROMIUM(texture, GL_TEXTURE_2D, |
474 gpu_mailbox.name); | |
467 *sync_point = child_context_->insertSyncPoint(); | 475 *sync_point = child_context_->insertSyncPoint(); |
468 EXPECT_LT(0u, *sync_point); | 476 EXPECT_LT(0u, *sync_point); |
469 | 477 |
470 scoped_ptr<SharedBitmap> shared_bitmap; | 478 scoped_ptr<SharedBitmap> shared_bitmap; |
471 scoped_ptr<SingleReleaseCallbackImpl> callback = | 479 scoped_ptr<SingleReleaseCallbackImpl> callback = |
472 SingleReleaseCallbackImpl::Create(base::Bind( | 480 SingleReleaseCallbackImpl::Create(base::Bind( |
473 ReleaseSharedBitmapCallback, base::Passed(&shared_bitmap), | 481 ReleaseSharedBitmapCallback, base::Passed(&shared_bitmap), |
474 release_called, release_sync_point, lost_resource)); | 482 release_called, release_sync_point, lost_resource)); |
475 return child_resource_provider_->CreateResourceFromTextureMailbox( | 483 return child_resource_provider_->CreateResourceFromTextureMailbox( |
476 TextureMailbox(gpu_mailbox, GL_TEXTURE_2D, *sync_point), | 484 TextureMailbox(gpu_mailbox, GL_TEXTURE_2D, *sync_point), |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
629 | 637 |
630 ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource( | 638 ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource( |
631 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format); | 639 size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format); |
632 { | 640 { |
633 ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock( | 641 ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock( |
634 child_resource_provider_.get(), id3); | 642 child_resource_provider_.get(), id3); |
635 EXPECT_TRUE(!!lock.GetGpuMemoryBuffer()); | 643 EXPECT_TRUE(!!lock.GetGpuMemoryBuffer()); |
636 } | 644 } |
637 | 645 |
638 GLuint external_texture_id = child_context_->createExternalTexture(); | 646 GLuint external_texture_id = child_context_->createExternalTexture(); |
639 child_context_->bindTexture(GL_TEXTURE_EXTERNAL_OES, external_texture_id); | |
640 | 647 |
641 gpu::Mailbox external_mailbox; | 648 gpu::Mailbox external_mailbox; |
642 child_context_->genMailboxCHROMIUM(external_mailbox.name); | 649 child_context_->genMailboxCHROMIUM(external_mailbox.name); |
643 child_context_->produceTextureCHROMIUM(GL_TEXTURE_EXTERNAL_OES, | 650 child_context_->produceTextureDirectCHROMIUM( |
644 external_mailbox.name); | 651 external_texture_id, GL_TEXTURE_EXTERNAL_OES, external_mailbox.name); |
645 const GLuint external_sync_point = child_context_->insertSyncPoint(); | 652 const GLuint external_sync_point = child_context_->insertSyncPoint(); |
646 ResourceProvider::ResourceId id4 = | 653 ResourceProvider::ResourceId id4 = |
647 child_resource_provider_->CreateResourceFromTextureMailbox( | 654 child_resource_provider_->CreateResourceFromTextureMailbox( |
648 TextureMailbox( | 655 TextureMailbox( |
649 external_mailbox, GL_TEXTURE_EXTERNAL_OES, external_sync_point), | 656 external_mailbox, GL_TEXTURE_EXTERNAL_OES, external_sync_point), |
650 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback))); | 657 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback))); |
651 | 658 |
652 ReturnedResourceArray returned_to_child; | 659 ReturnedResourceArray returned_to_child; |
653 int child_id = | 660 int child_id = |
654 resource_provider_->CreateChild(GetReturnCallback(&returned_to_child)); | 661 resource_provider_->CreateChild(GetReturnCallback(&returned_to_child)); |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1716 | 1723 |
1717 ReturnedResourceArray returned_to_child; | 1724 ReturnedResourceArray returned_to_child; |
1718 int child_id = parent_resource_provider->CreateChild( | 1725 int child_id = parent_resource_provider->CreateChild( |
1719 GetReturnCallback(&returned_to_child)); | 1726 GetReturnCallback(&returned_to_child)); |
1720 { | 1727 { |
1721 // Transfer some resource to the parent. | 1728 // Transfer some resource to the parent. |
1722 ResourceProvider::ResourceIdArray resource_ids_to_transfer; | 1729 ResourceProvider::ResourceIdArray resource_ids_to_transfer; |
1723 resource_ids_to_transfer.push_back(id); | 1730 resource_ids_to_transfer.push_back(id); |
1724 TransferableResourceArray list; | 1731 TransferableResourceArray list; |
1725 | 1732 |
1726 EXPECT_CALL(*child_context, bindTexture(GL_TEXTURE_2D, child_texture_id)); | |
1727 EXPECT_CALL(*child_context, | 1733 EXPECT_CALL(*child_context, |
1728 produceTextureCHROMIUM(GL_TEXTURE_2D, _)); | 1734 produceTextureDirectCHROMIUM(_, GL_TEXTURE_2D, _)); |
1729 EXPECT_CALL(*child_context, insertSyncPoint()); | 1735 EXPECT_CALL(*child_context, insertSyncPoint()); |
1730 child_resource_provider->PrepareSendToParent(resource_ids_to_transfer, | 1736 child_resource_provider->PrepareSendToParent(resource_ids_to_transfer, |
1731 &list); | 1737 &list); |
1732 Mock::VerifyAndClearExpectations(child_context); | 1738 Mock::VerifyAndClearExpectations(child_context); |
1733 | 1739 |
1734 ASSERT_EQ(1u, list.size()); | 1740 ASSERT_EQ(1u, list.size()); |
1735 EXPECT_EQ(static_cast<unsigned>(child_filter), list[0].filter); | 1741 EXPECT_EQ(static_cast<unsigned>(child_filter), list[0].filter); |
1736 | 1742 |
1737 EXPECT_CALL(*parent_context, | |
1738 bindTexture(GL_TEXTURE_2D, parent_texture_id)); | |
1739 EXPECT_CALL(*parent_context, consumeTextureCHROMIUM(GL_TEXTURE_2D, _)); | |
danakj
2015/02/13 18:12:22
shouldnt we be getting a consumetexturedirectchrom
sohanjg
2015/02/16 13:39:56
We have to make it MOCK method then, and there see
| |
1740 parent_resource_provider->ReceiveFromChild(child_id, list); | 1743 parent_resource_provider->ReceiveFromChild(child_id, list); |
1741 { | 1744 { |
1742 parent_resource_provider->WaitSyncPointIfNeeded(list[0].id); | 1745 parent_resource_provider->WaitSyncPointIfNeeded(list[0].id); |
1743 ResourceProvider::ScopedReadLockGL lock(parent_resource_provider.get(), | 1746 ResourceProvider::ScopedReadLockGL lock(parent_resource_provider.get(), |
1744 list[0].id); | 1747 list[0].id); |
1745 } | 1748 } |
1746 Mock::VerifyAndClearExpectations(parent_context); | 1749 Mock::VerifyAndClearExpectations(parent_context); |
1747 | 1750 |
1748 parent_resource_provider->DeclareUsedResourcesFromChild( | 1751 parent_resource_provider->DeclareUsedResourcesFromChild( |
1749 child_id, resource_ids_to_transfer); | 1752 child_id, resource_ids_to_transfer); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1813 // Other mailbox transfers tested elsewhere. | 1816 // Other mailbox transfers tested elsewhere. |
1814 if (GetParam() != ResourceProvider::GLTexture) | 1817 if (GetParam() != ResourceProvider::GLTexture) |
1815 return; | 1818 return; |
1816 unsigned texture = context()->createTexture(); | 1819 unsigned texture = context()->createTexture(); |
1817 context()->bindTexture(GL_TEXTURE_2D, texture); | 1820 context()->bindTexture(GL_TEXTURE_2D, texture); |
1818 uint8_t data[4] = { 1, 2, 3, 4 }; | 1821 uint8_t data[4] = { 1, 2, 3, 4 }; |
1819 context()->texImage2D( | 1822 context()->texImage2D( |
1820 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &data); | 1823 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &data); |
1821 gpu::Mailbox mailbox; | 1824 gpu::Mailbox mailbox; |
1822 context()->genMailboxCHROMIUM(mailbox.name); | 1825 context()->genMailboxCHROMIUM(mailbox.name); |
1823 context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 1826 context()->produceTextureDirectCHROMIUM(texture, GL_TEXTURE_2D, mailbox.name); |
1824 uint32 sync_point = context()->insertSyncPoint(); | 1827 uint32 sync_point = context()->insertSyncPoint(); |
1825 | 1828 |
1826 // All the logic below assumes that the sync points are all positive. | 1829 // All the logic below assumes that the sync points are all positive. |
1827 EXPECT_LT(0u, sync_point); | 1830 EXPECT_LT(0u, sync_point); |
1828 | 1831 |
1829 uint32 release_sync_point = 0; | 1832 uint32 release_sync_point = 0; |
1830 bool lost_resource = false; | 1833 bool lost_resource = false; |
1831 BlockingTaskRunner* main_thread_task_runner = NULL; | 1834 BlockingTaskRunner* main_thread_task_runner = NULL; |
1832 ReleaseCallbackImpl callback = base::Bind(ReleaseCallback, | 1835 ReleaseCallbackImpl callback = base::Bind(ReleaseCallback, |
1833 &release_sync_point, | 1836 &release_sync_point, |
(...skipping 13 matching lines...) Expand all Loading... | |
1847 resource_provider_->PrepareSendToParent(resource_ids_to_transfer, &list); | 1850 resource_provider_->PrepareSendToParent(resource_ids_to_transfer, &list); |
1848 ASSERT_EQ(1u, list.size()); | 1851 ASSERT_EQ(1u, list.size()); |
1849 EXPECT_LE(sync_point, list[0].mailbox_holder.sync_point); | 1852 EXPECT_LE(sync_point, list[0].mailbox_holder.sync_point); |
1850 EXPECT_EQ(0, | 1853 EXPECT_EQ(0, |
1851 memcmp(mailbox.name, | 1854 memcmp(mailbox.name, |
1852 list[0].mailbox_holder.mailbox.name, | 1855 list[0].mailbox_holder.mailbox.name, |
1853 sizeof(mailbox.name))); | 1856 sizeof(mailbox.name))); |
1854 EXPECT_EQ(0u, release_sync_point); | 1857 EXPECT_EQ(0u, release_sync_point); |
1855 | 1858 |
1856 context()->waitSyncPoint(list[0].mailbox_holder.sync_point); | 1859 context()->waitSyncPoint(list[0].mailbox_holder.sync_point); |
1857 unsigned other_texture = context()->createTexture(); | 1860 unsigned other_texture = |
1858 context()->bindTexture(GL_TEXTURE_2D, other_texture); | 1861 context()->createAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
1859 context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | |
1860 uint8_t test_data[4] = { 0 }; | 1862 uint8_t test_data[4] = { 0 }; |
1861 context()->GetPixels( | 1863 context()->GetPixels( |
1862 gfx::Size(1, 1), RGBA_8888, test_data); | 1864 gfx::Size(1, 1), RGBA_8888, test_data); |
1863 EXPECT_EQ(0, memcmp(data, test_data, sizeof(data))); | 1865 EXPECT_EQ(0, memcmp(data, test_data, sizeof(data))); |
1864 context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 1866 |
1867 context()->produceTextureDirectCHROMIUM(other_texture, GL_TEXTURE_2D, | |
1868 mailbox.name); | |
1865 context()->deleteTexture(other_texture); | 1869 context()->deleteTexture(other_texture); |
1866 list[0].mailbox_holder.sync_point = context()->insertSyncPoint(); | 1870 list[0].mailbox_holder.sync_point = context()->insertSyncPoint(); |
1867 EXPECT_LT(0u, list[0].mailbox_holder.sync_point); | 1871 EXPECT_LT(0u, list[0].mailbox_holder.sync_point); |
1868 | 1872 |
1869 // Receive the resource, then delete it, expect the sync points to be | 1873 // Receive the resource, then delete it, expect the sync points to be |
1870 // consistent. | 1874 // consistent. |
1871 ReturnedResourceArray returned; | 1875 ReturnedResourceArray returned; |
1872 TransferableResource::ReturnResources(list, &returned); | 1876 TransferableResource::ReturnResources(list, &returned); |
1873 resource_provider_->ReceiveReturnsFromParent(returned); | 1877 resource_provider_->ReceiveReturnsFromParent(returned); |
1874 EXPECT_EQ(1u, context()->NumTextures()); | 1878 EXPECT_EQ(1u, context()->NumTextures()); |
(...skipping 23 matching lines...) Expand all Loading... | |
1898 resource_provider_->PrepareSendToParent(resource_ids_to_transfer, &list); | 1902 resource_provider_->PrepareSendToParent(resource_ids_to_transfer, &list); |
1899 ASSERT_EQ(1u, list.size()); | 1903 ASSERT_EQ(1u, list.size()); |
1900 EXPECT_LE(sync_point, list[0].mailbox_holder.sync_point); | 1904 EXPECT_LE(sync_point, list[0].mailbox_holder.sync_point); |
1901 EXPECT_EQ(0, | 1905 EXPECT_EQ(0, |
1902 memcmp(mailbox.name, | 1906 memcmp(mailbox.name, |
1903 list[0].mailbox_holder.mailbox.name, | 1907 list[0].mailbox_holder.mailbox.name, |
1904 sizeof(mailbox.name))); | 1908 sizeof(mailbox.name))); |
1905 EXPECT_EQ(0u, release_sync_point); | 1909 EXPECT_EQ(0u, release_sync_point); |
1906 | 1910 |
1907 context()->waitSyncPoint(list[0].mailbox_holder.sync_point); | 1911 context()->waitSyncPoint(list[0].mailbox_holder.sync_point); |
1908 unsigned other_texture = context()->createTexture(); | 1912 unsigned other_texture = |
1909 context()->bindTexture(GL_TEXTURE_2D, other_texture); | 1913 context()->createAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
1910 context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | |
1911 uint8_t test_data[4] = { 0 }; | 1914 uint8_t test_data[4] = { 0 }; |
1912 context()->GetPixels( | 1915 context()->GetPixels( |
1913 gfx::Size(1, 1), RGBA_8888, test_data); | 1916 gfx::Size(1, 1), RGBA_8888, test_data); |
1914 EXPECT_EQ(0, memcmp(data, test_data, sizeof(data))); | 1917 EXPECT_EQ(0, memcmp(data, test_data, sizeof(data))); |
1915 context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 1918 |
1919 context()->produceTextureDirectCHROMIUM(other_texture, GL_TEXTURE_2D, | |
1920 mailbox.name); | |
1916 context()->deleteTexture(other_texture); | 1921 context()->deleteTexture(other_texture); |
1917 list[0].mailbox_holder.sync_point = context()->insertSyncPoint(); | 1922 list[0].mailbox_holder.sync_point = context()->insertSyncPoint(); |
1918 EXPECT_LT(0u, list[0].mailbox_holder.sync_point); | 1923 EXPECT_LT(0u, list[0].mailbox_holder.sync_point); |
1919 | 1924 |
1920 // Delete the resource, which shouldn't do anything. | 1925 // Delete the resource, which shouldn't do anything. |
1921 resource_provider_->DeleteResource(resource); | 1926 resource_provider_->DeleteResource(resource); |
1922 EXPECT_EQ(1u, context()->NumTextures()); | 1927 EXPECT_EQ(1u, context()->NumTextures()); |
1923 EXPECT_EQ(0u, release_sync_point); | 1928 EXPECT_EQ(0u, release_sync_point); |
1924 | 1929 |
1925 // Then receive the resource which should release the mailbox, expect the | 1930 // Then receive the resource which should release the mailbox, expect the |
1926 // sync points to be consistent. | 1931 // sync points to be consistent. |
1927 ReturnedResourceArray returned; | 1932 ReturnedResourceArray returned; |
1928 TransferableResource::ReturnResources(list, &returned); | 1933 TransferableResource::ReturnResources(list, &returned); |
1929 resource_provider_->ReceiveReturnsFromParent(returned); | 1934 resource_provider_->ReceiveReturnsFromParent(returned); |
1930 EXPECT_LE(list[0].mailbox_holder.sync_point, release_sync_point); | 1935 EXPECT_LE(list[0].mailbox_holder.sync_point, release_sync_point); |
1931 EXPECT_FALSE(lost_resource); | 1936 EXPECT_FALSE(lost_resource); |
1932 EXPECT_EQ(main_thread_task_runner_.get(), main_thread_task_runner); | 1937 EXPECT_EQ(main_thread_task_runner_.get(), main_thread_task_runner); |
1933 } | 1938 } |
1934 | 1939 |
1935 context()->waitSyncPoint(release_sync_point); | 1940 context()->waitSyncPoint(release_sync_point); |
1936 context()->bindTexture(GL_TEXTURE_2D, texture); | 1941 texture = |
1937 context()->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 1942 context()->createAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
1938 context()->deleteTexture(texture); | 1943 context()->deleteTexture(texture); |
1939 } | 1944 } |
1940 | 1945 |
1941 TEST_P(ResourceProviderTest, LostResourceInParent) { | 1946 TEST_P(ResourceProviderTest, LostResourceInParent) { |
1942 gfx::Size size(1, 1); | 1947 gfx::Size size(1, 1); |
1943 ResourceFormat format = RGBA_8888; | 1948 ResourceFormat format = RGBA_8888; |
1944 ResourceProvider::ResourceId resource = | 1949 ResourceProvider::ResourceId resource = |
1945 child_resource_provider_->CreateResource( | 1950 child_resource_provider_->CreateResource( |
1946 size, | 1951 size, |
1947 GL_CLAMP_TO_EDGE, | 1952 GL_CLAMP_TO_EDGE, |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2237 } | 2242 } |
2238 | 2243 |
2239 TEST_P(ResourceProviderTest, LostContext) { | 2244 TEST_P(ResourceProviderTest, LostContext) { |
2240 // TextureMailbox callbacks only exist for GL textures for now. | 2245 // TextureMailbox callbacks only exist for GL textures for now. |
2241 if (GetParam() != ResourceProvider::GLTexture) | 2246 if (GetParam() != ResourceProvider::GLTexture) |
2242 return; | 2247 return; |
2243 unsigned texture = context()->createTexture(); | 2248 unsigned texture = context()->createTexture(); |
2244 context()->bindTexture(GL_TEXTURE_2D, texture); | 2249 context()->bindTexture(GL_TEXTURE_2D, texture); |
2245 gpu::Mailbox mailbox; | 2250 gpu::Mailbox mailbox; |
2246 context()->genMailboxCHROMIUM(mailbox.name); | 2251 context()->genMailboxCHROMIUM(mailbox.name); |
2247 context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 2252 context()->produceTextureDirectCHROMIUM(texture, GL_TEXTURE_2D, mailbox.name); |
2248 uint32 sync_point = context()->insertSyncPoint(); | 2253 uint32 sync_point = context()->insertSyncPoint(); |
2249 | 2254 |
2250 EXPECT_LT(0u, sync_point); | 2255 EXPECT_LT(0u, sync_point); |
2251 | 2256 |
2252 uint32 release_sync_point = 0; | 2257 uint32 release_sync_point = 0; |
2253 bool lost_resource = false; | 2258 bool lost_resource = false; |
2254 BlockingTaskRunner* main_thread_task_runner = NULL; | 2259 BlockingTaskRunner* main_thread_task_runner = NULL; |
2255 scoped_ptr<SingleReleaseCallbackImpl> callback = | 2260 scoped_ptr<SingleReleaseCallbackImpl> callback = |
2256 SingleReleaseCallbackImpl::Create(base::Bind(ReleaseCallback, | 2261 SingleReleaseCallbackImpl::Create(base::Bind(ReleaseCallback, |
2257 &release_sync_point, | 2262 &release_sync_point, |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2617 | 2622 |
2618 scoped_ptr<ResourceProvider> resource_provider( | 2623 scoped_ptr<ResourceProvider> resource_provider( |
2619 ResourceProvider::Create(output_surface.get(), | 2624 ResourceProvider::Create(output_surface.get(), |
2620 shared_bitmap_manager, | 2625 shared_bitmap_manager, |
2621 gpu_memory_buffer_manager, | 2626 gpu_memory_buffer_manager, |
2622 main_thread_task_runner, | 2627 main_thread_task_runner, |
2623 0, | 2628 0, |
2624 false, | 2629 false, |
2625 1)); | 2630 1)); |
2626 | 2631 |
2627 unsigned texture_id = 1; | |
2628 uint32 sync_point = 30; | 2632 uint32 sync_point = 30; |
2629 unsigned target = GL_TEXTURE_2D; | 2633 unsigned target = GL_TEXTURE_2D; |
2630 | 2634 |
2631 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); | 2635 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
2632 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); | 2636 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); |
2633 EXPECT_CALL(*context, insertSyncPoint()).Times(0); | 2637 EXPECT_CALL(*context, insertSyncPoint()).Times(0); |
2634 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2638 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2635 EXPECT_CALL(*context, consumeTextureCHROMIUM(_, _)).Times(0); | |
2636 | 2639 |
2637 gpu::Mailbox gpu_mailbox; | 2640 gpu::Mailbox gpu_mailbox; |
2638 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); | 2641 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); |
2639 uint32 release_sync_point = 0; | 2642 uint32 release_sync_point = 0; |
2640 bool lost_resource = false; | 2643 bool lost_resource = false; |
2641 BlockingTaskRunner* mailbox_task_runner = NULL; | 2644 BlockingTaskRunner* mailbox_task_runner = NULL; |
2642 scoped_ptr<SingleReleaseCallbackImpl> callback = | 2645 scoped_ptr<SingleReleaseCallbackImpl> callback = |
2643 SingleReleaseCallbackImpl::Create(base::Bind(&ReleaseCallback, | 2646 SingleReleaseCallbackImpl::Create(base::Bind(&ReleaseCallback, |
2644 &release_sync_point, | 2647 &release_sync_point, |
2645 &lost_resource, | 2648 &lost_resource, |
2646 &mailbox_task_runner)); | 2649 &mailbox_task_runner)); |
2647 | 2650 |
2648 TextureMailbox mailbox(gpu_mailbox, target, sync_point); | 2651 TextureMailbox mailbox(gpu_mailbox, target, sync_point); |
2649 mailbox.set_nearest_neighbor(mailbox_nearest_neighbor); | 2652 mailbox.set_nearest_neighbor(mailbox_nearest_neighbor); |
2650 | 2653 |
2651 ResourceProvider::ResourceId id = | 2654 ResourceProvider::ResourceId id = |
2652 resource_provider->CreateResourceFromTextureMailbox(mailbox, | 2655 resource_provider->CreateResourceFromTextureMailbox(mailbox, |
2653 callback.Pass()); | 2656 callback.Pass()); |
2654 EXPECT_NE(0u, id); | 2657 EXPECT_NE(0u, id); |
2655 | 2658 |
2656 Mock::VerifyAndClearExpectations(context); | 2659 Mock::VerifyAndClearExpectations(context); |
2657 | 2660 |
2658 { | 2661 { |
2659 // Mailbox sync point WaitSyncPoint before using the texture. | 2662 // Mailbox sync point WaitSyncPoint before using the texture. |
2660 EXPECT_CALL(*context, waitSyncPoint(sync_point)); | 2663 EXPECT_CALL(*context, waitSyncPoint(sync_point)); |
2661 resource_provider->WaitSyncPointIfNeeded(id); | 2664 resource_provider->WaitSyncPointIfNeeded(id); |
2662 Mock::VerifyAndClearExpectations(context); | 2665 Mock::VerifyAndClearExpectations(context); |
2663 | 2666 |
2664 // Using the texture does a consume of the mailbox. | |
2665 EXPECT_CALL(*context, bindTexture(target, texture_id)).Times(2); | |
2666 EXPECT_CALL(*context, consumeTextureCHROMIUM(target, _)); | |
2667 | |
2668 EXPECT_CALL(*context, insertSyncPoint()).Times(0); | 2667 EXPECT_CALL(*context, insertSyncPoint()).Times(0); |
2669 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2668 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2670 | 2669 |
2671 // The sampler will reset these if |mailbox_nearest_neighbor| does not | 2670 // The sampler will reset these if |mailbox_nearest_neighbor| does not |
2672 // match |sampler_filter|. | 2671 // match |sampler_filter|. |
2673 if (mailbox_nearest_neighbor != (sampler_filter == GL_NEAREST)) { | 2672 if (mailbox_nearest_neighbor != (sampler_filter == GL_NEAREST)) { |
2674 EXPECT_CALL(*context, texParameteri( | 2673 EXPECT_CALL(*context, texParameteri( |
2675 GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, sampler_filter)); | 2674 GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, sampler_filter)); |
2676 EXPECT_CALL(*context, texParameteri( | 2675 EXPECT_CALL(*context, texParameteri( |
2677 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, sampler_filter)); | 2676 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, sampler_filter)); |
2678 } | 2677 } |
2679 | 2678 |
2680 ResourceProvider::ScopedSamplerGL lock( | 2679 ResourceProvider::ScopedSamplerGL lock( |
2681 resource_provider.get(), id, sampler_filter); | 2680 resource_provider.get(), id, sampler_filter); |
2682 Mock::VerifyAndClearExpectations(context); | 2681 Mock::VerifyAndClearExpectations(context); |
2683 | 2682 |
2684 // When done with it, a sync point should be inserted, but no produce is | 2683 // When done with it, a sync point should be inserted, but no produce is |
2685 // necessary. | 2684 // necessary. |
2686 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); | 2685 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
2687 EXPECT_CALL(*context, insertSyncPoint()); | 2686 EXPECT_CALL(*context, insertSyncPoint()); |
2688 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2687 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2689 | 2688 |
2690 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); | 2689 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); |
2691 EXPECT_CALL(*context, consumeTextureCHROMIUM(_, _)).Times(0); | |
2692 } | 2690 } |
2693 | 2691 |
2694 resource_provider->DeleteResource(id); | 2692 resource_provider->DeleteResource(id); |
2695 EXPECT_EQ(0u, release_sync_point); | 2693 EXPECT_EQ(0u, release_sync_point); |
2696 EXPECT_FALSE(lost_resource); | 2694 EXPECT_FALSE(lost_resource); |
2697 EXPECT_EQ(main_thread_task_runner, mailbox_task_runner); | 2695 EXPECT_EQ(main_thread_task_runner, mailbox_task_runner); |
2698 } | 2696 } |
2699 }; | 2697 }; |
2700 | 2698 |
2701 TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D_LinearToLinear) { | 2699 TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D_LinearToLinear) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2766 | 2764 |
2767 scoped_ptr<ResourceProvider> resource_provider( | 2765 scoped_ptr<ResourceProvider> resource_provider( |
2768 ResourceProvider::Create(output_surface.get(), | 2766 ResourceProvider::Create(output_surface.get(), |
2769 shared_bitmap_manager_.get(), | 2767 shared_bitmap_manager_.get(), |
2770 gpu_memory_buffer_manager_.get(), | 2768 gpu_memory_buffer_manager_.get(), |
2771 NULL, | 2769 NULL, |
2772 0, | 2770 0, |
2773 false, | 2771 false, |
2774 1)); | 2772 1)); |
2775 | 2773 |
2776 unsigned texture_id = 1; | |
2777 uint32 sync_point = 30; | 2774 uint32 sync_point = 30; |
2778 unsigned target = GL_TEXTURE_EXTERNAL_OES; | 2775 unsigned target = GL_TEXTURE_EXTERNAL_OES; |
2779 | 2776 |
2780 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); | 2777 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
2781 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); | 2778 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); |
2782 EXPECT_CALL(*context, insertSyncPoint()).Times(0); | 2779 EXPECT_CALL(*context, insertSyncPoint()).Times(0); |
2783 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2780 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2784 EXPECT_CALL(*context, consumeTextureCHROMIUM(_, _)).Times(0); | |
2785 | 2781 |
2786 gpu::Mailbox gpu_mailbox; | 2782 gpu::Mailbox gpu_mailbox; |
2787 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); | 2783 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); |
2788 scoped_ptr<SingleReleaseCallbackImpl> callback = | 2784 scoped_ptr<SingleReleaseCallbackImpl> callback = |
2789 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); | 2785 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); |
2790 | 2786 |
2791 TextureMailbox mailbox(gpu_mailbox, target, sync_point); | 2787 TextureMailbox mailbox(gpu_mailbox, target, sync_point); |
2792 | 2788 |
2793 ResourceProvider::ResourceId id = | 2789 ResourceProvider::ResourceId id = |
2794 resource_provider->CreateResourceFromTextureMailbox( | 2790 resource_provider->CreateResourceFromTextureMailbox( |
2795 mailbox, callback.Pass()); | 2791 mailbox, callback.Pass()); |
2796 EXPECT_NE(0u, id); | 2792 EXPECT_NE(0u, id); |
2797 | 2793 |
2798 Mock::VerifyAndClearExpectations(context); | 2794 Mock::VerifyAndClearExpectations(context); |
2799 | 2795 |
2800 { | 2796 { |
2801 // Mailbox sync point WaitSyncPoint before using the texture. | 2797 // Mailbox sync point WaitSyncPoint before using the texture. |
2802 EXPECT_CALL(*context, waitSyncPoint(sync_point)); | 2798 EXPECT_CALL(*context, waitSyncPoint(sync_point)); |
2803 resource_provider->WaitSyncPointIfNeeded(id); | 2799 resource_provider->WaitSyncPointIfNeeded(id); |
2804 Mock::VerifyAndClearExpectations(context); | 2800 Mock::VerifyAndClearExpectations(context); |
2805 | 2801 |
2806 // Using the texture does a consume of the mailbox. | |
2807 EXPECT_CALL(*context, bindTexture(target, texture_id)); | |
2808 EXPECT_CALL(*context, consumeTextureCHROMIUM(target, _)); | |
2809 | |
2810 EXPECT_CALL(*context, insertSyncPoint()).Times(0); | 2802 EXPECT_CALL(*context, insertSyncPoint()).Times(0); |
2811 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2803 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2812 | 2804 |
2813 ResourceProvider::ScopedReadLockGL lock(resource_provider.get(), id); | 2805 ResourceProvider::ScopedReadLockGL lock(resource_provider.get(), id); |
2814 Mock::VerifyAndClearExpectations(context); | 2806 Mock::VerifyAndClearExpectations(context); |
2815 | 2807 |
2816 // When done with it, a sync point should be inserted, but no produce is | 2808 // When done with it, a sync point should be inserted, but no produce is |
2817 // necessary. | 2809 // necessary. |
2818 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); | 2810 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
2819 EXPECT_CALL(*context, insertSyncPoint()); | 2811 EXPECT_CALL(*context, insertSyncPoint()); |
2820 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2812 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2821 | 2813 |
2822 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); | 2814 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); |
2823 EXPECT_CALL(*context, consumeTextureCHROMIUM(_, _)).Times(0); | |
2824 } | 2815 } |
2825 } | 2816 } |
2826 | 2817 |
2827 TEST_P(ResourceProviderTest, | 2818 TEST_P(ResourceProviderTest, |
2828 TextureMailbox_WaitSyncPointIfNeeded_WithSyncPoint) { | 2819 TextureMailbox_WaitSyncPointIfNeeded_WithSyncPoint) { |
2829 // Mailboxing is only supported for GL textures. | 2820 // Mailboxing is only supported for GL textures. |
2830 if (GetParam() != ResourceProvider::GLTexture) | 2821 if (GetParam() != ResourceProvider::GLTexture) |
2831 return; | 2822 return; |
2832 | 2823 |
2833 scoped_ptr<TextureStateTrackingContext> context_owned( | 2824 scoped_ptr<TextureStateTrackingContext> context_owned( |
(...skipping 13 matching lines...) Expand all Loading... | |
2847 0, | 2838 0, |
2848 false, | 2839 false, |
2849 1)); | 2840 1)); |
2850 | 2841 |
2851 uint32 sync_point = 30; | 2842 uint32 sync_point = 30; |
2852 unsigned target = GL_TEXTURE_2D; | 2843 unsigned target = GL_TEXTURE_2D; |
2853 | 2844 |
2854 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); | 2845 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
2855 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); | 2846 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); |
2856 EXPECT_CALL(*context, insertSyncPoint()).Times(0); | 2847 EXPECT_CALL(*context, insertSyncPoint()).Times(0); |
2857 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2848 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2858 EXPECT_CALL(*context, consumeTextureCHROMIUM(_, _)).Times(0); | |
2859 | 2849 |
2860 gpu::Mailbox gpu_mailbox; | 2850 gpu::Mailbox gpu_mailbox; |
2861 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); | 2851 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); |
2862 scoped_ptr<SingleReleaseCallbackImpl> callback = | 2852 scoped_ptr<SingleReleaseCallbackImpl> callback = |
2863 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); | 2853 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); |
2864 | 2854 |
2865 TextureMailbox mailbox(gpu_mailbox, target, sync_point); | 2855 TextureMailbox mailbox(gpu_mailbox, target, sync_point); |
2866 | 2856 |
2867 ResourceProvider::ResourceId id = | 2857 ResourceProvider::ResourceId id = |
2868 resource_provider->CreateResourceFromTextureMailbox(mailbox, | 2858 resource_provider->CreateResourceFromTextureMailbox(mailbox, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2906 0, | 2896 0, |
2907 false, | 2897 false, |
2908 1)); | 2898 1)); |
2909 | 2899 |
2910 uint32 sync_point = 0; | 2900 uint32 sync_point = 0; |
2911 unsigned target = GL_TEXTURE_2D; | 2901 unsigned target = GL_TEXTURE_2D; |
2912 | 2902 |
2913 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); | 2903 EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
2914 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); | 2904 EXPECT_CALL(*context, waitSyncPoint(_)).Times(0); |
2915 EXPECT_CALL(*context, insertSyncPoint()).Times(0); | 2905 EXPECT_CALL(*context, insertSyncPoint()).Times(0); |
2916 EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0); | 2906 EXPECT_CALL(*context, produceTextureDirectCHROMIUM(_, _, _)).Times(0); |
2917 EXPECT_CALL(*context, consumeTextureCHROMIUM(_, _)).Times(0); | |
2918 | 2907 |
2919 gpu::Mailbox gpu_mailbox; | 2908 gpu::Mailbox gpu_mailbox; |
2920 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); | 2909 memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1); |
2921 scoped_ptr<SingleReleaseCallbackImpl> callback = | 2910 scoped_ptr<SingleReleaseCallbackImpl> callback = |
2922 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); | 2911 SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback)); |
2923 | 2912 |
2924 TextureMailbox mailbox(gpu_mailbox, target, sync_point); | 2913 TextureMailbox mailbox(gpu_mailbox, target, sync_point); |
2925 | 2914 |
2926 ResourceProvider::ResourceId id = | 2915 ResourceProvider::ResourceId id = |
2927 resource_provider->CreateResourceFromTextureMailbox(mailbox, | 2916 resource_provider->CreateResourceFromTextureMailbox(mailbox, |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3705 resource_provider->AllocateForTesting(id); | 3694 resource_provider->AllocateForTesting(id); |
3706 Mock::VerifyAndClearExpectations(context); | 3695 Mock::VerifyAndClearExpectations(context); |
3707 | 3696 |
3708 DCHECK_EQ(10u, context->PeekTextureId()); | 3697 DCHECK_EQ(10u, context->PeekTextureId()); |
3709 resource_provider->DeleteResource(id); | 3698 resource_provider->DeleteResource(id); |
3710 } | 3699 } |
3711 } | 3700 } |
3712 | 3701 |
3713 } // namespace | 3702 } // namespace |
3714 } // namespace cc | 3703 } // namespace cc |
OLD | NEW |