| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 class WebGLVertexArrayObjectOES FINAL : public WebGLContextObject, public Script
Wrappable { | 36 class WebGLVertexArrayObjectOES FINAL : public WebGLContextObject, public Script
Wrappable { |
| 37 public: | 37 public: |
| 38 enum VaoType { | 38 enum VaoType { |
| 39 VaoTypeDefault, | 39 VaoTypeDefault, |
| 40 VaoTypeUser, | 40 VaoTypeUser, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 virtual ~WebGLVertexArrayObjectOES(); | 43 virtual ~WebGLVertexArrayObjectOES(); |
| 44 | 44 |
| 45 static PassRefPtr<WebGLVertexArrayObjectOES> create(WebGLRenderingContext*,
VaoType); | 45 static PassRefPtr<WebGLVertexArrayObjectOES> create(WebGLRenderingContextBas
e*, VaoType); |
| 46 | 46 |
| 47 // Cached values for vertex attrib range checks | 47 // Cached values for vertex attrib range checks |
| 48 struct VertexAttribState { | 48 struct VertexAttribState { |
| 49 VertexAttribState() | 49 VertexAttribState() |
| 50 : enabled(false) | 50 : enabled(false) |
| 51 , bytesPerElement(0) | 51 , bytesPerElement(0) |
| 52 , size(4) | 52 , size(4) |
| 53 , type(GL_FLOAT) | 53 , type(GL_FLOAT) |
| 54 , normalized(false) | 54 , normalized(false) |
| 55 , stride(16) | 55 , stride(16) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 PassRefPtr<WebGLBuffer> boundElementArrayBuffer() const { return m_boundElem
entArrayBuffer; } | 79 PassRefPtr<WebGLBuffer> boundElementArrayBuffer() const { return m_boundElem
entArrayBuffer; } |
| 80 void setElementArrayBuffer(PassRefPtr<WebGLBuffer>); | 80 void setElementArrayBuffer(PassRefPtr<WebGLBuffer>); |
| 81 | 81 |
| 82 VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribSt
ate[index]; } | 82 VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribSt
ate[index]; } |
| 83 void setVertexAttribState(GLuint, GLsizei, GLint, GLenum, GLboolean, GLsizei
, GLintptr, PassRefPtr<WebGLBuffer>); | 83 void setVertexAttribState(GLuint, GLsizei, GLint, GLenum, GLboolean, GLsizei
, GLintptr, PassRefPtr<WebGLBuffer>); |
| 84 void unbindBuffer(PassRefPtr<WebGLBuffer>); | 84 void unbindBuffer(PassRefPtr<WebGLBuffer>); |
| 85 void setVertexAttribDivisor(GLuint index, GLuint divisor); | 85 void setVertexAttribDivisor(GLuint index, GLuint divisor); |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 WebGLVertexArrayObjectOES(WebGLRenderingContext*, VaoType); | 88 WebGLVertexArrayObjectOES(WebGLRenderingContextBase*, VaoType); |
| 89 | 89 |
| 90 virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject
) OVERRIDE; | 90 virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject
) OVERRIDE; |
| 91 | 91 |
| 92 VaoType m_type; | 92 VaoType m_type; |
| 93 bool m_hasEverBeenBound; | 93 bool m_hasEverBeenBound; |
| 94 RefPtr<WebGLBuffer> m_boundElementArrayBuffer; | 94 RefPtr<WebGLBuffer> m_boundElementArrayBuffer; |
| 95 Vector<VertexAttribState> m_vertexAttribState; | 95 Vector<VertexAttribState> m_vertexAttribState; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace WebCore | 98 } // namespace WebCore |
| 99 | 99 |
| 100 #endif // WebGLVertexArrayObjectOES_h | 100 #endif // WebGLVertexArrayObjectOES_h |
| OLD | NEW |