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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unset texture and texture_ref after deleting Created 6 years, 9 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/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,

Powered by Google App Engine
This is Rietveld 408576698