| 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 <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 list_ = new_list; | 109 list_ = new_list; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void SetInfo( | 112 void SetInfo( |
| 113 Buffer* buffer, | 113 Buffer* buffer, |
| 114 GLint size, | 114 GLint size, |
| 115 GLenum type, | 115 GLenum type, |
| 116 GLboolean normalized, | 116 GLboolean normalized, |
| 117 GLsizei gl_stride, | 117 GLsizei gl_stride, |
| 118 GLsizei real_stride, | 118 GLsizei real_stride, |
| 119 GLsizei offset); | 119 GLsizei offset, |
| 120 GLboolean integer); |
| 120 | 121 |
| 121 void SetDivisor(GLsizei divisor) { | 122 void SetDivisor(GLsizei divisor) { |
| 122 divisor_ = divisor; | 123 divisor_ = divisor; |
| 123 } | 124 } |
| 124 | 125 |
| 125 void SetInteger(GLboolean integer) { | |
| 126 integer_ = integer; | |
| 127 } | |
| 128 | |
| 129 void Unbind(Buffer* buffer); | 126 void Unbind(Buffer* buffer); |
| 130 | 127 |
| 131 // The index of this attrib. | 128 // The index of this attrib. |
| 132 GLuint index_; | 129 GLuint index_; |
| 133 | 130 |
| 134 // Whether or not this attribute is enabled. | 131 // Whether or not this attribute is enabled. |
| 135 bool enabled_; | 132 bool enabled_; |
| 136 | 133 |
| 137 // number of components (1, 2, 3, 4) | 134 // number of components (1, 2, 3, 4) |
| 138 GLint size_; | 135 GLint size_; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 197 } |
| 201 | 198 |
| 202 void SetAttribInfo( | 199 void SetAttribInfo( |
| 203 GLuint index, | 200 GLuint index, |
| 204 Buffer* buffer, | 201 Buffer* buffer, |
| 205 GLint size, | 202 GLint size, |
| 206 GLenum type, | 203 GLenum type, |
| 207 GLboolean normalized, | 204 GLboolean normalized, |
| 208 GLsizei gl_stride, | 205 GLsizei gl_stride, |
| 209 GLsizei real_stride, | 206 GLsizei real_stride, |
| 210 GLsizei offset) { | 207 GLsizei offset, |
| 208 GLboolean integer) { |
| 211 VertexAttrib* attrib = GetVertexAttrib(index); | 209 VertexAttrib* attrib = GetVertexAttrib(index); |
| 212 if (attrib) { | 210 if (attrib) { |
| 213 if (attrib->type() == GL_FIXED) { | 211 if (attrib->type() == GL_FIXED) { |
| 214 --num_fixed_attribs_; | 212 --num_fixed_attribs_; |
| 215 } | 213 } |
| 216 if (type == GL_FIXED) { | 214 if (type == GL_FIXED) { |
| 217 ++num_fixed_attribs_; | 215 ++num_fixed_attribs_; |
| 218 } | 216 } |
| 219 attrib->SetInfo( | 217 attrib->SetInfo(buffer, size, type, normalized, gl_stride, real_stride, |
| 220 buffer, size, type, normalized, gl_stride, real_stride, offset); | 218 offset, integer); |
| 221 } | 219 } |
| 222 } | 220 } |
| 223 | 221 |
| 224 void SetDivisor(GLuint index, GLuint divisor) { | 222 void SetDivisor(GLuint index, GLuint divisor) { |
| 225 VertexAttrib* attrib = GetVertexAttrib(index); | 223 VertexAttrib* attrib = GetVertexAttrib(index); |
| 226 if (attrib) { | 224 if (attrib) { |
| 227 attrib->SetDivisor(divisor); | 225 attrib->SetDivisor(divisor); |
| 228 } | 226 } |
| 229 } | 227 } |
| 230 | 228 |
| 231 void SetInteger(GLuint index, GLboolean integer) { | |
| 232 VertexAttrib* attrib = GetVertexAttrib(index); | |
| 233 if (attrib) { | |
| 234 attrib->SetInteger(integer); | |
| 235 } | |
| 236 } | |
| 237 | |
| 238 void SetElementArrayBuffer(Buffer* buffer); | 229 void SetElementArrayBuffer(Buffer* buffer); |
| 239 | 230 |
| 240 Buffer* element_array_buffer() const { return element_array_buffer_.get(); } | 231 Buffer* element_array_buffer() const { return element_array_buffer_.get(); } |
| 241 | 232 |
| 242 GLuint service_id() const { | 233 GLuint service_id() const { |
| 243 return service_id_; | 234 return service_id_; |
| 244 } | 235 } |
| 245 | 236 |
| 246 void Unbind(Buffer* buffer); | 237 void Unbind(Buffer* buffer); |
| 247 | 238 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 295 |
| 305 // Service side vertex array object id. | 296 // Service side vertex array object id. |
| 306 GLuint service_id_; | 297 GLuint service_id_; |
| 307 }; | 298 }; |
| 308 | 299 |
| 309 } // namespace gles2 | 300 } // namespace gles2 |
| 310 } // namespace gpu | 301 } // namespace gpu |
| 311 | 302 |
| 312 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ | 303 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ |
| 313 | 304 |
| OLD | NEW |