summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/command_buffer_proxy.cc5
-rw-r--r--chrome/renderer/command_buffer_proxy.h1
-rw-r--r--gpu/command_buffer/common/command_buffer.h14
-rw-r--r--gpu/command_buffer/common/command_buffer_mock.h1
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc10
-rw-r--r--gpu/command_buffer/service/command_buffer_service.h13
-rw-r--r--gpu/command_buffer/service/gpu_processor.h1
-rw-r--r--webkit/tools/pepper_test_plugin/command_buffer_pepper.cc7
-rw-r--r--webkit/tools/pepper_test_plugin/command_buffer_pepper.h1
9 files changed, 20 insertions, 33 deletions
diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc
index 3b68cc2..5b97e3c 100644
--- a/chrome/renderer/command_buffer_proxy.cc
+++ b/chrome/renderer/command_buffer_proxy.cc
@@ -107,11 +107,6 @@ int32 CommandBufferProxy::GetPutOffset() {
return -1;
}
-void CommandBufferProxy::SetPutOffsetChangeCallback(Callback0::Type* callback) {
- // Not implemented in proxy.
- NOTREACHED();
-}
-
int32 CommandBufferProxy::CreateTransferBuffer(size_t size) {
int32 id;
if (Send(new CommandBufferMsg_CreateTransferBuffer(route_id_, size, &id)))
diff --git a/chrome/renderer/command_buffer_proxy.h b/chrome/renderer/command_buffer_proxy.h
index 7453988..0be704a 100644
--- a/chrome/renderer/command_buffer_proxy.h
+++ b/chrome/renderer/command_buffer_proxy.h
@@ -40,7 +40,6 @@ class CommandBufferProxy : public gpu::CommandBuffer,
virtual int32 GetGetOffset();
virtual void SetGetOffset(int32 get_offset);
virtual int32 GetPutOffset();
- virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
virtual int32 CreateTransferBuffer(size_t size);
virtual void DestroyTransferBuffer(int32 id);
virtual gpu::Buffer GetTransferBuffer(int32 handle);
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h
index 0f1f0f3..7126e53 100644
--- a/gpu/command_buffer/common/command_buffer.h
+++ b/gpu/command_buffer/common/command_buffer.h
@@ -5,7 +5,7 @@
#ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
#define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
-#include "base/task.h"
+#include "base/basictypes.h"
#include "gpu/command_buffer/common/buffer.h"
namespace gpu {
@@ -42,18 +42,6 @@ class CommandBuffer {
// Returns the current put offset. This can be called from any thread.
virtual int32 GetPutOffset() = 0;
- // Sets a callback that should be posted on another thread whenever the put
- // offset is changed. The callback must not return until some progress has
- // been made (unless the command buffer is empty), i.e. the
- // get offset must have changed. It need not process the entire command
- // buffer though. This allows concurrency between the writer and the reader
- // while giving the writer a means of waiting for the reader to make some
- // progress before attempting to write more to the command buffer. Avoiding
- // the use of a synchronization primitive like a condition variable to
- // synchronize reader and writer reduces the risk of deadlock.
- // Takes ownership of callback. The callback is invoked on the plugin thread.
- virtual void SetPutOffsetChangeCallback(Callback0::Type* callback) = 0;
-
// Create a transfer buffer and return a handle that uniquely
// identifies it or -1 on error.
virtual int32 CreateTransferBuffer(size_t size) = 0;
diff --git a/gpu/command_buffer/common/command_buffer_mock.h b/gpu/command_buffer/common/command_buffer_mock.h
index 0048ac1..6295c85 100644
--- a/gpu/command_buffer/common/command_buffer_mock.h
+++ b/gpu/command_buffer/common/command_buffer_mock.h
@@ -28,7 +28,6 @@ class MockCommandBuffer : public CommandBuffer {
MOCK_METHOD0(GetGetOffset, int32());
MOCK_METHOD1(SetGetOffset, void(int32 get_offset));
MOCK_METHOD0(GetPutOffset, int32());
- MOCK_METHOD1(SetPutOffsetChangeCallback, void(Callback0::Type* callback));
MOCK_METHOD1(CreateTransferBuffer, int32(size_t size));
MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle));
MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle));
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 17e7a61..f0a96e1 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -84,11 +84,6 @@ int32 CommandBufferService::GetPutOffset() {
return put_offset_;
}
-void CommandBufferService::SetPutOffsetChangeCallback(
- Callback0::Type* callback) {
- put_offset_change_callback_.reset(callback);
-}
-
int32 CommandBufferService::CreateTransferBuffer(size_t size) {
linked_ptr<SharedMemory> buffer(new SharedMemory);
if (!buffer->Create(std::wstring(), false, false, size))
@@ -183,4 +178,9 @@ void CommandBufferService::RaiseErrorStatus() {
error_status_ = true;
}
+void CommandBufferService::SetPutOffsetChangeCallback(
+ Callback0::Type* callback) {
+ put_offset_change_callback_.reset(callback);
+}
+
} // namespace gpu
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index 18860ea..aec7c14 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -31,7 +31,6 @@ class CommandBufferService : public CommandBuffer {
virtual int32 GetGetOffset();
virtual void SetGetOffset(int32 get_offset);
virtual int32 GetPutOffset();
- virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
virtual int32 CreateTransferBuffer(size_t size);
virtual void DestroyTransferBuffer(int32 id);
virtual Buffer GetTransferBuffer(int32 handle);
@@ -42,6 +41,18 @@ class CommandBufferService : public CommandBuffer {
virtual bool GetErrorStatus();
virtual void RaiseErrorStatus();
+ // Sets a callback that should be posted on another thread whenever the put
+ // offset is changed. The callback must not return until some progress has
+ // been made (unless the command buffer is empty), i.e. the
+ // get offset must have changed. It need not process the entire command
+ // buffer though. This allows concurrency between the writer and the reader
+ // while giving the writer a means of waiting for the reader to make some
+ // progress before attempting to write more to the command buffer. Avoiding
+ // the use of a synchronization primitive like a condition variable to
+ // synchronize reader and writer reduces the risk of deadlock.
+ // Takes ownership of callback. The callback is invoked on the plugin thread.
+ virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
+
private:
scoped_ptr< base::SharedMemory> ring_buffer_;
int32 size_;
diff --git a/gpu/command_buffer/service/gpu_processor.h b/gpu/command_buffer/service/gpu_processor.h
index 41325fa..6bcf317 100644
--- a/gpu/command_buffer/service/gpu_processor.h
+++ b/gpu/command_buffer/service/gpu_processor.h
@@ -9,6 +9,7 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "base/task.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/cmd_parser.h"
diff --git a/webkit/tools/pepper_test_plugin/command_buffer_pepper.cc b/webkit/tools/pepper_test_plugin/command_buffer_pepper.cc
index d7fbf7a..148d342 100644
--- a/webkit/tools/pepper_test_plugin/command_buffer_pepper.cc
+++ b/webkit/tools/pepper_test_plugin/command_buffer_pepper.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "webkit/tools/pepper_test_plugin/command_buffer_pepper.h"
+#include "base/logging.h"
using base::SharedMemory;
using gpu::Buffer;
@@ -96,12 +97,6 @@ int32 CommandBufferPepper::GetPutOffset() {
return value;
}
-void CommandBufferPepper::SetPutOffsetChangeCallback(
- Callback0::Type* callback) {
- // Not implemented by proxy.
- NOTREACHED();
-}
-
int32 CommandBufferPepper::CreateTransferBuffer(size_t size) {
int32 id;
if (NPERR_NO_ERROR != device_->createBuffer(npp_, &context_, size, &id))
diff --git a/webkit/tools/pepper_test_plugin/command_buffer_pepper.h b/webkit/tools/pepper_test_plugin/command_buffer_pepper.h
index 5fc2486..017e4bc 100644
--- a/webkit/tools/pepper_test_plugin/command_buffer_pepper.h
+++ b/webkit/tools/pepper_test_plugin/command_buffer_pepper.h
@@ -28,7 +28,6 @@ class CommandBufferPepper : public gpu::CommandBuffer {
virtual int32 GetGetOffset();
virtual void SetGetOffset(int32 get_offset);
virtual int32 GetPutOffset();
- virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
virtual int32 CreateTransferBuffer(size_t size);
virtual void DestroyTransferBuffer(int32 id);
virtual gpu::Buffer GetTransferBuffer(int32 handle);