summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-09 01:30:16 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-09 01:30:16 +0000
commit43cee51d23a058dfe56785e837779924f9d92138 (patch)
tree2e125f8bc9c21960f1a2e6a2fb11b5566df1f05d /gpu
parent6123803835f00b70936a457e2fc96b4655feb42d (diff)
downloadchromium_src-43cee51d23a058dfe56785e837779924f9d92138.zip
chromium_src-43cee51d23a058dfe56785e837779924f9d92138.tar.gz
chromium_src-43cee51d23a058dfe56785e837779924f9d92138.tar.bz2
Removing the dependency of command-buffer client on base/task.h. This file includes base/logging.h which is difficult to compile under nacl. base-logging is stubbed in gpu by gpu/common/logging.h.
BUG=26104 Review URL: http://codereview.chromium.org/527009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-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
5 files changed, 19 insertions, 20 deletions
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"