diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2018-07-02 14:50:40 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2018-07-05 14:20:44 +0200 |
commit | 5d43f1c9bd736f45be6e7d700ef1f9d6ac5ee7a6 (patch) | |
tree | bcfce92ec93fede0e0e947f36e3adeef294c1cf4 /components/script/dom/webglvertexarrayobjectoes.rs | |
parent | c71c55e542c57f6ec4e5e77be750f74f50340e56 (diff) | |
download | servo-5d43f1c9bd736f45be6e7d700ef1f9d6ac5ee7a6.tar.gz servo-5d43f1c9bd736f45be6e7d700ef1f9d6ac5ee7a6.zip |
Rename BoundAttribBuffers to VertexAttribs and make it store a slice
Diffstat (limited to 'components/script/dom/webglvertexarrayobjectoes.rs')
-rw-r--r-- | components/script/dom/webglvertexarrayobjectoes.rs | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/components/script/dom/webglvertexarrayobjectoes.rs b/components/script/dom/webglvertexarrayobjectoes.rs index 49babf3095d..883559f8ac2 100644 --- a/components/script/dom/webglvertexarrayobjectoes.rs +++ b/components/script/dom/webglvertexarrayobjectoes.rs @@ -9,7 +9,7 @@ use dom::bindings::root::{DomRoot, MutNullableDom}; use dom::globalscope::GlobalScope; use dom::webglbuffer::WebGLBuffer; use dom::webglobject::WebGLObject; -use dom::webglrenderingcontext::BoundAttribBuffers; +use dom::webglrenderingcontext::VertexAttribs; use dom_struct::dom_struct; use std::cell::Cell; @@ -19,30 +19,36 @@ pub struct WebGLVertexArrayObjectOES { id: WebGLVertexArrayId, ever_bound: Cell<bool>, is_deleted: Cell<bool>, - bound_attrib_buffers: BoundAttribBuffers, + vertex_attribs: VertexAttribs, bound_buffer_element_array: MutNullableDom<WebGLBuffer>, } impl WebGLVertexArrayObjectOES { - fn new_inherited(id: WebGLVertexArrayId) -> WebGLVertexArrayObjectOES { + fn new_inherited(id: WebGLVertexArrayId, max_vertex_attribs: u32) -> Self { Self { webgl_object_: WebGLObject::new_inherited(), id: id, ever_bound: Cell::new(false), is_deleted: Cell::new(false), - bound_attrib_buffers: Default::default(), + vertex_attribs: VertexAttribs::new(max_vertex_attribs), bound_buffer_element_array: MutNullableDom::new(None), } } - pub fn new(global: &GlobalScope, id: WebGLVertexArrayId) -> DomRoot<WebGLVertexArrayObjectOES> { - reflect_dom_object(Box::new(WebGLVertexArrayObjectOES::new_inherited(id)), - global, - WebGLVertexArrayObjectOESBinding::Wrap) + pub fn new( + global: &GlobalScope, + id: WebGLVertexArrayId, + max_vertex_attribs: u32, + ) -> DomRoot<Self> { + reflect_dom_object( + Box::new(WebGLVertexArrayObjectOES::new_inherited(id, max_vertex_attribs)), + global, + WebGLVertexArrayObjectOESBinding::Wrap, + ) } - pub fn bound_attrib_buffers(&self) -> &BoundAttribBuffers { - &self.bound_attrib_buffers + pub fn vertex_attribs(&self) -> &VertexAttribs { + &self.vertex_attribs } pub fn id(&self) -> WebGLVertexArrayId { |