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

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 1157983002: Update WebGLVertexArrayObjectOES to WebGLVertexArrayObject for WebGL2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix crash in testing conformance/context/context-lost-restored.html Created 5 years, 7 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/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)
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContextBase.h ('k') | Source/core/html/canvas/WebGLVertexArrayObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698