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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 7260008: Implement proper synchronization between HW video decode IPC and CommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index a6b378e362b2380ab51913ba7a360f4a2f076ce9..0060831b811d904a93922317117547ae731d1a48 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -5,6 +5,7 @@
#if defined(ENABLE_GPU)
#include "base/bind.h"
+#include "base/callback.h"
#include "base/debug/trace_event.h"
#include "base/process_util.h"
#include "base/shared_memory.h"
@@ -152,6 +153,8 @@ void GpuCommandBufferStub::OnInitialize(
&GpuChannel::OnLatchCallback, base::Unretained(channel_), route_id_));
scheduler_->SetScheduledCallback(
NewCallback(this, &GpuCommandBufferStub::OnScheduled));
+ scheduler_->SetTokenCallback(base::Bind(
+ &GpuCommandBufferStub::OnSetToken, base::Unretained(this)));
if (watchdog_)
scheduler_->SetCommandProcessedCallback(
NewCallback(this, &GpuCommandBufferStub::OnCommandProcessed));
@@ -488,6 +491,16 @@ void GpuCommandBufferStub::CommandBufferWasDestroyed() {
HandleDeferredMessages();
}
+void GpuCommandBufferStub::AddSetTokenCallback(
+ const base::Callback<void(int32)>& callback) {
+ set_token_callbacks_.push_back(callback);
+}
+
+void GpuCommandBufferStub::OnSetToken(int32 token) {
+ for (size_t i = 0; i < set_token_callbacks_.size(); ++i)
+ set_token_callbacks_[i].Run(token);
piman 2011/06/28 01:19:22 Can the callback remove itself ? See later comment
Ami GONE FROM CHROMIUM 2011/06/28 21:00:53 See later comment for why I don't think we need th
+}
+
void GpuCommandBufferStub::ResizeCallback(gfx::Size size) {
if (handle_ == gfx::kNullPluginWindow) {
scheduler_->decoder()->ResizeOffscreenFrameBuffer(size);

Powered by Google App Engine
This is Rietveld 408576698