Bug 966998 - WebGL OES_vertex_array_object windows presence is low. r=jgilbert
authorWalter Litwinczyk <wlitwinczyk@mozilla.com>
Thu, 05 Jun 2014 16:38:27 -0700
changeset 206291 63f80cbd7c35600147a0ff4618b8f9c14f29e67f
parent 206290 701a232171832309d15bb311affa5a4c54579f65
child 206292 5ddd73f7562ee2f72a7876d47504a0c06119cf01
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs966998
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 966998 - WebGL OES_vertex_array_object windows presence is low. r=jgilbert
content/canvas/src/WebGLContext.h
content/canvas/src/WebGLContextBuffers.cpp
content/canvas/src/WebGLContextDraw.cpp
content/canvas/src/WebGLContextState.cpp
content/canvas/src/WebGLContextUtils.cpp
content/canvas/src/WebGLContextValidate.cpp
content/canvas/src/WebGLContextVertexArray.cpp
content/canvas/src/WebGLExtensionVertexArray.cpp
content/canvas/src/WebGLVertexArray.cpp
content/canvas/src/WebGLVertexArray.h
content/canvas/src/WebGLVertexArrayFake.cpp
content/canvas/src/WebGLVertexArrayFake.h
content/canvas/src/WebGLVertexArrayGL.cpp
content/canvas/src/WebGLVertexArrayGL.h
content/canvas/src/moz.build
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -1249,16 +1249,18 @@ public:
     friend class WebGLFramebuffer;
     friend class WebGLRenderbuffer;
     friend class WebGLProgram;
     friend class WebGLQuery;
     friend class WebGLBuffer;
     friend class WebGLShader;
     friend class WebGLUniformLocation;
     friend class WebGLVertexArray;
+    friend class WebGLVertexArrayFake;
+    friend class WebGLVertexArrayGL;
 };
 
 // used by DOM bindings in conjunction with GetParentObject
 inline nsISupports*
 ToSupports(WebGLContext* context)
 {
   return static_cast<nsIDOMWebGLRenderingContext*>(context);
 }
--- a/content/canvas/src/WebGLContextBuffers.cpp
+++ b/content/canvas/src/WebGLContextBuffers.cpp
@@ -380,17 +380,17 @@ WebGLContext::DeleteBuffer(WebGLBuffer *
     if (!buffer || buffer->IsDeleted())
         return;
 
     if (mBoundArrayBuffer == buffer) {
         BindBuffer(LOCAL_GL_ARRAY_BUFFER,
                    static_cast<WebGLBuffer*>(nullptr));
     }
 
-    if (mBoundVertexArray->mBoundElementArrayBuffer == buffer) {
+    if (mBoundVertexArray->mElementArrayBuffer == buffer) {
         BindBuffer(LOCAL_GL_ELEMENT_ARRAY_BUFFER,
                    static_cast<WebGLBuffer*>(nullptr));
     }
 
     for (int32_t i = 0; i < mGLMaxVertexAttribs; i++) {
         if (mBoundVertexArray->HasAttrib(i) && mBoundVertexArray->mAttribs[i].buf == buffer)
             mBoundVertexArray->mAttribs[i].buf = nullptr;
     }
@@ -428,17 +428,17 @@ WebGLContext::ValidateBufferUsageEnum(GL
 WebGLRefPtr<WebGLBuffer>*
 WebGLContext::GetBufferSlotByTarget(GLenum target, const char* infos)
 {
     switch (target) {
         case LOCAL_GL_ARRAY_BUFFER:
             return &mBoundArrayBuffer;
 
         case LOCAL_GL_ELEMENT_ARRAY_BUFFER:
-            return &mBoundVertexArray->mBoundElementArrayBuffer;
+            return &mBoundVertexArray->mElementArrayBuffer;
 
         case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER:
             if (!IsWebGL2()) {
                 break;
             }
             return &mBoundTransformFeedbackBuffer;
 
         default:
@@ -482,17 +482,17 @@ WebGLContext::CheckedBufferData(GLenum t
         GenerateWarning("Rejecting valid bufferData call with size %lu to avoid a Mac bug", size);
         return LOCAL_GL_INVALID_VALUE;
     }
 #endif
     WebGLBuffer *boundBuffer = nullptr;
     if (target == LOCAL_GL_ARRAY_BUFFER) {
         boundBuffer = mBoundArrayBuffer;
     } else if (target == LOCAL_GL_ELEMENT_ARRAY_BUFFER) {
-        boundBuffer = mBoundVertexArray->mBoundElementArrayBuffer;
+        boundBuffer = mBoundVertexArray->mElementArrayBuffer;
     }
     MOZ_ASSERT(boundBuffer != nullptr, "no buffer bound for this target");
 
     bool sizeChanges = uint32_t(size) != boundBuffer->ByteLength();
     if (sizeChanges) {
         GetAndFlushUnderlyingGLErrors();
         gl->fBufferData(target, size, data, usage);
         GLenum error = GetAndFlushUnderlyingGLErrors();
--- a/content/canvas/src/WebGLContextDraw.cpp
+++ b/content/canvas/src/WebGLContextDraw.cpp
@@ -214,22 +214,22 @@ WebGLContext::DrawElements_check(GLsizei
     }
 
     // Any checks below this depend on a program being available.
     if (!mCurrentProgram) {
         ErrorInvalidOperation("%s: null CURRENT_PROGRAM", info);
         return false;
     }
 
-    if (!mBoundVertexArray->mBoundElementArrayBuffer) {
+    if (!mBoundVertexArray->mElementArrayBuffer) {
         ErrorInvalidOperation("%s: must have element array buffer binding", info);
         return false;
     }
 
-    WebGLBuffer& elemArrayBuffer = *mBoundVertexArray->mBoundElementArrayBuffer;
+    WebGLBuffer& elemArrayBuffer = *mBoundVertexArray->mElementArrayBuffer;
 
     if (!elemArrayBuffer.ByteLength()) {
         ErrorInvalidOperation("%s: bound element array buffer doesn't have any data", info);
         return false;
     }
 
     CheckedInt<GLsizei> checked_neededByteCount = checked_byteCount.toChecked<GLsizei>() + byteOffset;
 
--- a/content/canvas/src/WebGLContextState.cpp
+++ b/content/canvas/src/WebGLContextState.cpp
@@ -418,17 +418,17 @@ WebGLContext::GetParameter(JSContext* cx
         case LOCAL_GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: {
             if (!IsWebGL2()) {
                 break;
             }
             return WebGLObjectAsJSValue(cx, mBoundTransformFeedbackBuffer.get(), rv);
         }
 
         case LOCAL_GL_ELEMENT_ARRAY_BUFFER_BINDING: {
-            return WebGLObjectAsJSValue(cx, mBoundVertexArray->mBoundElementArrayBuffer.get(), rv);
+            return WebGLObjectAsJSValue(cx, mBoundVertexArray->mElementArrayBuffer.get(), rv);
         }
 
         case LOCAL_GL_RENDERBUFFER_BINDING: {
             return WebGLObjectAsJSValue(cx, mBoundRenderbuffer.get(), rv);
         }
 
         case LOCAL_GL_FRAMEBUFFER_BINDING: {
             return WebGLObjectAsJSValue(cx, mBoundFramebuffer.get(), rv);
--- a/content/canvas/src/WebGLContextUtils.cpp
+++ b/content/canvas/src/WebGLContextUtils.cpp
@@ -520,17 +520,17 @@ WebGLContext::AssertCachedBindings()
     bound = curTex ? curTex->GLName() : 0;
     AssertUintParamCorrect(gl, LOCAL_GL_TEXTURE_BINDING_CUBE_MAP, bound);
 
     // Buffers
     bound = mBoundArrayBuffer ? mBoundArrayBuffer->GLName() : 0;
     AssertUintParamCorrect(gl, LOCAL_GL_ARRAY_BUFFER_BINDING, bound);
 
     MOZ_ASSERT(mBoundVertexArray);
-    WebGLBuffer* curBuff = mBoundVertexArray->mBoundElementArrayBuffer;
+    WebGLBuffer* curBuff = mBoundVertexArray->mElementArrayBuffer;
     bound = curBuff ? curBuff->GLName() : 0;
     AssertUintParamCorrect(gl, LOCAL_GL_ELEMENT_ARRAY_BUFFER_BINDING, bound);
 
     MOZ_ASSERT(!GetAndFlushUnderlyingGLErrors());
 #endif
 }
 
 void
--- a/content/canvas/src/WebGLContextValidate.cpp
+++ b/content/canvas/src/WebGLContextValidate.cpp
@@ -1783,14 +1783,14 @@ WebGLContext::InitAndValidateGL()
     nsCOMPtr<nsIObserverService> observerService
         = mozilla::services::GetObserverService();
     if (observerService) {
         observerService->AddObserver(mMemoryPressureObserver,
                                      "memory-pressure",
                                      false);
     }
 
-    mDefaultVertexArray = new WebGLVertexArray(this);
+    mDefaultVertexArray = WebGLVertexArray::Create(this);
     mDefaultVertexArray->mAttribs.SetLength(mGLMaxVertexAttribs);
     mBoundVertexArray = mDefaultVertexArray;
 
     return true;
 }
--- a/content/canvas/src/WebGLContextVertexArray.cpp
+++ b/content/canvas/src/WebGLContextVertexArray.cpp
@@ -31,38 +31,34 @@ WebGLContext::BindVertexArray(WebGLVerte
         return;
     }
 
     InvalidateBufferFetching();
 
     MakeContextCurrent();
 
     if (array) {
-        gl->fBindVertexArray(array->GLName());
-        array->SetHasEverBeenBound(true);
         mBoundVertexArray = array;
-    }
-    else {
-        gl->fBindVertexArray(0);
+    } else {
         mBoundVertexArray = mDefaultVertexArray;
     }
+
+    mBoundVertexArray->BindVertexArray();
 }
 
 already_AddRefed<WebGLVertexArray>
 WebGLContext::CreateVertexArray()
 {
     if (IsContextLost())
         return nullptr;
 
-    nsRefPtr<WebGLVertexArray> globj = new WebGLVertexArray(this);
+    nsRefPtr<WebGLVertexArray> globj = WebGLVertexArray::Create(this);
 
     MakeContextCurrent();
-    gl->fGenVertexArrays(1, &globj->mGLName);
-
-    mVertexArrays.insertBack(globj);
+    globj->GenVertexArray();
 
     return globj.forget();
 }
 
 void
 WebGLContext::DeleteVertexArray(WebGLVertexArray *array)
 {
     if (IsContextLost())
--- a/content/canvas/src/WebGLExtensionVertexArray.cpp
+++ b/content/canvas/src/WebGLExtensionVertexArray.cpp
@@ -56,14 +56,14 @@ void WebGLExtensionVertexArray::BindVert
     if (mIsLost)
         return mContext->ErrorInvalidOperation("bindVertexArrayOES: Extension is lost.");
 
     mContext->BindVertexArray(array);
 }
 
 bool WebGLExtensionVertexArray::IsSupported(const WebGLContext* context)
 {
-    gl::GLContext* gl = context->GL();
-
-    return gl->IsSupported(gl::GLFeature::vertex_array_object);
+    // If it is not supported then it's emulated, therefore it's always 'supported'
+    // See - WebGLVertexArrayFake.h/cpp for the emulation
+    return true;
 }
 
 IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionVertexArray)
--- a/content/canvas/src/WebGLVertexArray.cpp
+++ b/content/canvas/src/WebGLVertexArray.cpp
@@ -1,48 +1,63 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "WebGLVertexArray.h"
+
 #include "WebGLContext.h"
 #include "WebGLBuffer.h"
-#include "WebGLVertexArray.h"
+#include "WebGLVertexArrayGL.h"
+#include "WebGLVertexArrayFake.h"
 #include "mozilla/dom/WebGLRenderingContextBinding.h"
 #include "GLContext.h"
 
 using namespace mozilla;
 
 JSObject*
 WebGLVertexArray::WrapObject(JSContext *cx) {
     return dom::WebGLVertexArrayBinding::Wrap(cx, this);
 }
 
 WebGLVertexArray::WebGLVertexArray(WebGLContext* context)
     : WebGLContextBoundObject(context)
     , mGLName(0)
     , mHasEverBeenBound(false)
 {
     SetIsDOMBinding();
+    context->mVertexArrays.insertBack(this);
 }
 
-void WebGLVertexArray::Delete() {
-    if (mGLName != 0) {
-        mBoundElementArrayBuffer = nullptr;
-
-        mContext->MakeContextCurrent();
-        mContext->gl->fDeleteVertexArrays(1, &mGLName);
-        LinkedListElement<WebGLVertexArray>::removeFrom(mContext->mVertexArrays);
+WebGLVertexArray*
+WebGLVertexArray::Create(WebGLContext* context)
+{
+    WebGLVertexArray* array;
+    if (context->gl->IsSupported(gl::GLFeature::vertex_array_object)) {
+        array = new WebGLVertexArrayGL(context);
+    } else {
+        array = new WebGLVertexArrayFake(context);
     }
 
-    mBoundElementArrayBuffer = nullptr;
+    return array;
+}
+
+void
+WebGLVertexArray::Delete()
+{
+    DeleteImpl();
+
+    LinkedListElement<WebGLVertexArray>::removeFrom(mContext->mVertexArrays);
+    mElementArrayBuffer = nullptr;
     mAttribs.Clear();
 }
 
-bool WebGLVertexArray::EnsureAttrib(GLuint index, const char *info)
+bool
+WebGLVertexArray::EnsureAttrib(GLuint index, const char *info)
 {
     if (index >= GLuint(mContext->mGLMaxVertexAttribs)) {
         if (index == GLuint(-1)) {
             mContext->ErrorInvalidValue("%s: index -1 is invalid. That probably comes from a getAttribLocation() call, "
                                         "where this return value -1 means that the passed name didn't correspond to an active attribute in "
                                         "the specified program.", info);
         } else {
             mContext->ErrorInvalidValue("%s: index %d is out of range", info, index);
@@ -53,12 +68,12 @@ bool WebGLVertexArray::EnsureAttrib(GLui
         mAttribs.SetLength(index + 1);
     }
 
     return true;
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLVertexArray,
   mAttribs,
-  mBoundElementArrayBuffer)
+  mElementArrayBuffer)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLVertexArray, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLVertexArray, Release)
--- a/content/canvas/src/WebGLVertexArray.h
+++ b/content/canvas/src/WebGLVertexArray.h
@@ -11,79 +11,84 @@
 #include "WebGLVertexAttribData.h"
 
 #include "nsWrapperCache.h"
 
 #include "mozilla/LinkedList.h"
 
 namespace mozilla {
 
-class WebGLVertexArray MOZ_FINAL
+class WebGLVertexArray
     : public nsWrapperCache
     , public WebGLRefCountedObject<WebGLVertexArray>
     , public LinkedListElement<WebGLVertexArray>
     , public WebGLContextBoundObject
 {
 // -----------------------------------------------------------------------------
 // PUBLIC
 public:
+    static WebGLVertexArray* Create(WebGLContext* context);
+
+    void BindVertexArray() {
+        SetHasEverBeenBound(true);
+        BindVertexArrayImpl();
+    };
+
+    virtual void GenVertexArray() = 0;
+    virtual void BindVertexArrayImpl() = 0;
+
+    GLuint GLName() const { return mGLName; }
 
     // -------------------------------------------------------------------------
-    // CONSTRUCTOR & DESTRUCTOR
-
-    WebGLVertexArray(WebGLContext *context);
-
-    ~WebGLVertexArray() {
-        DeleteOnce();
-    };
-
-
-    // -------------------------------------------------------------------------
-    // IMPLMENET PARENT CLASSES
+    // IMPLEMENT PARENT CLASSES
 
     void Delete();
 
+    virtual void DeleteImpl() = 0;
+
     WebGLContext* GetParentObject() const {
         return Context();
     }
 
     virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
 
     NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLVertexArray)
     NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLVertexArray)
 
-
     // -------------------------------------------------------------------------
     // MEMBER FUNCTIONS
 
     bool HasEverBeenBound() { return mHasEverBeenBound; }
     void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
-    GLuint GLName() const { return mGLName; }
 
     bool EnsureAttrib(GLuint index, const char *info);
     bool HasAttrib(GLuint index) {
         return index < mAttribs.Length();
     }
     bool IsAttribArrayEnabled(GLuint index) {
         return HasAttrib(index) && mAttribs[index].enabled;
     }
 
 
 // -----------------------------------------------------------------------------
-// PRIVATE
-private:
+// PROTECTED
+protected:
+    WebGLVertexArray(WebGLContext* context);
+
+    virtual ~WebGLVertexArray() {
+        MOZ_ASSERT(IsDeleted());
+    };
 
     // -------------------------------------------------------------------------
     // MEMBERS
 
     GLuint mGLName;
     bool mHasEverBeenBound;
     nsTArray<WebGLVertexAttribData> mAttribs;
-    WebGLRefPtr<WebGLBuffer> mBoundElementArrayBuffer;
-
+    WebGLRefPtr<WebGLBuffer> mElementArrayBuffer;
 
     // -------------------------------------------------------------------------
     // FRIENDSHIPS
 
     friend class WebGLContext;
 };
 
 } // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/canvas/src/WebGLVertexArrayFake.cpp
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "WebGLVertexArrayFake.h"
+
+#include "WebGLContext.h"
+#include "GLContext.h"
+
+namespace mozilla {
+
+void
+WebGLVertexArrayFake::BindVertexArrayImpl()
+{
+    // Go through and re-bind all buffers and setup all
+    // vertex attribute pointers
+    gl::GLContext* gl = mContext->gl;
+
+    WebGLRefPtr<WebGLBuffer> prevBuffer = mContext->mBoundArrayBuffer;
+    mContext->BindBuffer(LOCAL_GL_ELEMENT_ARRAY_BUFFER, mElementArrayBuffer);
+
+    for (size_t i = 0; i < mAttribs.Length(); ++i) {
+        const WebGLVertexAttribData& vd = mAttribs[i];
+
+        mContext->BindBuffer(LOCAL_GL_ARRAY_BUFFER, vd.buf);
+
+        gl->fVertexAttribPointer(i, vd.size, vd.type, vd.normalized,
+                                 vd.stride, reinterpret_cast<void*>(vd.byteOffset));
+
+        if (vd.enabled) {
+            gl->fEnableVertexAttribArray(i);
+        } else {
+            gl->fDisableVertexAttribArray(i);
+        }
+    }
+
+    mContext->BindBuffer(LOCAL_GL_ARRAY_BUFFER, prevBuffer);
+}
+
+} // namespace mozilla
+
new file mode 100644
--- /dev/null
+++ b/content/canvas/src/WebGLVertexArrayFake.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef WEBGLVERTEXARRAYFAKE_H_
+#define WEBGLVERTEXARRAYFAKE_H_
+
+#include "WebGLVertexArray.h"
+
+namespace mozilla {
+
+class WebGLVertexArrayFake MOZ_FINAL
+    : public WebGLVertexArray
+{
+public:
+    virtual void BindVertexArrayImpl() MOZ_OVERRIDE;
+    virtual void DeleteImpl() MOZ_OVERRIDE { };
+    virtual void GenVertexArray() MOZ_OVERRIDE { };
+
+private:
+    WebGLVertexArrayFake(WebGLContext *context)
+        : WebGLVertexArray(context)
+    { }
+
+    ~WebGLVertexArrayFake() {
+        DeleteOnce();
+    }
+
+    friend class WebGLVertexArray;
+};
+
+} // namespace mozilla
+
+#endif
new file mode 100644
--- /dev/null
+++ b/content/canvas/src/WebGLVertexArrayGL.cpp
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "WebGLVertexArrayGL.h"
+
+#include "WebGLContext.h"
+#include "GLContext.h"
+
+namespace mozilla {
+
+void
+WebGLVertexArrayGL::DeleteImpl()
+{
+    mElementArrayBuffer = nullptr;
+
+    mContext->MakeContextCurrent();
+    mContext->gl->fDeleteVertexArrays(1, &mGLName);
+}
+
+void
+WebGLVertexArrayGL::BindVertexArrayImpl()
+{
+    mContext->gl->fBindVertexArray(mGLName);
+}
+
+void
+WebGLVertexArrayGL::GenVertexArray()
+{
+    mContext->gl->fGenVertexArrays(1, &mGLName);
+}
+
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/canvas/src/WebGLVertexArrayGL.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef WEBGLVERTEXARRAYGL_H_
+#define WEBGLVERTEXARRAYGL_H_
+
+#include "WebGLVertexArray.h"
+
+namespace mozilla {
+
+class WebGLVertexArrayGL MOZ_FINAL
+    : public WebGLVertexArray
+{
+public:
+    virtual void DeleteImpl() MOZ_OVERRIDE;
+    virtual void BindVertexArrayImpl() MOZ_OVERRIDE;
+    virtual void GenVertexArray() MOZ_OVERRIDE;
+
+private:
+    WebGLVertexArrayGL(WebGLContext* context)
+        : WebGLVertexArray(context)
+    { }
+
+    ~WebGLVertexArrayGL() {
+        DeleteOnce();
+    }
+
+    friend class WebGLVertexArray;
+};
+
+} // namespace mozilla
+
+#endif
--- a/content/canvas/src/moz.build
+++ b/content/canvas/src/moz.build
@@ -74,16 +74,18 @@ if CONFIG['MOZ_WEBGL']:
         'WebGLQuery.cpp',
         'WebGLRenderbuffer.cpp',
         'WebGLShader.cpp',
         'WebGLShaderPrecisionFormat.cpp',
         'WebGLTexelConversions.cpp',
         'WebGLTexture.cpp',
         'WebGLUniformLocation.cpp',
         'WebGLVertexArray.cpp',
+        'WebGLVertexArrayFake.cpp',
+        'WebGLVertexArrayGL.cpp',
     ]
     LOCAL_INCLUDES += [
         '/js/xpconnect/wrappers',
     ]
 else:
     UNIFIED_SOURCES += [
         'WebGLContextNotSupported.cpp',
     ]