Bug 1110120 - Remove use of UniquePtr for XFB and UB tracking.; r=smaug

This commit is contained in:
Dan Glastonbury 2015-02-09 00:13:00 +10:00
parent 7928e6f748
commit c252976203
3 changed files with 6 additions and 16 deletions

View File

@ -141,15 +141,11 @@ WebGLContext::InitWebGL2()
gl->GetUIntegerv(LOCAL_GL_MAX_UNIFORM_BUFFER_BINDINGS,
&mGLMaxUniformBufferBindings);
mBoundTransformFeedbackBuffers =
MakeUnique<WebGLRefPtr<WebGLBuffer>[]>(mGLMaxTransformFeedbackSeparateAttribs);
mBoundUniformBuffers =
MakeUnique<WebGLRefPtr<WebGLBuffer>[]>(mGLMaxUniformBufferBindings);
mBoundTransformFeedbackBuffers.SetLength(mGLMaxTransformFeedbackSeparateAttribs);
mBoundUniformBuffers.SetLength(mGLMaxUniformBufferBindings);
mDefaultTransformFeedback = new WebGLTransformFeedback(this, 0);
mBoundTransformFeedback = mDefaultTransformFeedback;
auto xfBuffers = new WebGLRefPtr<WebGLBuffer>[mGLMaxTransformFeedbackSeparateAttribs];
mBoundTransformFeedbackBuffers.reset(xfBuffers);
mBypassShaderValidation = true;

View File

@ -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();

View File

@ -926,8 +926,8 @@ protected:
WebGLRefPtr<WebGLBuffer> mBoundTransformFeedbackBuffer;
WebGLRefPtr<WebGLBuffer> mBoundUniformBuffer;
UniquePtr<WebGLRefPtr<WebGLBuffer>[]> mBoundUniformBuffers;
UniquePtr<WebGLRefPtr<WebGLBuffer>[]> mBoundTransformFeedbackBuffers;
nsTArray<WebGLRefPtr<WebGLBuffer>> mBoundUniformBuffers;
nsTArray<WebGLRefPtr<WebGLBuffer>> mBoundTransformFeedbackBuffers;
WebGLRefPtr<WebGLBuffer>& GetBufferSlotByTarget(GLenum target);
WebGLRefPtr<WebGLBuffer>& GetBufferSlotByTargetIndexed(GLenum target,