Index: gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc |
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc |
index 58748ddb6e28beee3129d93db4643bf3654b5b1c..40ec87f689688e6b5941bc18dc3d704af000f480 100644 |
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc |
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc |
@@ -89,6 +89,7 @@ void AsyncPixelTransferDelegateIdle::AsyncTexImage2D( |
shared_state_->tasks.push_back(AsyncPixelTransferManagerIdle::Task( |
id_, |
+ this, |
base::Bind(&AsyncPixelTransferDelegateIdle::PerformAsyncTexImage2D, |
AsWeakPtr(), |
tex_params, |
@@ -106,6 +107,7 @@ void AsyncPixelTransferDelegateIdle::AsyncTexSubImage2D( |
shared_state_->tasks.push_back(AsyncPixelTransferManagerIdle::Task( |
id_, |
+ this, |
base::Bind(&AsyncPixelTransferDelegateIdle::PerformAsyncTexSubImage2D, |
AsWeakPtr(), |
tex_params, |
@@ -224,8 +226,11 @@ void AsyncPixelTransferDelegateIdle::PerformAsyncTexSubImage2D( |
} |
AsyncPixelTransferManagerIdle::Task::Task( |
- uint64 transfer_id, const base::Closure& task) |
+ uint64 transfer_id, |
+ AsyncPixelTransferDelegate* delegate, |
+ const base::Closure& task) |
: transfer_id(transfer_id), |
+ delegate(delegate), |
task(task) { |
} |
@@ -267,6 +272,7 @@ void AsyncPixelTransferManagerIdle::AsyncNotifyCompletion( |
shared_state_.tasks.push_back( |
Task(0, // 0 transfer_id for notification tasks. |
+ NULL, |
base::Bind( |
&PerformNotifyCompletion, |
mem_params, |
@@ -297,6 +303,15 @@ bool AsyncPixelTransferManagerIdle::NeedsProcessMorePendingTransfers() { |
return !shared_state_.tasks.empty(); |
} |
+void AsyncPixelTransferManagerIdle::WaitAllAsyncTexImage2D() { |
+ if (shared_state_.tasks.empty()) |
+ return; |
+ |
+ const Task& task = shared_state_.tasks.back(); |
+ if (task.delegate) |
+ task.delegate->WaitForTransferCompletion(); |
+} |
+ |
AsyncPixelTransferDelegate* |
AsyncPixelTransferManagerIdle::CreatePixelTransferDelegateImpl( |
gles2::TextureRef* ref, |