Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1852)

Unified Diff: gpu/command_buffer/service/mailbox_manager_unittest.cc

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/mailbox_manager_unittest.cc
diff --git a/gpu/command_buffer/service/mailbox_manager_unittest.cc b/gpu/command_buffer/service/mailbox_manager_unittest.cc
index 3e14b76dc71827c975316e914cea350bc69b2f7d..2c43e99b2b301159bdb990a62152de6a69c73dd2 100644
--- a/gpu/command_buffer/service/mailbox_manager_unittest.cc
+++ b/gpu/command_buffer/service/mailbox_manager_unittest.cc
@@ -279,8 +279,8 @@ TEST_F(MailboxManagerSyncTest, ProduceSyncDestroy) {
EXPECT_EQ(texture, manager_->ConsumeTexture(name));
// Synchronize
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
DestroyTexture(texture);
EXPECT_EQ(NULL, manager_->ConsumeTexture(name));
@@ -294,7 +294,7 @@ TEST_F(MailboxManagerSyncTest, ProduceSyncClobberDestroy) {
Mailbox name = Mailbox::Generate();
manager_->ProduceTexture(name, texture);
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
// Clobber
Texture* old_texture = texture;
@@ -320,8 +320,8 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
EXPECT_EQ(texture, manager_->ConsumeTexture(name));
// Synchronize
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgPointee<1>(kNewTextureId));
@@ -339,10 +339,10 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
EXPECT_TRUE(texture->GetLevelImage(GL_TEXTURE_2D, 0) == NULL);
// Synchronize again
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
SetupUpdateTexParamExpectations(
kNewTextureId, GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT);
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
GLsizei width, height;
new_texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr);
EXPECT_EQ(16, width);
@@ -363,7 +363,7 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeResize) {
// The last change to the texture should be visible without a sync point (i.e.
// push).
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
new_texture->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height, nullptr);
EXPECT_EQ(64, width);
EXPECT_EQ(64, height);
@@ -391,8 +391,8 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeBidirectional) {
manager2_->ProduceTexture(name2, texture2);
// Make visible.
- manager_->PushTextureUpdates(0);
- manager2_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PushTextureUpdates(0, 0, 0);
// Create textures in the other manager instances for texture1 and texture2,
// respectively to create a real sharing scenario. Otherwise, there would
@@ -419,7 +419,7 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeBidirectional) {
SetParameter(texture1, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
// Make sure this does not clobber it with the previous version we pushed.
- manager_->PullTextureUpdates(0);
+ manager_->PullTextureUpdates(0, 0, 0);
// Make a change to texture2
DCHECK_EQ(static_cast<GLuint>(GL_LINEAR), texture2->mag_filter());
@@ -429,16 +429,16 @@ TEST_F(MailboxManagerSyncTest, ProduceConsumeBidirectional) {
Mock::VerifyAndClearExpectations(gl_.get());
// Synchronize in both directions
- manager_->PushTextureUpdates(0);
- manager2_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PushTextureUpdates(0, 0, 0);
// manager1 should see the change to texture2 mag_filter being applied.
SetupUpdateTexParamExpectations(
new_texture2->service_id(), GL_LINEAR, GL_NEAREST, GL_REPEAT, GL_REPEAT);
- manager_->PullTextureUpdates(0);
+ manager_->PullTextureUpdates(0, 0, 0);
// manager2 should see the change to texture1 min_filter being applied.
SetupUpdateTexParamExpectations(
new_texture1->service_id(), GL_NEAREST, GL_LINEAR, GL_REPEAT, GL_REPEAT);
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
DestroyTexture(texture1);
DestroyTexture(texture2);
@@ -460,8 +460,8 @@ TEST_F(MailboxManagerSyncTest, ProduceAndClobber) {
EXPECT_EQ(texture, manager_->ConsumeTexture(name));
// Synchronize
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgPointee<1>(kNewTextureId));
@@ -482,8 +482,8 @@ TEST_F(MailboxManagerSyncTest, ProduceAndClobber) {
SetParameter(texture, GL_TEXTURE_MIN_FILTER, GL_NEAREST));
// Synchronize in both directions - no changes, since it's not shared
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
EXPECT_EQ(static_cast<GLuint>(GL_LINEAR), new_texture->min_filter());
// Make a change to the previously shared texture
@@ -492,10 +492,10 @@ TEST_F(MailboxManagerSyncTest, ProduceAndClobber) {
SetParameter(old_texture, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
// Synchronize and expect update
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
SetupUpdateTexParamExpectations(
new_texture->service_id(), GL_LINEAR, GL_NEAREST, GL_REPEAT, GL_REPEAT);
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgPointee<1>(kNewTextureId));
@@ -525,8 +525,8 @@ TEST_F(MailboxManagerSyncTest, ClearedStateSynced) {
EXPECT_EQ(texture, manager_->ConsumeTexture(name));
// Synchronize
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgPointee<1>(kNewTextureId));
@@ -543,10 +543,10 @@ TEST_F(MailboxManagerSyncTest, ClearedStateSynced) {
EXPECT_FALSE(texture->SafeToRenderFrom());
// Synchronize
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
SetupUpdateTexParamExpectations(
kNewTextureId, GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT);
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
// Cleared state should be synced.
EXPECT_FALSE(new_texture->SafeToRenderFrom());
@@ -571,8 +571,8 @@ TEST_F(MailboxManagerSyncTest, SyncIncompleteTexture) {
EXPECT_EQ(texture, manager_->ConsumeTexture(name));
// Synchronize
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
// Should sync to new texture which is not defined.
EXPECT_CALL(*gl_, GenTextures(1, _))
@@ -594,10 +594,10 @@ TEST_F(MailboxManagerSyncTest, SyncIncompleteTexture) {
EXPECT_TRUE(texture->IsDefined());
// Synchronize
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
SetupUpdateTexParamExpectations(
kNewTextureId, GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT);
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
// Cleared state should be synced.
EXPECT_TRUE(new_texture->IsDefined());
@@ -622,10 +622,10 @@ TEST_F(MailboxManagerSyncTest, SharedThroughMultipleMailboxes) {
manager_->ProduceTexture(name1, texture);
// Share
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgPointee<1>(kNewTextureId));
- manager2_->PullTextureUpdates(0);
+ manager2_->PullTextureUpdates(0, 0, 0);
SetupUpdateTexParamExpectations(
kNewTextureId, GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT);
Texture* new_texture = manager2_->ConsumeTexture(name1);
@@ -634,8 +634,8 @@ TEST_F(MailboxManagerSyncTest, SharedThroughMultipleMailboxes) {
manager_->ProduceTexture(name2, texture);
// Synchronize
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
// name2 should return the same texture
EXPECT_EQ(new_texture, manager2_->ConsumeTexture(name2));
@@ -661,7 +661,7 @@ TEST_F(MailboxManagerSyncTest, ProduceBothWays) {
manager_->ProduceTexture(name, texture1);
// Share
- manager_->PushTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgPointee<1>(kNewTextureId));
SetupUpdateTexParamExpectations(
@@ -674,8 +674,8 @@ TEST_F(MailboxManagerSyncTest, ProduceBothWays) {
manager_->ProduceTexture(name, texture1);
// Synchronize manager -> manager2
- manager_->PushTextureUpdates(0);
- manager2_->PullTextureUpdates(0);
+ manager_->PushTextureUpdates(0, 0, 0);
+ manager2_->PullTextureUpdates(0, 0, 0);
// name should return the original texture, and not texture2 or a new one.
EXPECT_EQ(new_texture, manager2_->ConsumeTexture(name));

Powered by Google App Engine
This is Rietveld 408576698