Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: Source/modules/webgl/WebGLVertexArrayObjectBase.cpp

Issue 1234883002: [Oilpan] Migrate classes under module/webgl onto oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & work for some comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/webgl/WebGLVertexArrayObjectBase.cpp
diff --git a/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp b/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp
index 5f3d0c2ae6d61eff2c86d4bd3f2caebb5dcc2a0c..f2476b59690de0cb4c0bdb08676b8d26ba4e8d67 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
+ // objects must not be accessed during destruction.
+ // They could have been already finalized. The finalizers
// of these objects (and their elements) will themselves handle
// detachment.
- if (!m_destructionInProgress)
- dispatchDetached(context3d);
-#else
dispatchDetached(context3d);
haraken 2015/08/05 04:12:19 You need the if(m_destructionInProgress) check.
peria 2015/08/06 05:47:00 Done.
-#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;

Powered by Google App Engine
This is Rietveld 408576698