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

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

Issue 1157983002: Update WebGLVertexArrayObjectOES to WebGLVertexArrayObject for WebGL2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix crash in testing conformance/context/context-lost-restored.html Created 5 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 383e30d657f7999e416da1ed5a3667eb736db19b..e8626569635ebb1ccd5832e0a8b5e24959674c51 100644
--- a/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
+++ b/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
@@ -26,88 +26,18 @@
#ifndef WebGLVertexArrayObjectOES_h
#define WebGLVertexArrayObjectOES_h
-#include "core/html/canvas/WebGLBuffer.h"
-#include "core/html/canvas/WebGLContextObject.h"
-#include "platform/heap/Handle.h"
+#include "core/html/canvas/WebGLVertexArrayObjectBase.h"
#include "wtf/PassRefPtr.h"
namespace blink {
-class WebGLVertexArrayObjectOES final : public WebGLContextObject {
+class WebGLVertexArrayObjectOES final : public WebGLVertexArrayObjectBase {
DEFINE_WRAPPERTYPEINFO();
public:
- enum VaoType {
- VaoTypeDefault,
- VaoTypeUser,
- };
-
- ~WebGLVertexArrayObjectOES() override;
-
static PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> create(WebGLRenderingContextBase*, VaoType);
- Platform3DObject object() const { return m_object; }
-
- // Cached values for vertex attrib range checks
- class VertexAttribState final : public NoBaseWillBeGarbageCollected<VertexAttribState> {
- public:
- VertexAttribState()
- : enabled(false)
- , bytesPerElement(0)
- , size(4)
- , type(GL_FLOAT)
- , normalized(false)
- , stride(16)
- , originalStride(0)
- , offset(0)
- , divisor(0)
- {
- }
-
- DECLARE_TRACE();
-
- bool enabled;
- RefPtrWillBeMember<WebGLBuffer> bufferBinding;
- GLsizei bytesPerElement;
- GLint size;
- GLenum type;
- bool normalized;
- GLsizei stride;
- GLsizei originalStride;
- GLintptr offset;
- GLuint divisor;
- };
-
- bool isDefaultObject() const { return m_type == VaoTypeDefault; }
-
- bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
- void setHasEverBeenBound() { m_hasEverBeenBound = true; }
-
- PassRefPtrWillBeRawPtr<WebGLBuffer> boundElementArrayBuffer() const { return m_boundElementArrayBuffer; }
- void setElementArrayBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer>);
-
- VertexAttribState* getVertexAttribState(size_t);
- void setVertexAttribState(GLuint, GLsizei, GLint, GLenum, GLboolean, GLsizei, GLintptr, PassRefPtrWillBeRawPtr<WebGLBuffer>);
- void unbindBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer>);
- void setVertexAttribDivisor(GLuint index, GLuint divisor);
-
- DECLARE_VIRTUAL_TRACE();
-
private:
- WebGLVertexArrayObjectOES(WebGLRenderingContextBase*, VaoType);
-
- void dispatchDetached(WebGraphicsContext3D*);
- bool hasObject() const override { return m_object != 0; }
- void deleteObjectImpl(WebGraphicsContext3D*) override;
-
- Platform3DObject m_object;
-
- VaoType m_type;
- bool m_hasEverBeenBound;
-#if ENABLE(OILPAN)
- bool m_destructionInProgress;
-#endif
- RefPtrWillBeMember<WebGLBuffer> m_boundElementArrayBuffer;
- WillBeHeapVector<OwnPtrWillBeMember<VertexAttribState>> m_vertexAttribState;
+ explicit WebGLVertexArrayObjectOES(WebGLRenderingContextBase*, VaoType);
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698