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

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

Issue 12210129: gpu: Add the ability to wait on upload completion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added entry point for waiting. Rebased and added test. Created 7 years, 10 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/gles2_cmd_decoder_unittest.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 7aa4428bf47258042027fb338a9f7b2b42059bfa..f3aa5d95e54e15494b9878374eea6bdd53eefd3e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -7977,6 +7977,8 @@ TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) {
AsyncTexSubImage2DCHROMIUM texsubimage_cmd;
texsubimage_cmd.Init(GL_TEXTURE_2D, 0, 0, 0, 8, 8, GL_RGBA,
GL_UNSIGNED_BYTE, kSharedMemoryId, kSharedMemoryOffset);
+ WaitAsyncTexImage2DCHROMIUM wait_cmd;
+ wait_cmd.Init(GL_TEXTURE_2D);
gfx::AsyncTexImage2DParams teximage_params =
{GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE};
@@ -8083,6 +8085,14 @@ TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) {
EXPECT_TRUE(info->SafeToRenderFrom());
}
+ // WaitAsyncTexSubImage2D
+ {
+ // Command succeeds.
+ EXPECT_CALL(*delegate, WaitOnUploadCompletion());
+ EXPECT_EQ(error::kNoError, ExecuteCmd(wait_cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ }
+
decoder_->SetAsyncPixelTransferDelegate(NULL);
info->SetAsyncTransferState(scoped_ptr<gfx::AsyncPixelTransferState>());
}

Powered by Google App Engine
This is Rietveld 408576698