diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 19:14:10 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-03 19:14:10 +0000 |
commit | 066849e369dae48bf61ae0cf70c9e9acaf9f1045 (patch) | |
tree | 479aebcba9d2f1d3b054dc3ea64baa9a7c753f15 /gpu/command_buffer/client/ring_buffer.h | |
parent | 0411509f65aae2b1ba684bf87343a14253246de0 (diff) | |
download | chromium_src-066849e369dae48bf61ae0cf70c9e9acaf9f1045.zip chromium_src-066849e369dae48bf61ae0cf70c9e9acaf9f1045.tar.gz chromium_src-066849e369dae48bf61ae0cf70c9e9acaf9f1045.tar.bz2 |
Adds support for shared resources.
It's not clear how to test this easily
it seems like we an integration test
is needed at some point. I did run the
conformance tests with share_resources
set to true and it rand without crashing.
TEST=unit tests
BUG=none
Review URL: http://codereview.chromium.org/1817002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/ring_buffer.h')
-rw-r--r-- | gpu/command_buffer/client/ring_buffer.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gpu/command_buffer/client/ring_buffer.h b/gpu/command_buffer/client/ring_buffer.h index 0b55661..38ee912 100644 --- a/gpu/command_buffer/client/ring_buffer.h +++ b/gpu/command_buffer/client/ring_buffer.h @@ -128,7 +128,7 @@ class RingBufferWrapper { // Returns: // the pointer to the allocated memory block, or NULL if out of // memory. - void *Alloc(unsigned int size) { + void* Alloc(unsigned int size) { RingBuffer::Offset offset = allocator_.Alloc(size); return GetPointer(offset); } @@ -144,8 +144,8 @@ class RingBufferWrapper { // Returns: // the pointer to the allocated memory block, or NULL if out of // memory. - template <typename T> T *AllocTyped(unsigned int count) { - return static_cast<T *>(Alloc(count * sizeof(T))); + template <typename T> T* AllocTyped(unsigned int count) { + return static_cast<T*>(Alloc(count * sizeof(T))); } // Frees a block of memory, pending the passage of a token. That memory won't @@ -154,18 +154,18 @@ class RingBufferWrapper { // Parameters: // pointer: the pointer to the memory block to free. // token: the token value to wait for before re-using the memory. - void FreePendingToken(void *pointer, unsigned int token) { + void FreePendingToken(void* pointer, unsigned int token) { DCHECK(pointer); allocator_.FreePendingToken(GetOffset(pointer), token); } // Gets a pointer to a memory block given the base memory and the offset. - void *GetPointer(RingBuffer::Offset offset) { + void* GetPointer(RingBuffer::Offset offset) { return static_cast<int8*>(base_) + offset; } // Gets the offset to a memory block given the base memory and the address. - RingBuffer::Offset GetOffset(void *pointer) { + RingBuffer::Offset GetOffset(void* pointer) { return static_cast<int8*>(pointer) - static_cast<int8*>(base_); } @@ -182,7 +182,7 @@ class RingBufferWrapper { private: RingBuffer allocator_; - void *base_; + void* base_; RingBuffer::Offset base_offset_; DISALLOW_IMPLICIT_CONSTRUCTORS(RingBufferWrapper); }; |