Chromium Code Reviews| Index: Source/core/html/canvas/WebGL2RenderingContextBase.cpp |
| diff --git a/Source/core/html/canvas/WebGL2RenderingContextBase.cpp b/Source/core/html/canvas/WebGL2RenderingContextBase.cpp |
| index 4e025b4acbe8da5f8e6ac892706f3ae99d8f4600..0e3806889ccdcaa08b89a67dde2649426da35748 100644 |
| --- a/Source/core/html/canvas/WebGL2RenderingContextBase.cpp |
| +++ b/Source/core/html/canvas/WebGL2RenderingContextBase.cpp |
| @@ -21,7 +21,7 @@ |
| #include "core/html/canvas/WebGLTexture.h" |
| #include "core/html/canvas/WebGLTransformFeedback.h" |
| #include "core/html/canvas/WebGLUniformLocation.h" |
| -#include "core/html/canvas/WebGLVertexArrayObjectOES.h" |
| +#include "core/html/canvas/WebGLVertexArrayObject.h" |
| #include "platform/NotImplemented.h" |
| @@ -62,6 +62,15 @@ void WebGL2RenderingContextBase::initializeNewContext() |
| m_max3DTextureLevel = WebGLTexture::computeLevelCount(m_max3DTextureSize, m_max3DTextureSize, m_max3DTextureSize); |
| WebGLRenderingContextBase::initializeNewContext(); |
| + |
| + // Release WebGLVertexArrayObjectOES which is initialized at WebGLRenderingContextBase. |
|
bajones
2015/05/26 16:45:50
Rather than allocate/release/allocate again could
legend
2015/05/27 02:05:46
Done. Since m_defaultVertexArrayObject constructor
|
| + // Then change to use WebGLVertexArrayObject for WebGL2RenderingContextBase only. |
| + removeContextObject(m_defaultVertexArrayObject.get()); |
| + m_defaultVertexArrayObject = nullptr; |
| + m_boundVertexArrayObject = nullptr; |
| + m_defaultVertexArrayObject = WebGLVertexArrayObject::create(this, WebGLVertexArrayObjectImpl::VaoTypeDefault); |
| + addContextObject(m_defaultVertexArrayObject.get()); |
| + m_boundVertexArrayObject = m_defaultVertexArrayObject; |
| } |
| void WebGL2RenderingContextBase::copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) |
| @@ -1374,17 +1383,17 @@ void WebGL2RenderingContextBase::uniformBlockBinding(WebGLProgram* program, GLui |
| webContext()->uniformBlockBinding(objectOrZero(program), uniformBlockIndex, uniformBlockBinding); |
| } |
| -PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> WebGL2RenderingContextBase::createVertexArray() |
| +PassRefPtrWillBeRawPtr<WebGLVertexArrayObject> WebGL2RenderingContextBase::createVertexArray() |
| { |
| if (isContextLost()) |
| return nullptr; |
| - RefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> o = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectOES::VaoTypeUser); |
| + RefPtrWillBeRawPtr<WebGLVertexArrayObject> o = WebGLVertexArrayObject::create(this, WebGLVertexArrayObjectImpl::VaoTypeUser); |
| addContextObject(o.get()); |
| return o.release(); |
| } |
| -void WebGL2RenderingContextBase::deleteVertexArray(WebGLVertexArrayObjectOES* vertexArray) |
| +void WebGL2RenderingContextBase::deleteVertexArray(WebGLVertexArrayObject* vertexArray) |
| { |
| if (isContextLost() || !vertexArray) |
| return; |
| @@ -1395,7 +1404,7 @@ void WebGL2RenderingContextBase::deleteVertexArray(WebGLVertexArrayObjectOES* ve |
| vertexArray->deleteObject(webContext()); |
| } |
| -GLboolean WebGL2RenderingContextBase::isVertexArray(WebGLVertexArrayObjectOES* vertexArray) |
| +GLboolean WebGL2RenderingContextBase::isVertexArray(WebGLVertexArrayObject* vertexArray) |
| { |
| if (isContextLost() || !vertexArray) |
| return 0; |
| @@ -1406,7 +1415,7 @@ GLboolean WebGL2RenderingContextBase::isVertexArray(WebGLVertexArrayObjectOES* v |
| return webContext()->isVertexArrayOES(vertexArray->object()); |
| } |
| -void WebGL2RenderingContextBase::bindVertexArray(WebGLVertexArrayObjectOES* vertexArray) |
| +void WebGL2RenderingContextBase::bindVertexArray(WebGLVertexArrayObject* vertexArray) |
| { |
| if (isContextLost()) |
| return; |