Bug 1167504 - Part 5: Remove BindableName - Transform Feedback. r=jgilbert
authorDan Glastonbury <dglastonbury@mozilla.com>
Thu, 21 May 2015 09:57:48 +1000
changeset 247873 0696e1f508f3da0670f403aa4e7b02798a95c184
parent 247872 8f4e5ac93a6bcd03d13bc259651fea59320cdc07
child 247874 3b85d8441047756a0ce439ab50f8671c6e851318
push id28885
push usercbook@mozilla.com
push dateWed, 10 Jun 2015 13:18:59 +0000
treeherderautoland@e101c589c242 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1167504
milestone41.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 1167504 - Part 5: Remove BindableName - Transform Feedback. r=jgilbert
dom/canvas/WebGL2ContextTransformFeedback.cpp
dom/canvas/WebGLTransformFeedback.cpp
dom/canvas/WebGLTransformFeedback.h
--- a/dom/canvas/WebGL2ContextTransformFeedback.cpp
+++ b/dom/canvas/WebGL2ContextTransformFeedback.cpp
@@ -55,17 +55,17 @@ WebGL2Context::IsTransformFeedback(WebGL
 
     if (!ValidateObjectAllowDeleted("isTransformFeedback", tf))
         return false;
 
     if (tf->IsDeleted())
         return false;
 
     MakeContextCurrent();
-    return gl->fIsTransformFeedback(tf->GLName());
+    return gl->fIsTransformFeedback(tf->mGLName);
 }
 
 void
 WebGL2Context::BindTransformFeedback(GLenum target, WebGLTransformFeedback* tf)
 {
     if (IsContextLost())
         return;
 
@@ -79,21 +79,18 @@ WebGL2Context::BindTransformFeedback(GLe
     if (currentTF && currentTF->mIsActive && !currentTF->mIsPaused) {
         return ErrorInvalidOperation("bindTransformFeedback: Currently bound transform "
                                      "feedback is active and not paused");
     }
 
     if (tf && tf->IsDeleted())
         return ErrorInvalidOperation("bindTransformFeedback: Attempt to bind deleted id");
 
-    if (tf)
-        tf->BindTo(LOCAL_GL_TRANSFORM_FEEDBACK);
-
     MakeContextCurrent();
-    gl->fBindTransformFeedback(target, tf ? tf->GLName() : 0);
+    gl->fBindTransformFeedback(target, tf ? tf->mGLName : 0);
     if (tf)
         mBoundTransformFeedback = tf;
     else
         mBoundTransformFeedback = mDefaultTransformFeedback;
 }
 
 void
 WebGL2Context::BeginTransformFeedback(GLenum primitiveMode)
--- a/dom/canvas/WebGLTransformFeedback.cpp
+++ b/dom/canvas/WebGLTransformFeedback.cpp
@@ -8,18 +8,18 @@
 #include "GLContext.h"
 #include "mozilla/dom/WebGL2RenderingContextBinding.h"
 #include "WebGL2Context.h"
 
 namespace mozilla {
 
 WebGLTransformFeedback::WebGLTransformFeedback(WebGLContext* webgl,
                                                GLuint tf)
-    : WebGLBindableName<GLenum>(tf)
-    , WebGLContextBoundObject(webgl)
+    : WebGLContextBoundObject(webgl)
+    , mGLName(tf)
     , mMode(LOCAL_GL_NONE)
     , mIsActive(false)
     , mIsPaused(false)
 {
     mContext->mTransformFeedbacks.insertBack(this);
 }
 
 WebGLTransformFeedback::~WebGLTransformFeedback()
--- a/dom/canvas/WebGLTransformFeedback.h
+++ b/dom/canvas/WebGLTransformFeedback.h
@@ -3,43 +3,44 @@
  * 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 WEBGL_TRANSFORM_FEEDBACK_H_
 #define WEBGL_TRANSFORM_FEEDBACK_H_
 
 #include "mozilla/LinkedList.h"
 #include "nsWrapperCache.h"
-#include "WebGLBindableName.h"
 #include "WebGLObjectModel.h"
 
 namespace mozilla {
 
 class WebGLTransformFeedback final
     : public nsWrapperCache
-    , public WebGLBindableName<GLenum>
     , public WebGLRefCountedObject<WebGLTransformFeedback>
     , public LinkedListElement<WebGLTransformFeedback>
     , public WebGLContextBoundObject
 {
     friend class WebGLContext;
     friend class WebGL2Context;
 
 public:
     explicit WebGLTransformFeedback(WebGLContext* webgl, GLuint tf);
 
     void Delete();
     WebGLContext* GetParentObject() const;
     virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
 
+    const GLuint mGLName;
+
     NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTransformFeedback)
     NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTransformFeedback)
 
 private:
     ~WebGLTransformFeedback();
+
     GLenum mMode;
     bool mIsActive;
     bool mIsPaused;
 };
 
 } // namespace mozilla
 
 #endif // WEBGL_TRANSFORM_FEEDBACK_H_