Chromium Code Reviews| Index: gpu/command_buffer/service/buffer_manager.h |
| diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h |
| index b3b4ede36b898e706cd8bf946b01dc801e567628..8cea9423234ed810889c762e65b8c7255efbde8f 100644 |
| --- a/gpu/command_buffer/service/buffer_manager.h |
| +++ b/gpu/command_buffer/service/buffer_manager.h |
| @@ -11,10 +11,14 @@ |
| #include "base/logging.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "gpu/command_buffer/service/gl_utils.h" |
| #include "gpu/gpu_export.h" |
| namespace gpu { |
| + |
| +class CommonDecoder; |
| + |
| namespace gles2 { |
| // This class keeps track of the buffers and their sizes so we can do |
| @@ -119,6 +123,8 @@ class GPU_EXPORT BufferManager { |
| } |
| void SetInfo(GLsizeiptr size, GLenum usage, bool shadow); |
| + void SetInfo(GLsizeiptr size, GLenum usage, CommonDecoder* decoder, |
| + int32 shm_id, uint32 shm_offset); |
| // Clears any cache of index ranges. |
| void ClearCache(); |
| @@ -153,6 +159,13 @@ class GPU_EXPORT BufferManager { |
| // A map of ranges to the highest value in that range of a certain type. |
| typedef std::map<Range, GLuint, Range::Less> RangeToMaxValueMap; |
| RangeToMaxValueMap range_set_; |
| + |
| + // The decoder pointer is reset if the decoder is destroyed. |
| + base::WeakPtr<CommonDecoder> decoder_; |
|
greggman
2012/05/24 20:56:00
I'm a little leary of tracking decoders per buffer
|
| + |
| + // The shared memory used with this Buffer. |
| + int32 shm_id_; |
| + uint32 shm_offset_; |
| }; |
| BufferManager(); |
| @@ -176,6 +189,10 @@ class GPU_EXPORT BufferManager { |
| // Sets the size and usage of a buffer. |
| void SetInfo(BufferInfo* info, GLsizeiptr size, GLenum usage); |
| + // Sets the size, usage and shared memory of a buffer. |
| + void SetInfo(BufferInfo* info, GLsizeiptr size, GLenum usage, |
| + CommonDecoder* decoder, int32 shm_id, uint32 shm_offset); |
| + |
| // Sets the target of a buffer. Returns false if the target can not be set. |
| bool SetTarget(BufferInfo* info, GLenum target); |