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 "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 float v[4]; | 36 float v[4]; |
37 }; | 37 }; |
38 | 38 |
39 VertexAttribInfo(); | 39 VertexAttribInfo(); |
40 ~VertexAttribInfo(); | 40 ~VertexAttribInfo(); |
41 | 41 |
42 // Returns true if this VertexAttrib can access index. | 42 // Returns true if this VertexAttrib can access index. |
43 bool CanAccess(GLuint index) const; | 43 bool CanAccess(GLuint index) const; |
44 | 44 |
45 BufferManager::BufferInfo* buffer() const { | 45 BufferManager::BufferInfo* buffer() const { |
46 return buffer_; | 46 return buffer_.get(); |
47 } | 47 } |
48 | 48 |
49 GLsizei offset() const { | 49 GLsizei offset() const { |
50 return offset_; | 50 return offset_; |
51 } | 51 } |
52 | 52 |
53 GLuint index() const { | 53 GLuint index() const { |
54 return index_; | 54 return index_; |
55 } | 55 } |
56 | 56 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 gl_stride_ = gl_stride; | 131 gl_stride_ = gl_stride; |
132 real_stride_ = real_stride; | 132 real_stride_ = real_stride; |
133 offset_ = offset; | 133 offset_ = offset; |
134 } | 134 } |
135 | 135 |
136 void SetDivisor(GLsizei divisor) { | 136 void SetDivisor(GLsizei divisor) { |
137 divisor_ = divisor; | 137 divisor_ = divisor; |
138 } | 138 } |
139 | 139 |
140 void Unbind(BufferManager::BufferInfo* buffer) { | 140 void Unbind(BufferManager::BufferInfo* buffer) { |
141 if (buffer_ == buffer) { | 141 if (buffer_.get() == buffer) { |
142 buffer_ = NULL; | 142 buffer_ = NULL; |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 // The index of this attrib. | 146 // The index of this attrib. |
147 GLuint index_; | 147 GLuint index_; |
148 | 148 |
149 // Whether or not this attribute is enabled. | 149 // Whether or not this attribute is enabled. |
150 bool enabled_; | 150 bool enabled_; |
151 | 151 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (info) { | 233 if (info) { |
234 info->SetDivisor(divisor); | 234 info->SetDivisor(divisor); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 void SetElementArrayBuffer(BufferManager::BufferInfo* buffer) { | 238 void SetElementArrayBuffer(BufferManager::BufferInfo* buffer) { |
239 element_array_buffer_ = buffer; | 239 element_array_buffer_ = buffer; |
240 } | 240 } |
241 | 241 |
242 BufferManager::BufferInfo* element_array_buffer() const { | 242 BufferManager::BufferInfo* element_array_buffer() const { |
243 return element_array_buffer_; | 243 return element_array_buffer_.get(); |
244 } | 244 } |
245 | 245 |
246 GLuint service_id() const { | 246 GLuint service_id() const { |
247 return service_id_; | 247 return service_id_; |
248 } | 248 } |
249 | 249 |
250 void Unbind(BufferManager::BufferInfo* buffer); | 250 void Unbind(BufferManager::BufferInfo* buffer); |
251 | 251 |
252 bool IsDeleted() const { | 252 bool IsDeleted() const { |
253 return deleted_; | 253 return deleted_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 // Service side vertex array object id. | 298 // Service side vertex array object id. |
299 GLuint service_id_; | 299 GLuint service_id_; |
300 }; | 300 }; |
301 | 301 |
302 } // namespace gles2 | 302 } // namespace gles2 |
303 } // namespace gpu | 303 } // namespace gpu |
304 | 304 |
305 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ | 305 #endif // GPU_COMMAND_BUFFER_SERVICE_VERTEX_ATTRIB_MANAGER_H_ |
306 | 306 |
OLD | NEW |