Chromium Code Reviews| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| index 81550c6b5c79f743e923a2ce6fb6608fa4b07017..2657f2b053d07dd3e3b844785038ec14315d0d9d 100644 |
| --- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| +++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
| @@ -76,6 +76,8 @@ |
| #include "core/html/canvas/WebGLSharedWebGraphicsContext3D.h" |
| #include "core/html/canvas/WebGLTexture.h" |
| #include "core/html/canvas/WebGLUniformLocation.h" |
| +#include "core/html/canvas/WebGLVertexArrayObject.h" |
| +#include "core/html/canvas/WebGLVertexArrayObjectOES.h" |
| #include "core/inspector/ConsoleMessage.h" |
| #include "core/inspector/InspectorInstrumentation.h" |
| #include "core/layout/LayoutBox.h" |
| @@ -723,7 +725,11 @@ void WebGLRenderingContextBase::initializeNewContext() |
| m_backDrawBuffer = GL_BACK; |
| - m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectOES::VaoTypeDefault); |
| + if (isWebGL2OrHigher()) { |
|
legend
2015/05/27 09:20:05
@bajones, since `if (!m_defaultVertexArrayObject)`
|
| + m_defaultVertexArrayObject = WebGLVertexArrayObject::create(this, WebGLVertexArrayObjectBase::VaoTypeDefault); |
| + } else { |
| + m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectBase::VaoTypeDefault); |
| + } |
| addContextObject(m_defaultVertexArrayObject.get()); |
| m_boundVertexArrayObject = m_defaultVertexArrayObject; |
| @@ -1869,7 +1875,7 @@ void WebGLRenderingContextBase::disableVertexAttribArray(GLuint index) |
| return; |
| } |
| - WebGLVertexArrayObjectOES::VertexAttribState* state = m_boundVertexArrayObject->getVertexAttribState(index); |
| + WebGLVertexArrayObjectBase::VertexAttribState* state = m_boundVertexArrayObject->getVertexAttribState(index); |
| state->enabled = false; |
| webContext()->disableVertexAttribArray(index); |
| @@ -1981,7 +1987,7 @@ void WebGLRenderingContextBase::enableVertexAttribArray(GLuint index) |
| return; |
| } |
| - WebGLVertexArrayObjectOES::VertexAttribState* state = m_boundVertexArrayObject->getVertexAttribState(index); |
| + WebGLVertexArrayObjectBase::VertexAttribState* state = m_boundVertexArrayObject->getVertexAttribState(index); |
| state->enabled = true; |
| webContext()->enableVertexAttribArray(index); |
| @@ -3052,7 +3058,7 @@ ScriptValue WebGLRenderingContextBase::getVertexAttrib(ScriptState* scriptState, |
| synthesizeGLError(GL_INVALID_VALUE, "getVertexAttrib", "index out of range"); |
| return ScriptValue::createNull(scriptState); |
| } |
| - const WebGLVertexArrayObjectOES::VertexAttribState* state = m_boundVertexArrayObject->getVertexAttribState(index); |
| + const WebGLVertexArrayObjectBase::VertexAttribState* state = m_boundVertexArrayObject->getVertexAttribState(index); |
| if ((extensionEnabled(ANGLEInstancedArraysName) || isWebGL2OrHigher()) |
| && pname == GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE) |