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

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: Work for 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..49ba53c46834c260a0e85b7c2109d7c872456fc2 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,9 +31,7 @@ WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase
WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase()
{
-#if ENABLE(OILPAN)
m_destructionInProgress = true;
haraken 2015/08/04 00:06:52 Instead of introducing another flag like m_destruc
peria 2015/08/04 09:10:26 will do in another CL. http://crbug.com/516613
-#endif
// Delete the platform framebuffer resource. Explicit detachment
// is for the benefit of Oilpan, where this vertex array object
@@ -71,7 +67,6 @@ 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
@@ -79,12 +74,9 @@ void WebGLVertexArrayObjectBase::deleteObjectImpl(WebGraphicsContext3D* context3
// detachment.
if (!m_destructionInProgress)
dispatchDetached(context3d);
haraken 2015/08/04 00:06:52 Sigbjorn: Do we still need to call dispatchDetache
Ken Russell (switch to Gerrit) 2015/08/04 00:34:11 One note about this. In order to maintain uniform
haraken 2015/08/04 00:47:05 Thanks for the context. I now understand why the o
sof 2015/08/04 06:20:45 Good point, I think we can remove the Oilpan speci
peria 2015/08/04 09:10:26 Acknowledged. http://crbug.com/516613
-#else
- dispatchDetached(context3d);
-#endif
}
-void WebGLVertexArrayObjectBase::setElementArrayBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer)
+void WebGLVertexArrayObjectBase::setElementArrayBuffer(WebGLBuffer* buffer)
{
if (buffer)
buffer->onAttached();
@@ -98,12 +90,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 +115,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 +123,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