Chromium Code Reviews| Index: Source/modules/webgl/WebGLVertexArrayObjectBase.cpp |
| diff --git a/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp b/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp |
| index 5f3d0c2ae6d61eff2c86d4bd3f2caebb5dcc2a0c..4e0b56e2aa8838611d7c075ce3cef8a66197ce03 100644 |
| --- a/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp |
| +++ b/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp |
| @@ -15,9 +15,7 @@ WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase |
| , m_object(0) |
| , m_type(type) |
| , m_hasEverBeenBound(false) |
| -#if ENABLE(OILPAN) |
| , m_destructionInProgress(false) |
| -#endif |
| , m_boundElementArrayBuffer(nullptr) |
| { |
| m_vertexAttribState.reserveCapacity(ctx->maxVertexAttribs()); |
| @@ -33,18 +31,12 @@ WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase |
| WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase() |
| { |
| -#if ENABLE(OILPAN) |
| m_destructionInProgress = true; |
| -#endif |
| - |
| - // Delete the platform framebuffer resource. Explicit detachment |
| - // is for the benefit of Oilpan, where this vertex array object |
| - // isn't detached when it and the WebGLRenderingContextBase object |
| - // it is registered with are both finalized. Without Oilpan, the |
| - // object will have been detached. |
| - // |
| - // To keep the code regular, the trivial detach()ment is always |
| - // performed. |
| + |
| + // Delete the platform framebuffer resource, in case |
| + // where this vertex array object isn't detached when it and |
| + // the WebGLRenderingContextBase object it is registered with |
| + // are both finalized. |
| detachAndDeleteObject(); |
| } |
| @@ -71,20 +63,15 @@ void WebGLVertexArrayObjectBase::deleteObjectImpl(WebGraphicsContext3D* context3 |
| break; |
| } |
| -#if ENABLE(OILPAN) |
| - // These m_boundElementArrayBuffer and m_vertexAttribState heap |
| - // objects must not be accessed during destruction in the oilpan |
| - // build. They could have been already finalized. The finalizers |
| - // of these objects (and their elements) will themselves handle |
| - // detachment. |
| + // Member<> objects must not be accessed during the destruction, |
| + // so they could have been already finalized. |
|
bajones
2015/08/07 20:32:17
Minor grammatical nit: This should probably read "
peria
2015/08/10 03:15:23
Done.
|
| + // The finalizers of these objects will handle their detachment |
| + // by themselves. |
| if (!m_destructionInProgress) |
| dispatchDetached(context3d); |
| -#else |
| - dispatchDetached(context3d); |
| -#endif |
| } |
| -void WebGLVertexArrayObjectBase::setElementArrayBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer) |
| +void WebGLVertexArrayObjectBase::setElementArrayBuffer(WebGLBuffer* buffer) |
| { |
| if (buffer) |
| buffer->onAttached(); |
| @@ -98,12 +85,12 @@ WebGLVertexArrayObjectBase::VertexAttribState* WebGLVertexArrayObjectBase::getVe |
| ASSERT(index < context()->maxVertexAttribs()); |
| // Lazily create the vertex attribute states. |
| for (size_t i = m_vertexAttribState.size(); i <= index; i++) |
| - m_vertexAttribState.append(adoptPtrWillBeNoop(new VertexAttribState())); |
| + m_vertexAttribState.append(new VertexAttribState); |
| return m_vertexAttribState[index].get(); |
| } |
| void WebGLVertexArrayObjectBase::setVertexAttribState( |
| - GLuint index, GLsizei bytesPerElement, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset, PassRefPtrWillBeRawPtr<WebGLBuffer> buffer) |
| + GLuint index, GLsizei bytesPerElement, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset, WebGLBuffer* buffer) |
| { |
| GLsizei validatedStride = stride ? stride : bytesPerElement; |
| VertexAttribState* state = getVertexAttribState(index); |
| @@ -123,7 +110,7 @@ void WebGLVertexArrayObjectBase::setVertexAttribState( |
| state->offset = offset; |
| } |
| -void WebGLVertexArrayObjectBase::unbindBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer) |
| +void WebGLVertexArrayObjectBase::unbindBuffer(WebGLBuffer* buffer) |
| { |
| if (m_boundElementArrayBuffer == buffer) { |
| m_boundElementArrayBuffer->onDetached(context()->webContext()); |
| @@ -131,7 +118,7 @@ void WebGLVertexArrayObjectBase::unbindBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer |
| } |
| for (size_t i = 0; i < m_vertexAttribState.size(); ++i) { |
| - VertexAttribState* state = m_vertexAttribState[i].get(); |
| + VertexAttribState* state = m_vertexAttribState[i]; |
| if (state->bufferBinding == buffer) { |
| buffer->onDetached(context()->webContext()); |
| state->bufferBinding = nullptr; |