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 e9ea2f784661e8045f541a695a7cc05a61dbb0f2..6bd554fb03a9358003965fc2843f0446ae4a502e 100644 |
--- a/gpu/command_buffer/service/buffer_manager.h |
+++ b/gpu/command_buffer/service/buffer_manager.h |
@@ -19,6 +19,7 @@ namespace gpu { |
namespace gles2 { |
class BufferManager; |
+class FeatureInfo; |
// Info about Buffers currently in the system. |
class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { |
@@ -60,6 +61,10 @@ 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; |
@@ -112,7 +117,11 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { |
deleted_ = true; |
} |
- void SetInfo(GLsizeiptr size, GLenum usage, bool shadow); |
+ // 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); |
// Clears any cache of index ranges. |
void ClearCache(); |
@@ -143,6 +152,10 @@ 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_; |
@@ -159,7 +172,7 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> { |
// shared by multiple GLES2Decoders. |
class GPU_EXPORT BufferManager { |
public: |
- BufferManager(MemoryTracker* memory_tracker); |
+ BufferManager(MemoryTracker* memory_tracker, FeatureInfo* feature_info); |
~BufferManager(); |
// Must call before destruction. |
@@ -177,8 +190,9 @@ class GPU_EXPORT BufferManager { |
// Gets a client id for a given service id. |
bool GetClientId(GLuint service_id, GLuint* client_id) const; |
- // Sets the size and usage of a buffer. |
- void SetInfo(Buffer* info, GLsizeiptr size, GLenum usage); |
+ // 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); |
// Sets the target of a buffer. Returns false if the target can not be set. |
bool SetTarget(Buffer* info, GLenum target); |
@@ -197,6 +211,7 @@ class GPU_EXPORT BufferManager { |
void StopTracking(Buffer* info); |
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; |