OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_VERTEX_ARRAY_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_VERTEX_ARRAY_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_VERTEX_ARRAY_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_VERTEX_ARRAY_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // This class keeps track of the vertex arrays and their sizes so we can do | 21 // This class keeps track of the vertex arrays and their sizes so we can do |
22 // bounds checking. | 22 // bounds checking. |
23 class GPU_EXPORT VertexArrayManager { | 23 class GPU_EXPORT VertexArrayManager { |
24 public: | 24 public: |
25 VertexArrayManager(); | 25 VertexArrayManager(); |
26 ~VertexArrayManager(); | 26 ~VertexArrayManager(); |
27 | 27 |
28 // Must call before destruction. | 28 // Must call before destruction. |
29 void Destroy(bool have_context); | 29 void Destroy(bool have_context); |
30 | 30 |
31 // Creates a VertexArrayInfo for the given vertex array. | 31 // Creates a VertexAttribManager and if client_visible, |
32 void CreateVertexAttribManager(GLuint client_id, GLuint service_id, | 32 // maps it to the client_id. |
33 uint32 num_vertex_attribs); | 33 scoped_refptr<VertexAttribManager> CreateVertexAttribManager( |
| 34 GLuint client_id, |
| 35 GLuint service_id, |
| 36 uint32 num_vertex_attribs, |
| 37 bool client_visible); |
34 | 38 |
35 // Gets the vertex attrib manager for the given vertex array. | 39 // Gets the vertex attrib manager for the given vertex array. |
36 VertexAttribManager* GetVertexAttribManager(GLuint client_id); | 40 VertexAttribManager* GetVertexAttribManager(GLuint client_id); |
37 | 41 |
38 // Removes the vertex attrib manager for the given vertex array. | 42 // Removes the vertex attrib manager for the given vertex array. |
39 void RemoveVertexAttribManager(GLuint client_id); | 43 void RemoveVertexAttribManager(GLuint client_id); |
40 | 44 |
41 // Gets a client id for a given service id. | 45 // Gets a client id for a given service id. |
42 bool GetClientId(GLuint service_id, GLuint* client_id) const; | 46 bool GetClientId(GLuint service_id, GLuint* client_id) const; |
43 | 47 |
(...skipping 14 matching lines...) Expand all Loading... |
58 | 62 |
59 bool have_context_; | 63 bool have_context_; |
60 | 64 |
61 DISALLOW_COPY_AND_ASSIGN(VertexArrayManager); | 65 DISALLOW_COPY_AND_ASSIGN(VertexArrayManager); |
62 }; | 66 }; |
63 | 67 |
64 } // namespace gles2 | 68 } // namespace gles2 |
65 } // namespace gpu | 69 } // namespace gpu |
66 | 70 |
67 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ARRAY_MANAGER_H_ | 71 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ARRAY_MANAGER_H_ |
OLD | NEW |