| 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_ATTRIB_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <list> | 11 #include <list> |
| 9 #include <vector> | 12 #include <vector> |
| 10 #include "base/logging.h" | 13 #include "base/logging.h" |
| 11 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 12 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 13 #include "gpu/command_buffer/service/buffer_manager.h" | 16 #include "gpu/command_buffer/service/buffer_manager.h" |
| 14 #include "gpu/command_buffer/service/gl_utils.h" | 17 #include "gpu/command_buffer/service/gl_utils.h" |
| 15 #include "gpu/gpu_export.h" | 18 #include "gpu/gpu_export.h" |
| 16 | 19 |
| 17 namespace gpu { | 20 namespace gpu { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Manages vertex attributes. | 173 // Manages vertex attributes. |
| 171 // This class also acts as the service-side representation of a | 174 // This class also acts as the service-side representation of a |
| 172 // vertex array object and it's contained state. | 175 // vertex array object and it's contained state. |
| 173 class GPU_EXPORT VertexAttribManager : | 176 class GPU_EXPORT VertexAttribManager : |
| 174 public base::RefCounted<VertexAttribManager> { | 177 public base::RefCounted<VertexAttribManager> { |
| 175 public: | 178 public: |
| 176 typedef std::list<VertexAttrib*> VertexAttribList; | 179 typedef std::list<VertexAttrib*> VertexAttribList; |
| 177 | 180 |
| 178 VertexAttribManager(); | 181 VertexAttribManager(); |
| 179 | 182 |
| 180 void Initialize(uint32 num_vertex_attribs, bool init_attribs); | 183 void Initialize(uint32_t num_vertex_attribs, bool init_attribs); |
| 181 | 184 |
| 182 bool Enable(GLuint index, bool enable); | 185 bool Enable(GLuint index, bool enable); |
| 183 | 186 |
| 184 bool HaveFixedAttribs() const { | 187 bool HaveFixedAttribs() const { |
| 185 return num_fixed_attribs_ != 0; | 188 return num_fixed_attribs_ != 0; |
| 186 } | 189 } |
| 187 | 190 |
| 188 const VertexAttribList& GetEnabledVertexAttribs() const { | 191 const VertexAttribList& GetEnabledVertexAttribs() const { |
| 189 return enabled_vertex_attribs_; | 192 return enabled_vertex_attribs_; |
| 190 } | 193 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 GLuint max_vertex_accessed, | 259 GLuint max_vertex_accessed, |
| 257 bool instanced, | 260 bool instanced, |
| 258 GLsizei primcount); | 261 GLsizei primcount); |
| 259 | 262 |
| 260 private: | 263 private: |
| 261 friend class VertexArrayManager; | 264 friend class VertexArrayManager; |
| 262 friend class VertexArrayManagerTest; | 265 friend class VertexArrayManagerTest; |
| 263 friend class base::RefCounted<VertexAttribManager>; | 266 friend class base::RefCounted<VertexAttribManager>; |
| 264 | 267 |
| 265 // Used when creating from a VertexArrayManager | 268 // Used when creating from a VertexArrayManager |
| 266 VertexAttribManager(VertexArrayManager* manager, GLuint service_id, | 269 VertexAttribManager(VertexArrayManager* manager, |
| 267 uint32 num_vertex_attribs); | 270 GLuint service_id, |
| 271 uint32_t num_vertex_attribs); |
| 268 | 272 |
| 269 ~VertexAttribManager(); | 273 ~VertexAttribManager(); |
| 270 | 274 |
| 271 void MarkAsDeleted() { | 275 void MarkAsDeleted() { |
| 272 deleted_ = true; | 276 deleted_ = true; |
| 273 } | 277 } |
| 274 | 278 |
| 275 // number of attribs using type GL_FIXED. | 279 // number of attribs using type GL_FIXED. |
| 276 int num_fixed_attribs_; | 280 int num_fixed_attribs_; |
| 277 | 281 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 295 | 299 |
| 296 // Service side vertex array object id. | 300 // Service side vertex array object id. |
| 297 GLuint service_id_; | 301 GLuint service_id_; |
| 298 }; | 302 }; |
| 299 | 303 |
| 300 } // namespace gles2 | 304 } // namespace gles2 |
| 301 } // namespace gpu | 305 } // namespace gpu |
| 302 | 306 |
| 303 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ | 307 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ |
| 304 | 308 |
| OLD | NEW |