<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181571] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181571">181571</a></dd>
<dt>Author</dt> <dd>roger_fong@apple.com</dd>
<dt>Date</dt> <dd>2015-03-16 12:03:26 -0700 (Mon, 16 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebGL2] Vertex Array Objects.
https://bugs.webkit.org/show_bug.cgi?id=126944.
&lt;rdar://problem/15002455&gt;
Reviewed by Dean Jackson.
Tested by a modified version of the 1.0.3 conformance test:
conformance/extensions/oes-vertex-array-object.html
This test will be landed along with other modified extension conformance tests
once approval from Khronos is received.
* html/canvas/OESVertexArrayObject.cpp: Associate extension calls only with WebGLRenderingContext.
(WebCore::OESVertexArrayObject::deleteVertexArrayOES):
(WebCore::OESVertexArrayObject::bindVertexArrayOES):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGL2RenderingContext.cpp: Implement vertex array object calls as part WebGL2 context.
(WebCore::WebGL2RenderingContext::createVertexArray):
(WebCore::WebGL2RenderingContext::deleteVertexArray):
(WebCore::WebGL2RenderingContext::isVertexArray):
(WebCore::WebGL2RenderingContext::bindVertexArray):
(WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
(WebCore::WebGL2RenderingContext::getParameter):
Duplicate extension object vertex array object extension methods in GraphicsContext3D.
Implementation may change after we upgrade to newer GL headers and profile.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createVertexArray):
(WebCore::GraphicsContext3D::deleteVertexArray):
(WebCore::GraphicsContext3D::isVertexArray):
(WebCore::GraphicsContext3D::bindVertexArray):
Have WebGLVertexArrayObjectOES and WebGLVertexArrayObject inherit from WebGLRenderingContextBase.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGLVertexArrayObject.cpp:
(WebCore::WebGLVertexArrayObject::create):
(WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Use GraphicsContext3D implementation of createVertexArray.
(WebCore::WebGLVertexArrayObject::deleteObjectImpl):
* html/canvas/WebGLVertexArrayObject.h:
* html/canvas/WebGLVertexArrayObjectBase.cpp: Added.
(WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
(WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer):
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
(WebCore::WebGLVertexArrayObjectBase::unbindBuffer):
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor):
* html/canvas/WebGLVertexArrayObjectBase.h: Added.
(WebCore::WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase):
(WebCore::WebGLVertexArrayObjectBase::VertexAttribState::VertexAttribState):
(WebCore::WebGLVertexArrayObjectBase::VertexAttribState::isBound):
(WebCore::WebGLVertexArrayObjectBase::VertexAttribState::validateBinding):
(WebCore::WebGLVertexArrayObjectBase::isDefaultObject):
(WebCore::WebGLVertexArrayObjectBase::hasEverBeenBound):
(WebCore::WebGLVertexArrayObjectBase::setHasEverBeenBound):
(WebCore::WebGLVertexArrayObjectBase::getElementArrayBuffer):
(WebCore::WebGLVertexArrayObjectBase::getVertexAttribState):
* html/canvas/WebGLVertexArrayObjectOES.cpp:
(WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
(WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
(WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): Deleted.
(WebCore::WebGLVertexArrayObjectOES::setVertexAttribState): Deleted.
(WebCore::WebGLVertexArrayObjectOES::unbindBuffer): Deleted.
(WebCore::WebGLVertexArrayObjectOES::setVertexAttribDivisor): Deleted.
* html/canvas/WebGLVertexArrayObjectOES.h:
* html/canvas/WebGLRenderingContextBase.cpp: Use WebGLVertexArrayObjectBase class.
(WebCore::WebGLRenderingContextBase::initializeNewContext):
(WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::validateVertexAttributes):
(WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::initVertexAttrib0):
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
(WebCore::WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject):
Handle construction of WebGLGetInfo using WebGLVertexArrayObject.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::toJS):
* html/canvas/WebGLGetInfo.cpp:
(WebCore::WebGLGetInfo::WebGLGetInfo):
(WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
(WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
* html/canvas/WebGLGetInfo.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasOESVertexArrayObjectcpp">trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLGetInfocpp">trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLGetInfoh">trunk/Source/WebCore/html/canvas/WebGLGetInfo.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContexth">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectcpp">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjecth">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOEScpp">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOESh">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh">trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBasecpp">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBaseh">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -1719,6 +1719,7 @@
</span><span class="cx">     html/canvas/WebGLTransformFeedback.cpp
</span><span class="cx">     html/canvas/WebGLUniformLocation.cpp
</span><span class="cx">     html/canvas/WebGLVertexArrayObject.cpp
</span><ins>+    html/canvas/WebGLVertexArrayObjectBase.cpp
</ins><span class="cx">     html/canvas/WebGLVertexArrayObjectOES.cpp
</span><span class="cx"> 
</span><span class="cx">     html/forms/FileIconLoader.cpp
</span><span class="lines">@@ -2824,6 +2825,7 @@
</span><span class="cx">         html/canvas/WebGLTransformFeedback.cpp
</span><span class="cx">         html/canvas/WebGLUniformLocation.cpp
</span><span class="cx">         html/canvas/WebGLVertexArrayObject.cpp
</span><ins>+        html/canvas/WebGLVertexArrayObjectBase.cpp
</ins><span class="cx">         html/canvas/WebGLVertexArrayObjectOES.cpp
</span><span class="cx">     )
</span><span class="cx">     list(APPEND WebCore_IDL_FILES
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/ChangeLog        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -1,3 +1,93 @@
</span><ins>+2015-03-15  Roger Fong  &lt;roger_fong@apple.com&gt;
+
+        [WebGL2] Vertex Array Objects.
+        https://bugs.webkit.org/show_bug.cgi?id=126944.
+        &lt;rdar://problem/15002455&gt;
+
+        Reviewed by Dean Jackson.
+
+        Tested by a modified version of the 1.0.3 conformance test:
+        conformance/extensions/oes-vertex-array-object.html
+        This test will be landed along with other modified extension conformance tests
+        once approval from Khronos is received.
+
+        * html/canvas/OESVertexArrayObject.cpp: Associate extension calls only with WebGLRenderingContext.
+        (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
+        (WebCore::OESVertexArrayObject::bindVertexArrayOES):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
+        (WebCore::WebGLRenderingContext::getParameter):
+        * html/canvas/WebGL2RenderingContext.cpp: Implement vertex array object calls as part WebGL2 context.
+        (WebCore::WebGL2RenderingContext::createVertexArray):
+        (WebCore::WebGL2RenderingContext::deleteVertexArray):
+        (WebCore::WebGL2RenderingContext::isVertexArray):
+        (WebCore::WebGL2RenderingContext::bindVertexArray):
+        (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
+        (WebCore::WebGL2RenderingContext::getParameter):
+
+        Duplicate extension object vertex array object extension methods in GraphicsContext3D.
+        Implementation may change after we upgrade to newer GL headers and profile.
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::createVertexArray):
+        (WebCore::GraphicsContext3D::deleteVertexArray):
+        (WebCore::GraphicsContext3D::isVertexArray):
+        (WebCore::GraphicsContext3D::bindVertexArray):
+
+        Have WebGLVertexArrayObjectOES and WebGLVertexArrayObject inherit from WebGLRenderingContextBase.
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/canvas/WebGLVertexArrayObject.cpp:
+        (WebCore::WebGLVertexArrayObject::create):
+        (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Use GraphicsContext3D implementation of createVertexArray.
+        (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
+        * html/canvas/WebGLVertexArrayObject.h:
+        * html/canvas/WebGLVertexArrayObjectBase.cpp: Added.
+        (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
+        (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer):
+        (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
+        (WebCore::WebGLVertexArrayObjectBase::unbindBuffer):
+        (WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor):
+        * html/canvas/WebGLVertexArrayObjectBase.h: Added.
+        (WebCore::WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase):
+        (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::VertexAttribState):
+        (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::isBound):
+        (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::validateBinding):
+        (WebCore::WebGLVertexArrayObjectBase::isDefaultObject):
+        (WebCore::WebGLVertexArrayObjectBase::hasEverBeenBound):
+        (WebCore::WebGLVertexArrayObjectBase::setHasEverBeenBound):
+        (WebCore::WebGLVertexArrayObjectBase::getElementArrayBuffer):
+        (WebCore::WebGLVertexArrayObjectBase::getVertexAttribState):
+        * html/canvas/WebGLVertexArrayObjectOES.cpp:
+        (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
+        (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
+        (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): Deleted.
+        (WebCore::WebGLVertexArrayObjectOES::setVertexAttribState): Deleted.
+        (WebCore::WebGLVertexArrayObjectOES::unbindBuffer): Deleted.
+        (WebCore::WebGLVertexArrayObjectOES::setVertexAttribDivisor): Deleted.
+        * html/canvas/WebGLVertexArrayObjectOES.h:
+
+        * html/canvas/WebGLRenderingContextBase.cpp: Use WebGLVertexArrayObjectBase class.
+        (WebCore::WebGLRenderingContextBase::initializeNewContext):
+        (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
+        (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
+        (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
+        (WebCore::WebGLRenderingContextBase::getVertexAttrib):
+        (WebCore::WebGLRenderingContextBase::initVertexAttrib0):
+        (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
+        (WebCore::WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation):
+        * html/canvas/WebGLRenderingContextBase.h:
+        (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject):
+
+        Handle construction of WebGLGetInfo using WebGLVertexArrayObject.
+        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
+        (WebCore::toJS):
+        * html/canvas/WebGLGetInfo.cpp:
+        (WebCore::WebGLGetInfo::WebGLGetInfo):
+        (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
+        (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
+        * html/canvas/WebGLGetInfo.h:
+
</ins><span class="cx"> 2015-03-16  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Potentially uninitialized Inspector values
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</del><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</ins><span class="cx"> &lt;Project DefaultTargets=&quot;Build&quot; ToolsVersion=&quot;12.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
</span><span class="cx">   &lt;ItemGroup Label=&quot;ProjectConfigurations&quot;&gt;
</span><span class="cx">     &lt;ProjectConfiguration Include=&quot;DebugSuffix|Win32&quot;&gt;
</span><span class="lines">@@ -6681,6 +6681,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\WebGLTransformFeedback.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\WebGLUniformLocation.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\WebGLVertexArrayObject.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\html\canvas\WebGLVertexArrayObjectBase.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\WebGLVertexArrayObjectOES.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\track\AudioTrack.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\track\AudioTrackList.cpp&quot; /&gt;
</span><span class="lines">@@ -19041,6 +19042,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\WebGLTransformFeedback.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\WebGLUniformLocation.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\WebGLVertexArrayObject.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\html\canvas\WebGLVertexArrayObjectBase.h” /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\WebGLVertexArrayObjectOES.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\track\AudioTrack.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\track\AudioTrackList.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</del><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</ins><span class="cx"> &lt;Project ToolsVersion=&quot;4.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;Filter Include=&quot;DerivedSources&quot;&gt;
</span><span class="lines">@@ -7201,6 +7201,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\WebGLTransformFeedback.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html\canvas&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\html\canvas\WebGLVertexArrayObjectBase.cpp&quot;&gt;
+      &lt;Filter&gt;html\canvas&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\html\canvas\WebGLVertexArrayObject.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html\canvas&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -15167,6 +15170,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\html\canvas\WebGLVertexArrayObject.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;html\canvas&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\html\canvas\WebGLVertexArrayObjectBase.h”&gt;
+      &lt;Filter&gt;html\canvas&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebGLQuery.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;DerivedSources&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -2325,6 +2325,7 @@
</span><span class="cx">                 6ED8C37A183BFF8C009E53BD /* BoxShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 6ED8C378183BFF8C009E53BD /* BoxShape.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6EE8A77210F803F3005A4A24 /* JSWebGLContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */; };
</span><span class="cx">                 6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */; };
</span><ins>+                6F222B761AB52D8A0094651A /* WebGLVertexArrayObjectBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6F222B751AB52D8A0094651A /* WebGLVertexArrayObjectBase.cpp */; };
</ins><span class="cx">                 6F995A151A70756200A735F4 /* WebGLSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6F995A131A70756200A735F4 /* WebGLSync.cpp */; };
</span><span class="cx">                 6F995A161A70756200A735F4 /* WebGLSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A141A70756200A735F4 /* WebGLSync.h */; };
</span><span class="cx">                 6F995A1F1A7078B100A735F4 /* WebGLQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6F995A171A7078B100A735F4 /* WebGLQuery.cpp */; };
</span><span class="lines">@@ -9523,6 +9524,8 @@
</span><span class="cx">                 6ED8C378183BFF8C009E53BD /* BoxShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BoxShape.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextAttributes.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextAttributes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                6F222B741AB52D640094651A /* WebGLVertexArrayObjectBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebGLVertexArrayObjectBase.h; path = canvas/WebGLVertexArrayObjectBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6F222B751AB52D8A0094651A /* WebGLVertexArrayObjectBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLVertexArrayObjectBase.cpp; path = canvas/WebGLVertexArrayObjectBase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 6F995A091A7070E600A735F4 /* WebGLQuery.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLQuery.idl; path = canvas/WebGLQuery.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6F995A0A1A7070E600A735F4 /* WebGLSampler.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLSampler.idl; path = canvas/WebGLSampler.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6F995A0B1A7070E600A735F4 /* WebGLSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLSync.idl; path = canvas/WebGLSync.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16039,6 +16042,8 @@
</span><span class="cx">                                 0C3F1F5910C8871200D72CE1 /* WebGLUniformLocation.idl */,
</span><span class="cx">                                 6F995A1D1A7078B100A735F4 /* WebGLVertexArrayObject.cpp */,
</span><span class="cx">                                 6F995A1E1A7078B100A735F4 /* WebGLVertexArrayObject.h */,
</span><ins>+                                6F222B751AB52D8A0094651A /* WebGLVertexArrayObjectBase.cpp */,
+                                6F222B741AB52D640094651A /* WebGLVertexArrayObjectBase.h */,
</ins><span class="cx">                                 6F995A0D1A7070E600A735F4 /* WebGLVertexArrayObject.idl */,
</span><span class="cx">                                 77A17A7412F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp */,
</span><span class="cx">                                 77A17A7512F28642004E02F6 /* WebGLVertexArrayObjectOES.h */,
</span><span class="lines">@@ -27733,6 +27738,7 @@
</span><span class="cx">                                 A8185F3F09765766005826D9 /* DocumentFragment.cpp in Sources */,
</span><span class="cx">                                 93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */,
</span><span class="cx">                                 1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */,
</span><ins>+                                6F222B761AB52D8A0094651A /* WebGLVertexArrayObjectBase.cpp in Sources */,
</ins><span class="cx">                                 861C2EA413FB4FDD00062ABB /* DocumentLoadTiming.cpp in Sources */,
</span><span class="cx">                                 A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */,
</span><span class="cx">                                 CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> #include &quot;JSWebGLShader.h&quot;
</span><span class="cx"> #include &quot;JSWebGLTexture.h&quot;
</span><span class="cx"> #include &quot;JSWebGLUniformLocation.h&quot;
</span><ins>+#include &quot;JSWebGLVertexArrayObject.h&quot;
</ins><span class="cx"> #include &quot;JSWebGLVertexArrayObjectOES.h&quot;
</span><span class="cx"> #include &quot;JSWebKitCSSMatrix.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><span class="lines">@@ -92,6 +93,7 @@
</span><span class="cx"> #include &quot;WebGLLoseContext.h&quot;
</span><span class="cx"> #include &quot;WebGLProgram.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><ins>+#include &quot;WebGLVertexArrayObject.h&quot;
</ins><span class="cx"> #include &quot;WebGLVertexArrayObjectOES.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/JSTypedArrays.h&gt;
</span><span class="lines">@@ -150,6 +152,8 @@
</span><span class="cx">         return toJS(exec, globalObject, info.getWebGLUnsignedByteArray());
</span><span class="cx">     case WebGLGetInfo::kTypeWebGLUnsignedIntArray:
</span><span class="cx">         return toJS(exec, globalObject, info.getWebGLUnsignedIntArray());
</span><ins>+    case WebGLGetInfo::kTypeWebGLVertexArrayObject:
+        return toJS(exec, globalObject, info.getWebGLVertexArrayObject());
</ins><span class="cx">     case WebGLGetInfo::kTypeWebGLVertexArrayObjectOES:
</span><span class="cx">         return toJS(exec, globalObject, info.getWebGLVertexArrayObjectOES());
</span><span class="cx">     default:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasOESVertexArrayObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;OESVertexArrayObject.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Extensions3D.h&quot;
</span><ins>+#include &quot;WebGLRenderingContext.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -52,7 +53,7 @@
</span><span class="cx">     if (m_context-&gt;isContextLost())
</span><span class="cx">         return 0;
</span><span class="cx">     
</span><del>-    RefPtr&lt;WebGLVertexArrayObjectOES&gt; o = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::VaoTypeUser);
</del><ins>+    RefPtr&lt;WebGLVertexArrayObjectOES&gt; o = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::VAOTypeUser);
</ins><span class="cx">     m_context-&gt;addContextObject(o.get());
</span><span class="cx">     return o.release();
</span><span class="cx"> }
</span><span class="lines">@@ -62,8 +63,8 @@
</span><span class="cx">     if (!arrayObject || m_context-&gt;isContextLost())
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    if (!arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject == m_context-&gt;m_boundVertexArrayObject)
-        m_context-&gt;setBoundVertexArrayObject(0);
</del><ins>+    if (!arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject == static_cast&lt;WebGLRenderingContext*&gt;(m_context)-&gt;m_boundVertexArrayObject)
+        static_cast&lt;WebGLRenderingContext*&gt;(m_context)-&gt;setBoundVertexArrayObject(0);
</ins><span class="cx"> 
</span><span class="cx">     arrayObject-&gt;deleteObject(m_context-&gt;graphicsContext3D());
</span><span class="cx"> }
</span><span class="lines">@@ -96,10 +97,10 @@
</span><span class="cx">         extensions-&gt;bindVertexArrayOES(arrayObject-&gt;object());
</span><span class="cx">         
</span><span class="cx">         arrayObject-&gt;setHasEverBeenBound();
</span><del>-        m_context-&gt;setBoundVertexArrayObject(arrayObject);
</del><ins>+        static_cast&lt;WebGLRenderingContext*&gt;(m_context)-&gt;setBoundVertexArrayObject(arrayObject);
</ins><span class="cx">     } else {
</span><span class="cx">         extensions-&gt;bindVertexArrayOES(0);
</span><del>-        m_context-&gt;setBoundVertexArrayObject(0);
</del><ins>+        static_cast&lt;WebGLRenderingContext*&gt;(m_context)-&gt;setBoundVertexArrayObject(0);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -60,15 +60,24 @@
</span><span class="cx"> WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, GraphicsContext3D::Attributes attributes)
</span><span class="cx">     : WebGLRenderingContextBase(passedCanvas, attributes)
</span><span class="cx"> {
</span><del>-    initializeShaderExtensions();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassRefPtr&lt;GraphicsContext3D&gt; context,
</span><span class="cx">     GraphicsContext3D::Attributes attributes) : WebGLRenderingContextBase(passedCanvas, context, attributes)
</span><span class="cx"> {
</span><span class="cx">     initializeShaderExtensions();
</span><ins>+    initializeVertexArrayObjects();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebGL2RenderingContext::initializeVertexArrayObjects()
+{
+    m_defaultVertexArrayObject = WebGLVertexArrayObject::create(this, WebGLVertexArrayObject::VAOTypeDefault);
+    addContextObject(m_defaultVertexArrayObject.get());
+    m_boundVertexArrayObject = m_defaultVertexArrayObject;
+    if (!isGLES2Compliant())
+        initVertexAttrib0();
+}
+
</ins><span class="cx"> void WebGL2RenderingContext::initializeShaderExtensions()
</span><span class="cx"> {
</span><span class="cx">     m_context-&gt;getExtensions()-&gt;ensureEnabled(&quot;GL_OES_standard_derivatives&quot;);
</span><span class="lines">@@ -768,23 +777,57 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;WebGLVertexArrayObject&gt; WebGL2RenderingContext::createVertexArray()
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    if (isContextLost())
+        return 0;
+    
+    RefPtr&lt;WebGLVertexArrayObject&gt; o = WebGLVertexArrayObject::create(this, WebGLVertexArrayObject::VAOTypeUser);
+    addContextObject(o.get());
+    return o.release();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::deleteVertexArray(WebGLVertexArrayObject* vertexArray)
</del><ins>+void WebGL2RenderingContext::deleteVertexArray(WebGLVertexArrayObject* arrayObject)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(vertexArray);
</del><ins>+    if (!arrayObject || isContextLost())
+        return;
+    
+    if (arrayObject-&gt;isDeleted())
+        return;
+    
+    if (!arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject == m_boundVertexArrayObject)
+        setBoundVertexArrayObject(0);
+    
+    arrayObject-&gt;deleteObject(graphicsContext3D());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-GC3Dboolean WebGL2RenderingContext::isVertexArray(WebGLVertexArrayObject* vertexArray)
</del><ins>+GC3Dboolean WebGL2RenderingContext::isVertexArray(WebGLVertexArrayObject* arrayObject)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(vertexArray);
-    return false;
</del><ins>+    if (!arrayObject || isContextLost())
+        return 0;
+    
+    if (!arrayObject-&gt;hasEverBeenBound() || !arrayObject-&gt;validate(0, this))
+        return 0;
+    
+    return m_context-&gt;isVertexArray(arrayObject-&gt;object());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::bindVertexArray(WebGLVertexArrayObject* vertexArray)
</del><ins>+void WebGL2RenderingContext::bindVertexArray(WebGLVertexArrayObject* arrayObject)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(vertexArray);
</del><ins>+    if (isContextLost())
+        return;
+    
+    if (arrayObject &amp;&amp; (arrayObject-&gt;isDeleted() || !arrayObject-&gt;validate(0, this) || !m_contextObjects.contains(arrayObject))) {
+        m_context-&gt;synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+        return;
+    }
+    if (arrayObject &amp;&amp; !arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject-&gt;object()) {
+        m_context-&gt;bindVertexArray(arrayObject-&gt;object());
+        
+        arrayObject-&gt;setHasEverBeenBound();
+        setBoundVertexArrayObject(arrayObject);
+    } else {
+        m_context-&gt;bindVertexArray(m_defaultVertexArrayObject-&gt;object());
+        setBoundVertexArrayObject(m_defaultVertexArrayObject);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebGLExtension* WebGL2RenderingContext::getExtension(const String&amp; name)
</span><span class="lines">@@ -2154,6 +2197,12 @@
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::UNIFORM_BUFFER_OFFSET_ALIGNMENT:
</span><span class="cx">         return getIntParameter(pname);
</span><ins>+    case GraphicsContext3D::VERTEX_ARRAY_BINDING: {
+        if (!m_boundVertexArrayObject-&gt;isDefaultObject())
+            return WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObject&gt;(static_cast&lt;WebGLVertexArrayObject*&gt;(m_boundVertexArrayObject.get())));
+        return WebGLGetInfo();
+        }
+        break;
</ins><span class="cx">     case GraphicsContext3D::COPY_READ_BUFFER:
</span><span class="cx">     case GraphicsContext3D::COPY_WRITE_BUFFER:
</span><span class="cx">     case GraphicsContext3D::DRAW_BUFFER0:
</span><span class="lines">@@ -2181,7 +2230,6 @@
</span><span class="cx">     case GraphicsContext3D::READ_FRAMEBUFFER_BINDING:
</span><span class="cx">     case GraphicsContext3D::TRANSFORM_FEEDBACK_BUFFER_BINDING:
</span><span class="cx">     case GraphicsContext3D::UNIFORM_BUFFER_BINDING:
</span><del>-    case GraphicsContext3D::VERTEX_ARRAY_BINDING:
</del><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;parameter name not yet supported&quot;);
</span><span class="cx">         return WebGLGetInfo();
</span><span class="cx">     default:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -189,6 +189,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    virtual void initializeVertexArrayObjects() override;
</ins><span class="cx">     virtual bool validateIndexArrayConservative(GC3Denum type, unsigned&amp; numElementsRequired) override;
</span><span class="cx">     virtual bool validateDrawElements(const char* functionName, GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, unsigned&amp; numElements, GC3Dsizei primitiveCount) override;
</span><span class="cx">     virtual bool validateBlendEquation(const char* functionName, GC3Denum mode) override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLGetInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -30,12 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebGLGetInfo.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;WebGLBuffer.h&quot;
-#include &quot;WebGLFramebuffer.h&quot;
-#include &quot;WebGLProgram.h&quot;
-#include &quot;WebGLRenderbuffer.h&quot;
-#include &quot;WebGLTexture.h&quot;
-#include &quot;WebGLVertexArrayObjectOES.h&quot;
</del><span class="cx"> #include &lt;runtime/Float32Array.h&gt;
</span><span class="cx"> #include &lt;runtime/Int32Array.h&gt;
</span><span class="cx"> #include &lt;runtime/Uint32Array.h&gt;
</span><span class="lines">@@ -236,6 +230,17 @@
</span><span class="cx">     , m_int(0)
</span><span class="cx">     , m_unsignedInt(0)
</span><span class="cx">     , m_int64(0)
</span><ins>+    , m_webglVertexArrayObjectOES(value)
+{
+}
+
+WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObject&gt; value)
+    : m_type(kTypeWebGLVertexArrayObject)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
+    , m_int64(0)
</ins><span class="cx">     , m_webglVertexArrayObject(value)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -348,6 +353,12 @@
</span><span class="cx"> PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; WebGLGetInfo::getWebGLVertexArrayObjectOES() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(getType() == kTypeWebGLVertexArrayObjectOES);
</span><ins>+    return m_webglVertexArrayObjectOES;
+}
+
+PassRefPtr&lt;WebGLVertexArrayObject&gt; WebGLGetInfo::getWebGLVertexArrayObject() const
+{
+    ASSERT(getType() == kTypeWebGLVertexArrayObject);
</ins><span class="cx">     return m_webglVertexArrayObject;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLGetInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLGetInfo.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLGetInfo.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLGetInfo.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;WebGLProgram.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderbuffer.h&quot;
</span><span class="cx"> #include &quot;WebGLTexture.h&quot;
</span><ins>+#include &quot;WebGLVertexArrayObject.h&quot;
</ins><span class="cx"> #include &quot;WebGLVertexArrayObjectOES.h&quot;
</span><span class="cx"> #include &lt;runtime/Float32Array.h&gt;
</span><span class="cx"> #include &lt;runtime/Int32Array.h&gt;
</span><span class="lines">@@ -70,6 +71,7 @@
</span><span class="cx">         kTypeWebGLUnsignedByteArray,
</span><span class="cx">         kTypeWebGLUnsignedIntArray,
</span><span class="cx">         kTypeWebGLVertexArrayObjectOES,
</span><ins>+        kTypeWebGLVertexArrayObject,
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     explicit WebGLGetInfo(bool value);
</span><span class="lines">@@ -93,6 +95,7 @@
</span><span class="cx">     explicit WebGLGetInfo(PassRefPtr&lt;Uint8Array&gt; value);
</span><span class="cx">     explicit WebGLGetInfo(PassRefPtr&lt;Uint32Array&gt; value);
</span><span class="cx">     explicit WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; value);
</span><ins>+    explicit WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObject&gt; value);
</ins><span class="cx"> 
</span><span class="cx">     ~WebGLGetInfo();
</span><span class="cx"> 
</span><span class="lines">@@ -117,6 +120,7 @@
</span><span class="cx">     PassRefPtr&lt;Uint8Array&gt; getWebGLUnsignedByteArray() const;
</span><span class="cx">     PassRefPtr&lt;Uint32Array&gt; getWebGLUnsignedIntArray() const;
</span><span class="cx">     PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; getWebGLVertexArrayObjectOES() const;
</span><ins>+    PassRefPtr&lt;WebGLVertexArrayObject&gt; getWebGLVertexArrayObject() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     Type m_type;
</span><span class="lines">@@ -138,7 +142,8 @@
</span><span class="cx">     RefPtr&lt;WebGLTexture&gt; m_webglTexture;
</span><span class="cx">     RefPtr&lt;Uint8Array&gt; m_webglUnsignedByteArray;
</span><span class="cx">     RefPtr&lt;Uint32Array&gt; m_webglUnsignedIntArray;
</span><del>-    RefPtr&lt;WebGLVertexArrayObjectOES&gt; m_webglVertexArrayObject;
</del><ins>+    RefPtr&lt;WebGLVertexArrayObjectOES&gt; m_webglVertexArrayObjectOES;
+    RefPtr&lt;WebGLVertexArrayObject&gt; m_webglVertexArrayObject;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> #include &quot;WebGLDepthTexture.h&quot;
</span><span class="cx"> #include &quot;WebGLDrawBuffers.h&quot;
</span><span class="cx"> #include &quot;WebGLLoseContext.h&quot;
</span><ins>+#include &quot;WebGLVertexArrayObjectOES.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -67,8 +68,17 @@
</span><span class="cx"> WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, PassRefPtr&lt;GraphicsContext3D&gt; context,
</span><span class="cx">     GraphicsContext3D::Attributes attributes) : WebGLRenderingContextBase(passedCanvas, context, attributes)
</span><span class="cx"> {
</span><ins>+    initializeVertexArrayObjects();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebGLRenderingContext::initializeVertexArrayObjects()
+{
+    m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectOES::VAOTypeDefault);
+    addContextObject(m_defaultVertexArrayObject.get());
+    m_boundVertexArrayObject = m_defaultVertexArrayObject;
+    if (!isGLES2Compliant())
+        initVertexAttrib0();
+}
</ins><span class="cx"> 
</span><span class="cx"> WebGLExtension* WebGLRenderingContext::getExtension(const String&amp; name)
</span><span class="cx"> {
</span><span class="lines">@@ -1067,7 +1077,7 @@
</span><span class="cx">     case Extensions3D::VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object
</span><span class="cx">         if (m_oesVertexArrayObject) {
</span><span class="cx">             if (!m_boundVertexArrayObject-&gt;isDefaultObject())
</span><del>-                return WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt;(m_boundVertexArrayObject));
</del><ins>+                return WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt;(static_cast&lt;WebGLVertexArrayObjectOES*&gt;(m_boundVertexArrayObject.get())));
</ins><span class="cx">             return WebGLGetInfo();
</span><span class="cx">         }
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, OES_vertex_array_object not enabled&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    virtual void initializeVertexArrayObjects() override;
</ins><span class="cx">     virtual bool validateIndexArrayConservative(GC3Denum type, unsigned&amp; numElementsRequired) override;
</span><span class="cx">     virtual bool validateDrawElements(const char* functionName, GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, unsigned&amp; numElements, GC3Dsizei primitiveCount) override;
</span><span class="cx">     virtual bool validateBlendEquation(const char* functionName, GC3Denum mode) override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -529,17 +529,11 @@
</span><span class="cx">     m_backDrawBuffer = GraphicsContext3D::BACK;
</span><span class="cx">     m_drawBuffersWebGLRequirementsChecked = false;
</span><span class="cx">     m_drawBuffersSupported = false;
</span><del>-
-    m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectOES::VaoTypeDefault);
-    addContextObject(m_defaultVertexArrayObject.get());
-    m_boundVertexArrayObject = m_defaultVertexArrayObject;
</del><span class="cx">     
</span><span class="cx">     m_vertexAttribValue.resize(m_maxVertexAttribs);
</span><span class="cx"> 
</span><span class="cx">     if (!isGLES2NPOTStrict())
</span><span class="cx">         createFallbackBlackTextures1x1();
</span><del>-    if (!isGLES2Compliant())
-        initVertexAttrib0();
</del><span class="cx"> 
</span><span class="cx">     IntSize canvasSize = clampedCanvasSize();
</span><span class="cx">     m_context-&gt;reshape(canvasSize.width(), canvasSize.height());
</span><span class="lines">@@ -1600,7 +1594,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</del><ins>+    WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</ins><span class="cx">     state.enabled = false;
</span><span class="cx"> 
</span><span class="cx">     if (index &gt; 0 || isGLES2Compliant())
</span><span class="lines">@@ -1722,7 +1716,7 @@
</span><span class="cx">     for (int i = 0; i &lt; numActiveAttribLocations; ++i) {
</span><span class="cx">         int loc = m_currentProgram-&gt;getActiveAttribLocation(i);
</span><span class="cx">         if (loc &gt;= 0 &amp;&amp; loc &lt; static_cast&lt;int&gt;(m_maxVertexAttribs)) {
</span><del>-            const WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(loc);
</del><ins>+            const WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(loc);
</ins><span class="cx">             if (state.enabled) {
</span><span class="cx">                 sawEnabledAttrib = true;
</span><span class="cx">                 // Avoid off-by-one errors in numElements computation.
</span><span class="lines">@@ -1891,7 +1885,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</del><ins>+    WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</ins><span class="cx">     state.enabled = true;
</span><span class="cx"> 
</span><span class="cx">     m_context-&gt;enableVertexAttribArray(index);
</span><span class="lines">@@ -2519,7 +2513,7 @@
</span><span class="cx">         return WebGLGetInfo();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    const WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</del><ins>+    const WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</ins><span class="cx"> 
</span><span class="cx">     if (m_angleInstancedArrays &amp;&amp; pname == GraphicsContext3D::VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)
</span><span class="cx">         return WebGLGetInfo(state.divisor);
</span><span class="lines">@@ -4600,7 +4594,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::initVertexAttrib0()
</span><span class="cx"> {
</span><del>-    WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(0);
</del><ins>+    WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(0);
</ins><span class="cx">     
</span><span class="cx">     m_vertexAttrib0Buffer = createBuffer();
</span><span class="cx">     m_context-&gt;bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer-&gt;object());
</span><span class="lines">@@ -4620,7 +4614,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool WebGLRenderingContextBase::simulateVertexAttrib0(GC3Dsizei numVertex)
</span><span class="cx"> {
</span><del>-    const WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(0);
</del><ins>+    const WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(0);
</ins><span class="cx">     const VertexAttribValue&amp; attribValue = m_vertexAttribValue[0];
</span><span class="cx">     if (!m_currentProgram)
</span><span class="cx">         return false;
</span><span class="lines">@@ -4665,7 +4659,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation()
</span><span class="cx"> {
</span><del>-    const WebGLVertexArrayObjectOES::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(0);
</del><ins>+    const WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(0);
</ins><span class="cx">     if (state.bufferBinding != m_vertexAttrib0Buffer) {
</span><span class="cx">         m_context-&gt;bindBuffer(GraphicsContext3D::ARRAY_BUFFER, objectOrZero(state.bufferBinding.get()));
</span><span class="cx">         m_context-&gt;vertexAttribPointer(0, state.size, state.type, state.normalized, state.originalStride, state.offset);
</span><span class="lines">@@ -4755,6 +4749,7 @@
</span><span class="cx">     m_contextLost = false;
</span><span class="cx">     setupFlags();
</span><span class="cx">     initializeNewContext();
</span><ins>+    initializeVertexArrayObjects();
</ins><span class="cx">     canvas()-&gt;dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextrestoredEvent, false, true, &quot;&quot;));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -373,8 +373,11 @@
</span><span class="cx">     friend class WebGLCompressedTextureS3TC;
</span><span class="cx">     friend class WebGLRenderingContextErrorMessageCallback;
</span><span class="cx">     friend class WebGLVertexArrayObjectOES;
</span><ins>+    friend class WebGLVertexArrayObject;
+    friend class WebGLVertexArrayObjectBase;
</ins><span class="cx"> 
</span><span class="cx">     virtual void initializeNewContext();
</span><ins>+    virtual void initializeVertexArrayObjects() = 0;
</ins><span class="cx">     void setupFlags();
</span><span class="cx"> 
</span><span class="cx">     // ActiveDOMObject
</span><span class="lines">@@ -447,10 +450,10 @@
</span><span class="cx"> 
</span><span class="cx">     // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER and stored values for ELEMENT_ARRAY_BUFFER
</span><span class="cx">     RefPtr&lt;WebGLBuffer&gt; m_boundArrayBuffer;
</span><del>-    
-    RefPtr&lt;WebGLVertexArrayObjectOES&gt; m_defaultVertexArrayObject;
-    RefPtr&lt;WebGLVertexArrayObjectOES&gt; m_boundVertexArrayObject;
-    void setBoundVertexArrayObject(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; arrayObject)
</del><ins>+
+    RefPtr&lt;WebGLVertexArrayObjectBase&gt; m_defaultVertexArrayObject;
+    RefPtr&lt;WebGLVertexArrayObjectBase&gt; m_boundVertexArrayObject;
+    void setBoundVertexArrayObject(PassRefPtr&lt;WebGLVertexArrayObjectBase&gt; arrayObject)
</ins><span class="cx">     {
</span><span class="cx">         if (arrayObject)
</span><span class="cx">             m_boundVertexArrayObject = arrayObject;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -28,14 +28,14 @@
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> #include &quot;WebGLVertexArrayObject.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;WebGL2RenderingContext.h&quot;
</ins><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><del>-#include &quot;WebGLRenderingContextBase.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><del>-PassRefPtr&lt;WebGLVertexArrayObject&gt; WebGLVertexArrayObject::create(WebGLRenderingContextBase* ctx)
</del><ins>+PassRefPtr&lt;WebGLVertexArrayObject&gt; WebGLVertexArrayObject::create(WebGLRenderingContextBase* ctx, VAOType type)
</ins><span class="cx"> {
</span><del>-    return adoptRef(new WebGLVertexArrayObject(ctx));
</del><ins>+    return adoptRef(new WebGLVertexArrayObject(ctx, type));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebGLVertexArrayObject::~WebGLVertexArrayObject()
</span><span class="lines">@@ -43,17 +43,36 @@
</span><span class="cx">     deleteObject(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLVertexArrayObject::WebGLVertexArrayObject(WebGLRenderingContextBase* ctx)
-    : WebGLSharedObject(ctx)
</del><ins>+WebGLVertexArrayObject::WebGLVertexArrayObject(WebGLRenderingContextBase* ctx, VAOType type)
+    : WebGLVertexArrayObjectBase(ctx, type)
</ins><span class="cx"> {
</span><del>-    // FIXME: Call createVertexArray from GraphicsContext3D.
</del><ins>+    switch (m_type) {
+    case VAOTypeDefault:
+        break;
+    default:
+        setObject(context()-&gt;graphicsContext3D()-&gt;createVertexArray());
+        break;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLVertexArrayObject::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(context3d);
-    UNUSED_PARAM(object);
-    // FIXME: Call deleteVertexArray from GraphicsContext3D.
</del><ins>+    switch (m_type) {
+    case VAOTypeDefault:
+        break;
+    default:
+        context3d-&gt;deleteVertexArray(object);
+        break;
+    }
+    
+    if (m_boundElementArrayBuffer)
+        m_boundElementArrayBuffer-&gt;onDetached(context3d);
+    
+    for (size_t i = 0; i &lt; m_vertexAttribState.size(); ++i) {
+        VertexAttribState&amp; state = m_vertexAttribState[i];
+        if (state.bufferBinding)
+            state.bufferBinding-&gt;onDetached(context3d);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -26,26 +26,25 @@
</span><span class="cx"> #ifndef WebGLVertexArrayObject_h
</span><span class="cx"> #define WebGLVertexArrayObject_h
</span><span class="cx"> 
</span><del>-#include &quot;WebGLSharedObject.h&quot;
</del><ins>+#include &quot;WebGLBuffer.h&quot;
+#include &quot;WebGLContextObject.h&quot;
+#include &quot;WebGLVertexArrayObjectBase.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class WebGLVertexArrayObject final : public WebGLSharedObject {
</del><ins>+class WebGL2RenderingContext;
+
+class WebGLVertexArrayObject final : public WebGLVertexArrayObjectBase {
</ins><span class="cx"> public:
</span><ins>+    static PassRefPtr&lt;WebGLVertexArrayObject&gt; create(WebGLRenderingContextBase*, VAOType);
</ins><span class="cx">     virtual ~WebGLVertexArrayObject();
</span><del>-
-    static PassRefPtr&lt;WebGLVertexArrayObject&gt; create(WebGLRenderingContextBase*);
-
-protected:
-    WebGLVertexArrayObject(WebGLRenderingContextBase*);
-
-    virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
-
</del><span class="cx"> private:
</span><del>-    virtual bool isTransformFeedback() const override { return true; }
</del><ins>+    WebGLVertexArrayObject(WebGLRenderingContextBase*, VAOType);
+    bool isTransformFeedback() const { return true; }
+    virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBasecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp (0 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp                                (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if ENABLE(WEBGL)
+#include &quot;WebGLVertexArrayObjectBase.h&quot;
+
+#include &quot;WebGLRenderingContextBase.h&quot;
+
+namespace WebCore {
+
+WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase* ctx, VAOType type)
+    : WebGLContextObject(ctx)
+    , m_type(type)
+    , m_hasEverBeenBound(false)
+    , m_boundElementArrayBuffer(0)
+{
+    m_vertexAttribState.resize(ctx-&gt;getMaxVertexAttribs());
+}
+
+void WebGLVertexArrayObjectBase::setElementArrayBuffer(PassRefPtr&lt;WebGLBuffer&gt; buffer)
+{
+    if (buffer)
+        buffer-&gt;onAttached();
+    if (m_boundElementArrayBuffer)
+        m_boundElementArrayBuffer-&gt;onDetached(context()-&gt;graphicsContext3D());
+    m_boundElementArrayBuffer = buffer;
+    
+}
+
+void WebGLVertexArrayObjectBase::setVertexAttribState(GC3Duint index, GC3Dsizei bytesPerElement, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset, PassRefPtr&lt;WebGLBuffer&gt; buffer)
+{
+    GC3Dsizei validatedStride = stride ? stride : bytesPerElement;
+    
+    VertexAttribState&amp; state = m_vertexAttribState[index];
+    
+    if (buffer)
+        buffer-&gt;onAttached();
+    if (state.bufferBinding)
+        state.bufferBinding-&gt;onDetached(context()-&gt;graphicsContext3D());
+    
+    state.bufferBinding = buffer;
+    state.bytesPerElement = bytesPerElement;
+    state.size = size;
+    state.type = type;
+    state.normalized = normalized;
+    state.stride = validatedStride;
+    state.originalStride = stride;
+    state.offset = offset;
+}
+
+void WebGLVertexArrayObjectBase::unbindBuffer(PassRefPtr&lt;WebGLBuffer&gt; buffer)
+{
+    if (m_boundElementArrayBuffer == buffer) {
+        m_boundElementArrayBuffer-&gt;onDetached(context()-&gt;graphicsContext3D());
+        m_boundElementArrayBuffer = 0;
+    }
+    
+    for (size_t i = 0; i &lt; m_vertexAttribState.size(); ++i) {
+        VertexAttribState&amp; state = m_vertexAttribState[i];
+        if (state.bufferBinding == buffer) {
+            buffer-&gt;onDetached(context()-&gt;graphicsContext3D());
+            
+            if (!i &amp;&amp; !context()-&gt;isGLES2Compliant()) {
+                state.bufferBinding = context()-&gt;m_vertexAttrib0Buffer;
+                state.bufferBinding-&gt;onAttached();
+                state.bytesPerElement = 0;
+                state.size = 4;
+                state.type = GraphicsContext3D::FLOAT;
+                state.normalized = false;
+                state.stride = 16;
+                state.originalStride = 0;
+                state.offset = 0;
+            } else
+                state.bufferBinding = 0;
+        }
+    }
+}
+
+void WebGLVertexArrayObjectBase::setVertexAttribDivisor(GC3Duint index, GC3Duint divisor)
+{
+    VertexAttribState&amp; state = m_vertexAttribState[index];
+    state.divisor = divisor;
+}
+    
+}
+
+#endif // ENABLE(WEBGL)
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBaseh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h (0 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h                                (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebGLVertexArrayObjectBase_h
+#define WebGLVertexArrayObjectBase_h
+
+#include &quot;WebGLBuffer.h&quot;
+#include &quot;WebGLContextObject.h&quot;
+
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace WebCore {
+
+class WebGLVertexArrayObjectBase : public WebGLContextObject {
+public:
+    enum VAOType {
+        VAOTypeDefault,
+        VAOTypeUser,
+    };
+    
+    virtual ~WebGLVertexArrayObjectBase() { }
+
+    // Cached values for vertex attrib range checks
+    struct VertexAttribState {
+        VertexAttribState()
+            : enabled(false)
+            , bytesPerElement(0)
+            , size(4)
+            , type(GraphicsContext3D::FLOAT)
+            , normalized(false)
+            , stride(16)
+            , originalStride(0)
+            , offset(0)
+            , divisor(0)
+        {
+        }
+        
+        bool isBound() const { return bufferBinding &amp;&amp; bufferBinding-&gt;object(); }
+        bool validateBinding() const { return !enabled || isBound(); }
+        
+        bool enabled;
+        RefPtr&lt;WebGLBuffer&gt; bufferBinding;
+        GC3Dsizei bytesPerElement;
+        GC3Dint size;
+        GC3Denum type;
+        bool normalized;
+        GC3Dsizei stride;
+        GC3Dsizei originalStride;
+        GC3Dintptr offset;
+        GC3Duint divisor;
+    };
+    
+    bool isDefaultObject() const { return m_type == VAOTypeDefault; }
+    
+    bool hasEverBeenBound() const { return object() &amp;&amp; m_hasEverBeenBound; }
+    void setHasEverBeenBound() { m_hasEverBeenBound = true; }
+    
+    PassRefPtr&lt;WebGLBuffer&gt; getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
+    void setElementArrayBuffer(PassRefPtr&lt;WebGLBuffer&gt;);
+    
+    VertexAttribState&amp; getVertexAttribState(int index) { return m_vertexAttribState[index]; }
+    void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, PassRefPtr&lt;WebGLBuffer&gt;);
+    void unbindBuffer(PassRefPtr&lt;WebGLBuffer&gt;);
+    
+    void setVertexAttribDivisor(GC3Duint index, GC3Duint divisor);
+
+protected:
+    WebGLVertexArrayObjectBase(WebGLRenderingContextBase*, VAOType);
+    virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) = 0;
+    
+    VAOType m_type;
+    bool m_hasEverBeenBound;
+    RefPtr&lt;WebGLBuffer&gt; m_boundElementArrayBuffer;
+    Vector&lt;VertexAttribState&gt; m_vertexAttribState;
+};
+    
+} // namespace WebCore
+
+#endif // WebGLVertexArrayObjectBase_h
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOEScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -34,22 +34,17 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; WebGLVertexArrayObjectOES::create(WebGLRenderingContextBase* ctx, VaoType type)
</del><ins>+PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; WebGLVertexArrayObjectOES::create(WebGLRenderingContextBase* ctx, VAOType type)
</ins><span class="cx"> {
</span><span class="cx">     return adoptRef(new WebGLVertexArrayObjectOES(ctx, type));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES(WebGLRenderingContextBase* ctx, VaoType type)
-    : WebGLContextObject(ctx)
-    , m_type(type)
-    , m_hasEverBeenBound(false)
-    , m_boundElementArrayBuffer(0)
</del><ins>+WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES(WebGLRenderingContextBase* ctx, VAOType type)
+    : WebGLVertexArrayObjectBase(ctx, type)
</ins><span class="cx"> {
</span><del>-    m_vertexAttribState.resize(ctx-&gt;getMaxVertexAttribs());
-    
</del><span class="cx">     Extensions3D* extensions = context()-&gt;graphicsContext3D()-&gt;getExtensions();
</span><span class="cx">     switch (m_type) {
</span><del>-    case VaoTypeDefault:
</del><ins>+    case VAOTypeDefault:
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         setObject(extensions-&gt;createVertexArrayOES());
</span><span class="lines">@@ -66,7 +61,7 @@
</span><span class="cx"> {
</span><span class="cx">     Extensions3D* extensions = context3d-&gt;getExtensions();
</span><span class="cx">     switch (m_type) {
</span><del>-    case VaoTypeDefault:
</del><ins>+    case VAOTypeDefault:
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         extensions-&gt;deleteVertexArrayOES(object);
</span><span class="lines">@@ -82,73 +77,6 @@
</span><span class="cx">             state.bufferBinding-&gt;onDetached(context3d);
</span><span class="cx">     }
</span><span class="cx"> }
</span><del>-
-void WebGLVertexArrayObjectOES::setElementArrayBuffer(PassRefPtr&lt;WebGLBuffer&gt; buffer)
-{
-    if (buffer)
-        buffer-&gt;onAttached();
-    if (m_boundElementArrayBuffer)
-        m_boundElementArrayBuffer-&gt;onDetached(context()-&gt;graphicsContext3D());
-    m_boundElementArrayBuffer = buffer;
-    
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLVertexArrayObjectOES::setVertexAttribState(
-    GC3Duint index, GC3Dsizei bytesPerElement, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset, PassRefPtr&lt;WebGLBuffer&gt; buffer)
-{
-    GC3Dsizei validatedStride = stride ? stride : bytesPerElement;
-
-    VertexAttribState&amp; state = m_vertexAttribState[index];
-
-    if (buffer)
-        buffer-&gt;onAttached();
-    if (state.bufferBinding)
-        state.bufferBinding-&gt;onDetached(context()-&gt;graphicsContext3D());
-
-    state.bufferBinding = buffer;
-    state.bytesPerElement = bytesPerElement;
-    state.size = size;
-    state.type = type;
-    state.normalized = normalized;
-    state.stride = validatedStride;
-    state.originalStride = stride;
-    state.offset = offset;
-}
-
-void WebGLVertexArrayObjectOES::unbindBuffer(PassRefPtr&lt;WebGLBuffer&gt; buffer)
-{
-    if (m_boundElementArrayBuffer == buffer) {
-        m_boundElementArrayBuffer-&gt;onDetached(context()-&gt;graphicsContext3D());
-        m_boundElementArrayBuffer = 0;
-    }
-
-    for (size_t i = 0; i &lt; m_vertexAttribState.size(); ++i) {
-        VertexAttribState&amp; state = m_vertexAttribState[i];
-        if (state.bufferBinding == buffer) {
-            buffer-&gt;onDetached(context()-&gt;graphicsContext3D());
-
-            if (!i &amp;&amp; !context()-&gt;isGLES2Compliant()) {
-                state.bufferBinding = context()-&gt;m_vertexAttrib0Buffer;
-                state.bufferBinding-&gt;onAttached();
-                state.bytesPerElement = 0;
-                state.size = 4;
-                state.type = GraphicsContext3D::FLOAT;
-                state.normalized = false;
-                state.stride = 16;
-                state.originalStride = 0;
-                state.offset = 0;
-            } else
-                state.bufferBinding = 0;
-        }
-    }
-}
-
-void WebGLVertexArrayObjectOES::setVertexAttribDivisor(GC3Duint index, GC3Duint divisor)
-{
-    VertexAttribState&amp; state = m_vertexAttribState[index];
-    state.divisor = divisor;
-}
-
-}
-
</del><span class="cx"> #endif // ENABLE(WEBGL)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOESh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -28,75 +28,19 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebGLBuffer.h&quot;
</span><span class="cx"> #include &quot;WebGLContextObject.h&quot;
</span><ins>+#include &quot;WebGLVertexArrayObjectBase.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class WebGLVertexArrayObjectOES final : public WebGLContextObject {
</del><ins>+class WebGLVertexArrayObjectOES final : public WebGLVertexArrayObjectBase {
</ins><span class="cx"> public:
</span><del>-    enum VaoType {
-        VaoTypeDefault,
-        VaoTypeUser,
-    };
-    
</del><ins>+    static PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; create(WebGLRenderingContextBase*, VAOType);
</ins><span class="cx">     virtual ~WebGLVertexArrayObjectOES();
</span><del>-
-    static PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; create(WebGLRenderingContextBase*, VaoType);
-    
-    // Cached values for vertex attrib range checks
-    struct VertexAttribState {
-        VertexAttribState()
-            : enabled(false)
-            , bytesPerElement(0)
-            , size(4)
-            , type(GraphicsContext3D::FLOAT)
-            , normalized(false)
-            , stride(16)
-            , originalStride(0)
-            , offset(0)
-            , divisor(0)
-        {
-        }
-        
-        bool isBound() const { return bufferBinding &amp;&amp; bufferBinding-&gt;object(); }
-        bool validateBinding() const { return !enabled || isBound(); }
-
-        bool enabled;
-        RefPtr&lt;WebGLBuffer&gt; bufferBinding;
-        GC3Dsizei bytesPerElement;
-        GC3Dint size;
-        GC3Denum type;
-        bool normalized;
-        GC3Dsizei stride;
-        GC3Dsizei originalStride;
-        GC3Dintptr offset;
-        GC3Duint divisor;
-    };
-    
-    bool isDefaultObject() const { return m_type == VaoTypeDefault; }
-    
-    bool hasEverBeenBound() const { return object() &amp;&amp; m_hasEverBeenBound; }
-    void setHasEverBeenBound() { m_hasEverBeenBound = true; }
-    
-    PassRefPtr&lt;WebGLBuffer&gt; getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
-    void setElementArrayBuffer(PassRefPtr&lt;WebGLBuffer&gt;);
-    
-    VertexAttribState&amp; getVertexAttribState(int index) { return m_vertexAttribState[index]; }
-    void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, PassRefPtr&lt;WebGLBuffer&gt;);
-    void unbindBuffer(PassRefPtr&lt;WebGLBuffer&gt;);
-
-    void setVertexAttribDivisor(GC3Duint index, GC3Duint divisor);
-
</del><span class="cx"> private:
</span><del>-    WebGLVertexArrayObjectOES(WebGLRenderingContextBase*, VaoType);
-
</del><ins>+    WebGLVertexArrayObjectOES(WebGLRenderingContextBase*, VAOType);
</ins><span class="cx">     virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</span><del>-    
-    VaoType m_type;
-    bool m_hasEverBeenBound;
-    RefPtr&lt;WebGLBuffer&gt; m_boundElementArrayBuffer;
-    Vector&lt;VertexAttribState&gt; m_vertexAttribState;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -1118,6 +1118,12 @@
</span><span class="cx">     void drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount);
</span><span class="cx">     void vertexAttribDivisor(GC3Duint index, GC3Duint divisor);
</span><span class="cx"> 
</span><ins>+    // VertexArrayOject calls
+    Platform3DObject createVertexArray();
+    void deleteVertexArray(Platform3DObject);
+    GC3Dboolean isVertexArray(Platform3DObject);
+    void bindVertexArray(Platform3DObject);
+
</ins><span class="cx"> #if PLATFORM(GTK) || PLATFORM(EFL) || USE(CAIRO)
</span><span class="cx">     void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
</span><span class="cx">                        int canvasWidth, int canvasHeight, PlatformContextCairo* context);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (181570 => 181571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2015-03-16 18:44:46 UTC (rev 181570)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2015-03-16 19:03:26 UTC (rev 181571)
</span><span class="lines">@@ -1357,6 +1357,57 @@
</span><span class="cx">     ::glViewport(x, y, width, height);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Platform3DObject GraphicsContext3D::createVertexArray()
+{
+    makeContextCurrent();
+    GLuint array = 0;
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
+    glGenVertexArrays(1, &amp;array);
+#elif defined(GL_APPLE_vertex_array_object) &amp;&amp; GL_APPLE_vertex_array_object
+    glGenVertexArraysAPPLE(1, &amp;array);
+#endif
+    return array;
+}
+
+void GraphicsContext3D::deleteVertexArray(Platform3DObject array)
+{
+    if (!array)
+        return;
+    
+    makeContextCurrent();
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
+    glDeleteVertexArrays(1, &amp;array);
+#elif defined(GL_APPLE_vertex_array_object) &amp;&amp; GL_APPLE_vertex_array_object
+    glDeleteVertexArraysAPPLE(1, &amp;array);
+#endif
+}
+
+GC3Dboolean GraphicsContext3D::isVertexArray(Platform3DObject array)
+{
+    if (!array)
+        return GL_FALSE;
+    
+    makeContextCurrent();
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
+    return glIsVertexArray(array);
+#elif defined(GL_APPLE_vertex_array_object) &amp;&amp; GL_APPLE_vertex_array_object
+    return glIsVertexArrayAPPLE(array);
+#endif
+    return GL_FALSE;
+}
+
+void GraphicsContext3D::bindVertexArray(Platform3DObject array)
+{
+    makeContextCurrent();
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
+    glBindVertexArray(array);
+#elif defined(GL_APPLE_vertex_array_object) &amp;&amp; GL_APPLE_vertex_array_object
+    glBindVertexArrayAPPLE(array);
+#else
+    UNUSED_PARAM(array);
+#endif
+}
+
</ins><span class="cx"> void GraphicsContext3D::getBooleanv(GC3Denum pname, GC3Dboolean* value)
</span><span class="cx"> {
</span><span class="cx">     makeContextCurrent();
</span></span></pre>
</div>
</div>

</body>
</html>