| Index: cc/layers/texture_layer_unittest.cc
|
| diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
|
| index 88ff0409615523770fd3c0d49ae6b1b513de8f4b..cfbe8133fbf51cd445a1397fd2dde1b0a19434a8 100644
|
| --- a/cc/layers/texture_layer_unittest.cc
|
| +++ b/cc/layers/texture_layer_unittest.cc
|
| @@ -41,9 +41,9 @@
|
| namespace cc {
|
| namespace {
|
|
|
| -gpu::Mailbox MailboxFromChar(char value) {
|
| +gpu::Mailbox MailboxFromString(const std::string& string) {
|
| gpu::Mailbox mailbox;
|
| - memset(mailbox.name, value, sizeof(mailbox.name));
|
| + mailbox.SetName(reinterpret_cast<const int8*>(string.data()));
|
| return mailbox;
|
| }
|
|
|
| @@ -322,7 +322,7 @@
|
| class MockMailboxCallback {
|
| public:
|
| MOCK_METHOD3(Release,
|
| - void(const gpu::Mailbox& mailbox,
|
| + void(const std::string& mailbox,
|
| uint32 sync_point,
|
| bool lost_resource));
|
| MOCK_METHOD3(Release2,
|
| @@ -333,8 +333,8 @@
|
|
|
| struct CommonMailboxObjects {
|
| CommonMailboxObjects()
|
| - : mailbox_name1_(MailboxFromChar('1')),
|
| - mailbox_name2_(MailboxFromChar('2')),
|
| + : mailbox_name1_(64, '1'),
|
| + mailbox_name2_(64, '2'),
|
| sync_point1_(1),
|
| sync_point2_(2),
|
| shared_memory_(new base::SharedMemory) {
|
| @@ -346,8 +346,10 @@
|
| mailbox_name2_);
|
| const uint32 arbitrary_target1 = 1;
|
| const uint32 arbitrary_target2 = 2;
|
| - mailbox1_ = TextureMailbox(mailbox_name1_, arbitrary_target1, sync_point1_);
|
| - mailbox2_ = TextureMailbox(mailbox_name2_, arbitrary_target2, sync_point2_);
|
| + mailbox1_ = TextureMailbox(
|
| + MailboxFromString(mailbox_name1_), arbitrary_target1, sync_point1_);
|
| + mailbox2_ = TextureMailbox(
|
| + MailboxFromString(mailbox_name2_), arbitrary_target2, sync_point2_);
|
| gfx::Size size(128, 128);
|
| EXPECT_TRUE(shared_memory_->CreateAndMapAnonymous(4 * size.GetArea()));
|
| release_mailbox3_ = base::Bind(&MockMailboxCallback::Release2,
|
| @@ -356,8 +358,8 @@
|
| mailbox3_ = TextureMailbox(shared_memory_.get(), size);
|
| }
|
|
|
| - gpu::Mailbox mailbox_name1_;
|
| - gpu::Mailbox mailbox_name2_;
|
| + std::string mailbox_name1_;
|
| + std::string mailbox_name2_;
|
| MockMailboxCallback mock_callback_;
|
| ReleaseCallback release_mailbox1_;
|
| ReleaseCallback release_mailbox2_;
|
| @@ -772,7 +774,8 @@
|
| &TextureLayerImplWithMailboxThreadedCallback::ReleaseCallback,
|
| base::Unretained(this)));
|
| layer_->SetTextureMailbox(
|
| - TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
|
| + TextureMailbox(
|
| + MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
|
| callback.Pass());
|
| }
|
|
|
| @@ -990,7 +993,8 @@
|
| base::Bind(
|
| &TextureLayerMailboxIsActivatedDuringCommit::ReleaseCallback));
|
| layer_->SetTextureMailbox(
|
| - TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
|
| + TextureMailbox(
|
| + MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
|
| callback.Pass());
|
| }
|
|
|
| @@ -1636,7 +1640,8 @@
|
| return true;
|
| }
|
|
|
| - *texture_mailbox = TextureMailbox(MailboxFromChar('1'), GL_TEXTURE_2D, 0);
|
| + *texture_mailbox = TextureMailbox(
|
| + MailboxFromString(std::string(64, '1')), GL_TEXTURE_2D, 0);
|
| *release_callback = SingleReleaseCallback::Create(
|
| base::Bind(&TextureLayerNoExtraCommitForMailboxTest::MailboxReleased,
|
| base::Unretained(this)));
|
| @@ -1747,7 +1752,8 @@
|
| }
|
|
|
| TextureMailbox MakeMailbox(char name) {
|
| - return TextureMailbox(MailboxFromChar(name), GL_TEXTURE_2D, 0);
|
| + return TextureMailbox(
|
| + MailboxFromString(std::string(64, name)), GL_TEXTURE_2D, 0);
|
| }
|
|
|
| void MailboxReleased(uint32 sync_point, bool lost_resource) {
|
| @@ -1880,7 +1886,8 @@
|
| TextureMailbox* mailbox,
|
| scoped_ptr<SingleReleaseCallback>* release_callback,
|
| bool use_shared_memory) OVERRIDE {
|
| - *mailbox = TextureMailbox(MailboxFromChar('1'), GL_TEXTURE_2D, 0);
|
| + *mailbox = TextureMailbox(
|
| + MailboxFromString(std::string(64, '1')), GL_TEXTURE_2D, 0);
|
| *release_callback = SingleReleaseCallback::Create(
|
| base::Bind(&TextureLayerReleaseResourcesBase::MailboxReleased,
|
| base::Unretained(this)));
|
| @@ -2036,7 +2043,8 @@
|
| &TextureLayerWithMailboxMainThreadDeleted::ReleaseCallback,
|
| base::Unretained(this)));
|
| layer_->SetTextureMailbox(
|
| - TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
|
| + TextureMailbox(
|
| + MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
|
| callback.Pass());
|
| }
|
|
|
| @@ -2109,7 +2117,8 @@
|
| &TextureLayerWithMailboxImplThreadDeleted::ReleaseCallback,
|
| base::Unretained(this)));
|
| layer_->SetTextureMailbox(
|
| - TextureMailbox(MailboxFromChar(mailbox_char), GL_TEXTURE_2D, 0),
|
| + TextureMailbox(
|
| + MailboxFromString(std::string(64, mailbox_char)), GL_TEXTURE_2D, 0),
|
| callback.Pass());
|
| }
|
|
|
|
|