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 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 5 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 VertexAttrib::~VertexAttrib() { | 43 VertexAttrib::~VertexAttrib() { |
44 } | 44 } |
45 | 45 |
46 void VertexAttrib::SetInfo( | 46 void VertexAttrib::SetInfo( |
47 Buffer* buffer, | 47 Buffer* buffer, |
48 GLint size, | 48 GLint size, |
49 GLenum type, | 49 GLenum type, |
50 GLboolean normalized, | 50 GLboolean normalized, |
51 GLsizei gl_stride, | 51 GLsizei gl_stride, |
52 GLsizei real_stride, | 52 GLsizei real_stride, |
53 GLsizei offset) { | 53 GLsizei offset, |
| 54 GLboolean integer) { |
54 DCHECK_GT(real_stride, 0); | 55 DCHECK_GT(real_stride, 0); |
55 buffer_ = buffer; | 56 buffer_ = buffer; |
56 size_ = size; | 57 size_ = size; |
57 type_ = type; | 58 type_ = type; |
58 normalized_ = normalized; | 59 normalized_ = normalized; |
59 gl_stride_ = gl_stride; | 60 gl_stride_ = gl_stride; |
60 real_stride_ = real_stride; | 61 real_stride_ = real_stride; |
61 offset_ = offset; | 62 offset_ = offset; |
| 63 integer_ = integer; |
62 } | 64 } |
63 | 65 |
64 void VertexAttrib::Unbind(Buffer* buffer) { | 66 void VertexAttrib::Unbind(Buffer* buffer) { |
65 if (buffer_.get() == buffer) { | 67 if (buffer_.get() == buffer) { |
66 buffer_ = NULL; | 68 buffer_ = NULL; |
67 } | 69 } |
68 } | 70 } |
69 | 71 |
70 bool VertexAttrib::CanAccess(GLuint index) const { | 72 bool VertexAttrib::CanAccess(GLuint index) const { |
71 if (!enabled_) { | 73 if (!enabled_) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (current_buffer_id != kInitialBufferId) { | 272 if (current_buffer_id != kInitialBufferId) { |
271 // Restore the buffer binding. | 273 // Restore the buffer binding. |
272 decoder->RestoreBufferBindings(); | 274 decoder->RestoreBufferBindings(); |
273 } | 275 } |
274 | 276 |
275 return true; | 277 return true; |
276 } | 278 } |
277 | 279 |
278 } // namespace gles2 | 280 } // namespace gles2 |
279 } // namespace gpu | 281 } // namespace gpu |
OLD | NEW |