diff options
Diffstat (limited to 'gpu/command_buffer/service/buffer_manager.h')
-rw-r--r-- | gpu/command_buffer/service/buffer_manager.h | 63 |
1 files changed, 13 insertions, 50 deletions
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h index 0d99e9b..e9ea2f7 100644 --- a/gpu/command_buffer/service/buffer_manager.h +++ b/gpu/command_buffer/service/buffer_manager.h @@ -19,8 +19,6 @@ namespace gpu { namespace gles2 { class BufferManager; -class FeatureInfo; -class GLES2Decoder; // Info about Buffers currently in the system. class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { @@ -31,10 +29,6 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { return service_id_; } - GLenum target() const { - return target_; - } - GLsizeiptr size() const { return size_; } @@ -43,6 +37,11 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { return usage_; } + // Sets a range of data for this buffer. Returns false if the offset or size + // is out of range. + bool SetRange( + GLintptr offset, GLsizeiptr size, const GLvoid * data); + // Gets the maximum value in the buffer for the given range interpreted as // the given type. Returns false if offset and count are out of range. // offset is in bytes. @@ -61,10 +60,6 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { return target() && !IsDeleted(); } - bool IsClientSideArray() const { - return is_client_side_array_; - } - private: friend class BufferManager; friend class BufferManagerTestBase; @@ -100,6 +95,10 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { ~Buffer(); + GLenum target() const { + return target_; + } + void set_target(GLenum target) { DCHECK_EQ(target_, 0u); // you can only set this once. target_ = target; @@ -113,16 +112,7 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { deleted_ = true; } - // Sets the size, usage and initial data of a buffer. - // If shadow is true then if data is NULL buffer will be initialized to 0. - void SetInfo( - GLsizeiptr size, GLenum usage, bool shadow, const GLvoid* data, - bool is_client_side_array); - - // Sets a range of data for this buffer. Returns false if the offset or size - // is out of range. - bool SetRange( - GLintptr offset, GLsizeiptr size, const GLvoid * data); + void SetInfo(GLsizeiptr size, GLenum usage, bool shadow); // Clears any cache of index ranges. void ClearCache(); @@ -153,10 +143,6 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { // Whether or not the data is shadowed. bool shadowed_; - // Whether or not this Buffer is not uploaded to the GPU but just - // sitting in local memory. - bool is_client_side_array_; - // A copy of the data in the buffer. This data is only kept if the target // is backed_ = true. scoped_array<int8> shadow_; @@ -173,7 +159,7 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { // shared by multiple GLES2Decoders. class GPU_EXPORT BufferManager { public: - BufferManager(MemoryTracker* memory_tracker, FeatureInfo* feature_info); + BufferManager(MemoryTracker* memory_tracker); ~BufferManager(); // Must call before destruction. @@ -191,22 +177,8 @@ class GPU_EXPORT BufferManager { // Gets a client id for a given service id. bool GetClientId(GLuint service_id, GLuint* client_id) const; - // Does a glBufferData and updates the approprate accounting. Currently - // assume the values have already been validated. - void DoBufferData( - GLES2Decoder* decoder, - Buffer* buffer, - GLsizeiptr size, - GLenum usage, - const GLvoid* data); - - // Does a glBufferSubData and updates the approrate accounting. - void DoBufferSubData( - GLES2Decoder* decoder, - Buffer* buffer, - GLintptr offset, - GLsizeiptr size, - const GLvoid* data); + // Sets the size and usage of a buffer. + void SetInfo(Buffer* info, GLsizeiptr size, GLenum usage); // Sets the target of a buffer. Returns false if the target can not be set. bool SetTarget(Buffer* info, GLenum target); @@ -219,20 +191,12 @@ class GPU_EXPORT BufferManager { return memory_tracker_->GetMemRepresented(); } - // Tell's for a given usage if this would be a client side array. - bool IsUsageClientSideArray(GLenum usage); - private: friend class Buffer; void StartTracking(Buffer* info); void StopTracking(Buffer* info); - // Sets the size, usage and initial data of a buffer. - // If data is NULL buffer will be initialized to 0 if shadowed. - void SetInfo(Buffer* info, GLsizeiptr size, GLenum usage, const GLvoid* data); - scoped_ptr<MemoryTypeTracker> memory_tracker_; - scoped_refptr<FeatureInfo> feature_info_; // Info for each buffer in the system. typedef base::hash_map<GLuint, scoped_refptr<Buffer> > BufferInfoMap; @@ -246,7 +210,6 @@ class GPU_EXPORT BufferManager { unsigned int buffer_info_count_; bool have_context_; - bool use_client_side_arrays_for_stream_buffers_; DISALLOW_COPY_AND_ASSIGN(BufferManager); }; |