diff --git a/dom/canvas/WebGL2Context.cpp b/dom/canvas/WebGL2Context.cpp index 635f1d56a95..fb6b4a39588 100644 --- a/dom/canvas/WebGL2Context.cpp +++ b/dom/canvas/WebGL2Context.cpp @@ -141,15 +141,11 @@ WebGLContext::InitWebGL2() gl->GetUIntegerv(LOCAL_GL_MAX_UNIFORM_BUFFER_BINDINGS, &mGLMaxUniformBufferBindings); - mBoundTransformFeedbackBuffers = - MakeUnique[]>(mGLMaxTransformFeedbackSeparateAttribs); - mBoundUniformBuffers = - MakeUnique[]>(mGLMaxUniformBufferBindings); + mBoundTransformFeedbackBuffers.SetLength(mGLMaxTransformFeedbackSeparateAttribs); + mBoundUniformBuffers.SetLength(mGLMaxUniformBufferBindings); mDefaultTransformFeedback = new WebGLTransformFeedback(this, 0); mBoundTransformFeedback = mDefaultTransformFeedback; - auto xfBuffers = new WebGLRefPtr[mGLMaxTransformFeedbackSeparateAttribs]; - mBoundTransformFeedbackBuffers.reset(xfBuffers); mBypassShaderValidation = true; diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index b7655d2a4c3..ff74e021ddf 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -342,14 +342,8 @@ WebGLContext::DestroyResourcesAndContext() mBoundTransformFeedback = nullptr; mDefaultTransformFeedback = nullptr; - if (mBoundTransformFeedbackBuffers) { - for (GLuint i = 0; i < mGLMaxTransformFeedbackSeparateAttribs; i++) { - mBoundTransformFeedbackBuffers[i] = nullptr; - } - } - - for (GLuint i = 0; i < mGLMaxUniformBufferBindings; i++) - mBoundUniformBuffers[i] = nullptr; + mBoundTransformFeedbackBuffers.Clear(); + mBoundUniformBuffers.Clear(); while (!mTextures.isEmpty()) mTextures.getLast()->DeleteOnce(); diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index fc7fb718258..d4a92637158 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -926,8 +926,8 @@ protected: WebGLRefPtr mBoundTransformFeedbackBuffer; WebGLRefPtr mBoundUniformBuffer; - UniquePtr[]> mBoundUniformBuffers; - UniquePtr[]> mBoundTransformFeedbackBuffers; + nsTArray> mBoundUniformBuffers; + nsTArray> mBoundTransformFeedbackBuffers; WebGLRefPtr& GetBufferSlotByTarget(GLenum target); WebGLRefPtr& GetBufferSlotByTargetIndexed(GLenum target,