Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Side by Side Diff: Source/core/html/canvas/WebGLVertexArrayObjectOES.h

Issue 24096029: Moved the majority of WebGL functionality into WebGLRenderingContextBase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
35 35
36 class WebGLVertexArrayObjectOES : public WebGLContextObject, public ScriptWrappa ble { 36 class WebGLVertexArrayObjectOES : public WebGLContextObject, public ScriptWrappa ble {
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(GraphicsContext3D::FLOAT) 53 , type(GraphicsContext3D::FLOAT)
54 , normalized(false) 54 , normalized(false)
55 , stride(16) 55 , stride(16)
(...skipping 22 matching lines...) Expand all
78 78
79 PassRefPtr<WebGLBuffer> getElementArrayBuffer() const { return m_boundElemen tArrayBuffer; } 79 PassRefPtr<WebGLBuffer> getElementArrayBuffer() const { return m_boundElemen tArrayBuffer; }
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(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolea n, GC3Dsizei, GC3Dintptr, PassRefPtr<WebGLBuffer>); 83 void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolea n, GC3Dsizei, GC3Dintptr, PassRefPtr<WebGLBuffer>);
84 void unbindBuffer(PassRefPtr<WebGLBuffer>); 84 void unbindBuffer(PassRefPtr<WebGLBuffer>);
85 void setVertexAttribDivisor(GC3Duint index, GC3Duint divisor); 85 void setVertexAttribDivisor(GC3Duint index, GC3Duint divisor);
86 86
87 private: 87 private:
88 WebGLVertexArrayObjectOES(WebGLRenderingContext*, VaoType); 88 WebGLVertexArrayObjectOES(WebGLRenderingContextBase*, VaoType);
89 89
90 virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject); 90 virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject);
91 91
92 virtual bool isVertexArray() const { return true; } 92 virtual bool isVertexArray() const { return true; }
93 93
94 VaoType m_type; 94 VaoType m_type;
95 bool m_hasEverBeenBound; 95 bool m_hasEverBeenBound;
96 RefPtr<WebGLBuffer> m_boundElementArrayBuffer; 96 RefPtr<WebGLBuffer> m_boundElementArrayBuffer;
97 Vector<VertexAttribState> m_vertexAttribState; 97 Vector<VertexAttribState> m_vertexAttribState;
98 }; 98 };
99 99
100 } // namespace WebCore 100 } // namespace WebCore
101 101
102 #endif // WebGLVertexArrayObjectOES_h 102 #endif // WebGLVertexArrayObjectOES_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698