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

Unified Diff: Source/core/html/canvas/WebGLVertexArrayObjectOES.h

Issue 15481002: Make WebGL objects scriptwrappable so that binding integrity checks may be applied to them. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix WebGLProgram really really. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/WebGLVertexArrayObjectOES.h
diff --git a/Source/core/html/canvas/WebGLVertexArrayObjectOES.h b/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
index 2284e2b8eb072d7f73b070f13d6bc711134cb33d..85fb380cfdd3f90a7547b7ec5127f355482d6a93 100644
--- a/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
+++ b/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
@@ -26,25 +26,25 @@
#ifndef WebGLVertexArrayObjectOES_h
#define WebGLVertexArrayObjectOES_h
+#include "bindings/v8/ScriptWrappable.h"
#include "core/html/canvas/WebGLBuffer.h"
#include "core/html/canvas/WebGLContextObject.h"
-
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
-class WebGLVertexArrayObjectOES : public WebGLContextObject {
+class WebGLVertexArrayObjectOES : public WebGLContextObject, public ScriptWrappable {
public:
enum VaoType {
VaoTypeDefault,
VaoTypeUser,
};
-
+
virtual ~WebGLVertexArrayObjectOES();
static PassRefPtr<WebGLVertexArrayObjectOES> create(WebGLRenderingContext*, VaoType);
-
+
// Cached values for vertex attrib range checks
struct VertexAttribState {
VertexAttribState()
@@ -58,7 +58,7 @@ public:
, offset(0)
{
}
-
+
bool enabled;
RefPtr<WebGLBuffer> bufferBinding;
GC3Dsizei bytesPerElement;
@@ -69,15 +69,15 @@ public:
GC3Dsizei originalStride;
GC3Dintptr offset;
};
-
+
bool isDefaultObject() const { return m_type == VaoTypeDefault; }
-
+
bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
void setHasEverBeenBound() { m_hasEverBeenBound = true; }
-
+
PassRefPtr<WebGLBuffer> getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
void setElementArrayBuffer(PassRefPtr<WebGLBuffer>);
-
+
VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribState[index]; }
void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, PassRefPtr<WebGLBuffer>);
void unbindBuffer(PassRefPtr<WebGLBuffer>);
@@ -88,7 +88,7 @@ private:
virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject);
virtual bool isVertexArray() const { return true; }
-
+
VaoType m_type;
bool m_hasEverBeenBound;
RefPtr<WebGLBuffer> m_boundElementArrayBuffer;
« no previous file with comments | « Source/core/html/canvas/WebGLUniformLocation.cpp ('k') | Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698