summaryrefslogtreecommitdiffstats
path: root/content/common/cc_messages_unittest.cc
diff options
context:
space:
mode:
authorsheu@chromium.org <sheu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-03 23:39:50 +0000
committersheu@chromium.org <sheu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-03 23:39:50 +0000
commitdf41e253e6918cd035c36936761734f2ac694466 (patch)
tree9f92ab76398898bbd0f880d821e39a433018526c /content/common/cc_messages_unittest.cc
parent3a48972e78af233d570818d21f426afa8c51c2ff (diff)
downloadchromium_src-df41e253e6918cd035c36936761734f2ac694466.zip
chromium_src-df41e253e6918cd035c36936761734f2ac694466.tar.gz
chromium_src-df41e253e6918cd035c36936761734f2ac694466.tar.bz2
Add gpu::MailboxHolder to hold state for a gpu::Mailbox
gpu::Mailbox by itself can hold only a texture id, but in common usage it comes with texture target and syncpoint information for cross-context sharing. To reduce repetition of this pattern, gpu::MailboxHolder holds: * a gpu::Mailbox * a GL texture target * a syncpoint index Refactor other classes to use a gpu::MailboxHolder instead of separate gpu::Mailbox and associated state. Syncpoints are created with uint32 indices; make sure all uses of syncpoints use the appropriate type. BUG=None TEST=local build, unittests on CrOS snow, desktop Linux TBR=piman@chromium.org, enn@chromium.orge, cevans@chromium.org, scherkus@chromium.org Review URL: https://codereview.chromium.org/132233041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/cc_messages_unittest.cc')
-rw-r--r--content/common/cc_messages_unittest.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/content/common/cc_messages_unittest.cc b/content/common/cc_messages_unittest.cc
index eaa5a58..11b9ea2 100644
--- a/content/common/cc_messages_unittest.cc
+++ b/content/common/cc_messages_unittest.cc
@@ -198,13 +198,15 @@ class CCMessagesTest : public testing::Test {
void Compare(const TransferableResource& a, const TransferableResource& b) {
EXPECT_EQ(a.id, b.id);
- EXPECT_EQ(a.sync_point, b.sync_point);
EXPECT_EQ(a.format, b.format);
- EXPECT_EQ(a.target, b.target);
EXPECT_EQ(a.filter, b.filter);
EXPECT_EQ(a.size.ToString(), b.size.ToString());
- for (size_t i = 0; i < arraysize(a.mailbox.name); ++i)
- EXPECT_EQ(a.mailbox.name[i], b.mailbox.name[i]);
+ for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) {
+ EXPECT_EQ(a.mailbox_holder.mailbox.name[i],
+ b.mailbox_holder.mailbox.name[i]);
+ }
+ EXPECT_EQ(a.mailbox_holder.texture_target, b.mailbox_holder.texture_target);
+ EXPECT_EQ(a.mailbox_holder.sync_point, b.mailbox_holder.sync_point);
}
};
@@ -655,21 +657,21 @@ TEST_F(CCMessagesTest, Resources) {
TransferableResource arbitrary_resource1;
arbitrary_resource1.id = 2178312;
- arbitrary_resource1.sync_point = arbitrary_uint1;
arbitrary_resource1.format = cc::RGBA_8888;
- arbitrary_resource1.target = GL_TEXTURE_2D;
arbitrary_resource1.filter = 53;
arbitrary_resource1.size = gfx::Size(37189, 123123);
- arbitrary_resource1.mailbox.SetName(arbitrary_mailbox1);
+ arbitrary_resource1.mailbox_holder.mailbox.SetName(arbitrary_mailbox1);
+ arbitrary_resource1.mailbox_holder.texture_target = GL_TEXTURE_2D;
+ arbitrary_resource1.mailbox_holder.sync_point = arbitrary_uint1;
TransferableResource arbitrary_resource2;
arbitrary_resource2.id = 789132;
- arbitrary_resource2.sync_point = arbitrary_uint2;
arbitrary_resource2.format = cc::RGBA_4444;
- arbitrary_resource2.target = GL_TEXTURE_EXTERNAL_OES;
arbitrary_resource2.filter = 47;
arbitrary_resource2.size = gfx::Size(89123, 23789);
- arbitrary_resource2.mailbox.SetName(arbitrary_mailbox2);
+ arbitrary_resource2.mailbox_holder.mailbox.SetName(arbitrary_mailbox2);
+ arbitrary_resource2.mailbox_holder.texture_target = GL_TEXTURE_EXTERNAL_OES;
+ arbitrary_resource2.mailbox_holder.sync_point = arbitrary_uint2;
scoped_ptr<RenderPass> renderpass_in = RenderPass::Create();
renderpass_in->SetNew(