diff options
Diffstat (limited to 'gpu/command_buffer/common')
-rw-r--r-- | gpu/command_buffer/common/command_buffer.h | 6 | ||||
-rw-r--r-- | gpu/command_buffer/common/command_buffer_mock.h | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h index 963b228..b758333 100644 --- a/gpu/command_buffer/common/command_buffer.h +++ b/gpu/command_buffer/common/command_buffer.h @@ -80,6 +80,12 @@ class CommandBuffer { // identifies it or -1 on error. virtual int32 CreateTransferBuffer(size_t size) = 0; + // Register an existing shared memory object and get an ID that can be used + // to identify it in the command buffer. Callee dups the handle until + // DestroyTransferBuffer is called. + virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, + size_t size) = 0; + // Destroy a transfer buffer and recycle the handle. virtual void DestroyTransferBuffer(int32 id) = 0; diff --git a/gpu/command_buffer/common/command_buffer_mock.h b/gpu/command_buffer/common/command_buffer_mock.h index a633d24..99a72d3 100644 --- a/gpu/command_buffer/common/command_buffer_mock.h +++ b/gpu/command_buffer/common/command_buffer_mock.h @@ -8,6 +8,10 @@ #include "../common/command_buffer.h" #include "testing/gmock/include/gmock/gmock.h" +namespace base { +class SharedMemory; +} + namespace gpu { // An NPObject that implements a shared memory command buffer and a synchronous @@ -26,6 +30,8 @@ class MockCommandBuffer : public CommandBuffer { MOCK_METHOD1(CreateTransferBuffer, int32(size_t size)); MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle)); MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle)); + MOCK_METHOD2(RegisterTransferBuffer, int32(base::SharedMemory* shared_memory, + size_t size)); MOCK_METHOD1(SetToken, void(int32 token)); MOCK_METHOD1(SetParseError, void(error::Error error)); |