<!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.
<rdar://problem/15002455>
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 <roger_fong@apple.com>
+
+ [WebGL2] Vertex Array Objects.
+ https://bugs.webkit.org/show_bug.cgi?id=126944.
+ <rdar://problem/15002455>
+
+ 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 <bfulgham@apple.com>
</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>-<?xml version="1.0" encoding="utf-8"?>
</del><ins>+<?xml version="1.0" encoding="utf-8"?>
</ins><span class="cx"> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</span><span class="cx"> <ItemGroup Label="ProjectConfigurations">
</span><span class="cx"> <ProjectConfiguration Include="DebugSuffix|Win32">
</span><span class="lines">@@ -6681,6 +6681,7 @@
</span><span class="cx"> <ClCompile Include="..\html\canvas\WebGLTransformFeedback.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\canvas\WebGLUniformLocation.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\canvas\WebGLVertexArrayObject.cpp" />
</span><ins>+ <ClCompile Include="..\html\canvas\WebGLVertexArrayObjectBase.cpp" />
</ins><span class="cx"> <ClCompile Include="..\html\canvas\WebGLVertexArrayObjectOES.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\track\AudioTrack.cpp" />
</span><span class="cx"> <ClCompile Include="..\html\track\AudioTrackList.cpp" />
</span><span class="lines">@@ -19041,6 +19042,7 @@
</span><span class="cx"> <ClInclude Include="..\html\canvas\WebGLTransformFeedback.h" />
</span><span class="cx"> <ClInclude Include="..\html\canvas\WebGLUniformLocation.h" />
</span><span class="cx"> <ClInclude Include="..\html\canvas\WebGLVertexArrayObject.h" />
</span><ins>+ <ClInclude Include="..\html\canvas\WebGLVertexArrayObjectBase.h” />
</ins><span class="cx"> <ClInclude Include="..\html\canvas\WebGLVertexArrayObjectOES.h" />
</span><span class="cx"> <ClInclude Include="..\html\track\AudioTrack.h" />
</span><span class="cx"> <ClInclude Include="..\html\track\AudioTrackList.h" />
</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>-<?xml version="1.0" encoding="utf-8"?>
</del><ins>+<?xml version="1.0" encoding="utf-8"?>
</ins><span class="cx"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <Filter Include="DerivedSources">
</span><span class="lines">@@ -7201,6 +7201,9 @@
</span><span class="cx"> <ClCompile Include="..\html\canvas\WebGLTransformFeedback.cpp">
</span><span class="cx"> <Filter>html\canvas</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\html\canvas\WebGLVertexArrayObjectBase.cpp">
+ <Filter>html\canvas</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\html\canvas\WebGLVertexArrayObject.cpp">
</span><span class="cx"> <Filter>html\canvas</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -15167,6 +15170,9 @@
</span><span class="cx"> <ClInclude Include="..\html\canvas\WebGLVertexArrayObject.h">
</span><span class="cx"> <Filter>html\canvas</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\html\canvas\WebGLVertexArrayObjectBase.h”>
+ <Filter>html\canvas</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSWebGLQuery.h">
</span><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClInclude>
</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 = "<group>"; };
</span><span class="cx">                 6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextAttributes.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextAttributes.h; sourceTree = "<group>"; };
</span><ins>+                6F222B741AB52D640094651A /* WebGLVertexArrayObjectBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebGLVertexArrayObjectBase.h; path = canvas/WebGLVertexArrayObjectBase.h; sourceTree = "<group>"; };
+                6F222B751AB52D8A0094651A /* WebGLVertexArrayObjectBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLVertexArrayObjectBase.cpp; path = canvas/WebGLVertexArrayObjectBase.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 6F995A091A7070E600A735F4 /* WebGLQuery.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLQuery.idl; path = canvas/WebGLQuery.idl; sourceTree = "<group>"; };
</span><span class="cx">                 6F995A0A1A7070E600A735F4 /* WebGLSampler.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLSampler.idl; path = canvas/WebGLSampler.idl; sourceTree = "<group>"; };
</span><span class="cx">                 6F995A0B1A7070E600A735F4 /* WebGLSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLSync.idl; path = canvas/WebGLSync.idl; sourceTree = "<group>"; };
</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 "JSWebGLShader.h"
</span><span class="cx"> #include "JSWebGLTexture.h"
</span><span class="cx"> #include "JSWebGLUniformLocation.h"
</span><ins>+#include "JSWebGLVertexArrayObject.h"
</ins><span class="cx"> #include "JSWebGLVertexArrayObjectOES.h"
</span><span class="cx"> #include "JSWebKitCSSMatrix.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><span class="lines">@@ -92,6 +93,7 @@
</span><span class="cx"> #include "WebGLLoseContext.h"
</span><span class="cx"> #include "WebGLProgram.h"
</span><span class="cx"> #include "WebGLRenderingContextBase.h"
</span><ins>+#include "WebGLVertexArrayObject.h"
</ins><span class="cx"> #include "WebGLVertexArrayObjectOES.h"
</span><span class="cx"> #include <runtime/Error.h>
</span><span class="cx"> #include <runtime/JSTypedArrays.h>
</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 "OESVertexArrayObject.h"
</span><span class="cx">
</span><span class="cx"> #include "Extensions3D.h"
</span><ins>+#include "WebGLRenderingContext.h"
</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->isContextLost())
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- RefPtr<WebGLVertexArrayObjectOES> o = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::VaoTypeUser);
</del><ins>+ RefPtr<WebGLVertexArrayObjectOES> o = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::VAOTypeUser);
</ins><span class="cx"> m_context->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->isContextLost())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (!arrayObject->isDefaultObject() && arrayObject == m_context->m_boundVertexArrayObject)
- m_context->setBoundVertexArrayObject(0);
</del><ins>+ if (!arrayObject->isDefaultObject() && arrayObject == static_cast<WebGLRenderingContext*>(m_context)->m_boundVertexArrayObject)
+ static_cast<WebGLRenderingContext*>(m_context)->setBoundVertexArrayObject(0);
</ins><span class="cx">
</span><span class="cx"> arrayObject->deleteObject(m_context->graphicsContext3D());
</span><span class="cx"> }
</span><span class="lines">@@ -96,10 +97,10 @@
</span><span class="cx"> extensions->bindVertexArrayOES(arrayObject->object());
</span><span class="cx">
</span><span class="cx"> arrayObject->setHasEverBeenBound();
</span><del>- m_context->setBoundVertexArrayObject(arrayObject);
</del><ins>+ static_cast<WebGLRenderingContext*>(m_context)->setBoundVertexArrayObject(arrayObject);
</ins><span class="cx"> } else {
</span><span class="cx"> extensions->bindVertexArrayOES(0);
</span><del>- m_context->setBoundVertexArrayObject(0);
</del><ins>+ static_cast<WebGLRenderingContext*>(m_context)->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<GraphicsContext3D> 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->getExtensions()->ensureEnabled("GL_OES_standard_derivatives");
</span><span class="lines">@@ -768,23 +777,57 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<WebGLVertexArrayObject> WebGL2RenderingContext::createVertexArray()
</span><span class="cx"> {
</span><del>- return nullptr;
</del><ins>+ if (isContextLost())
+ return 0;
+
+ RefPtr<WebGLVertexArrayObject> 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->isDeleted())
+ return;
+
+ if (!arrayObject->isDefaultObject() && arrayObject == m_boundVertexArrayObject)
+ setBoundVertexArrayObject(0);
+
+ arrayObject->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->hasEverBeenBound() || !arrayObject->validate(0, this))
+ return 0;
+
+ return m_context->isVertexArray(arrayObject->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 && (arrayObject->isDeleted() || !arrayObject->validate(0, this) || !m_contextObjects.contains(arrayObject))) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
+ if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object()) {
+ m_context->bindVertexArray(arrayObject->object());
+
+ arrayObject->setHasEverBeenBound();
+ setBoundVertexArrayObject(arrayObject);
+ } else {
+ m_context->bindVertexArray(m_defaultVertexArrayObject->object());
+ setBoundVertexArrayObject(m_defaultVertexArrayObject);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebGLExtension* WebGL2RenderingContext::getExtension(const String& 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->isDefaultObject())
+ return WebGLGetInfo(PassRefPtr<WebGLVertexArrayObject>(static_cast<WebGLVertexArrayObject*>(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, "getParameter", "parameter name not yet supported");
</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& numElementsRequired) override;
</span><span class="cx"> virtual bool validateDrawElements(const char* functionName, GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, unsigned& 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 "WebGLGetInfo.h"
</span><span class="cx">
</span><del>-#include "WebGLBuffer.h"
-#include "WebGLFramebuffer.h"
-#include "WebGLProgram.h"
-#include "WebGLRenderbuffer.h"
-#include "WebGLTexture.h"
-#include "WebGLVertexArrayObjectOES.h"
</del><span class="cx"> #include <runtime/Float32Array.h>
</span><span class="cx"> #include <runtime/Int32Array.h>
</span><span class="cx"> #include <runtime/Uint32Array.h>
</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<WebGLVertexArrayObject> 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<WebGLVertexArrayObjectOES> WebGLGetInfo::getWebGLVertexArrayObjectOES() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(getType() == kTypeWebGLVertexArrayObjectOES);
</span><ins>+ return m_webglVertexArrayObjectOES;
+}
+
+PassRefPtr<WebGLVertexArrayObject> 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 "WebGLProgram.h"
</span><span class="cx"> #include "WebGLRenderbuffer.h"
</span><span class="cx"> #include "WebGLTexture.h"
</span><ins>+#include "WebGLVertexArrayObject.h"
</ins><span class="cx"> #include "WebGLVertexArrayObjectOES.h"
</span><span class="cx"> #include <runtime/Float32Array.h>
</span><span class="cx"> #include <runtime/Int32Array.h>
</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<Uint8Array> value);
</span><span class="cx"> explicit WebGLGetInfo(PassRefPtr<Uint32Array> value);
</span><span class="cx"> explicit WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES> value);
</span><ins>+ explicit WebGLGetInfo(PassRefPtr<WebGLVertexArrayObject> 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<Uint8Array> getWebGLUnsignedByteArray() const;
</span><span class="cx"> PassRefPtr<Uint32Array> getWebGLUnsignedIntArray() const;
</span><span class="cx"> PassRefPtr<WebGLVertexArrayObjectOES> getWebGLVertexArrayObjectOES() const;
</span><ins>+ PassRefPtr<WebGLVertexArrayObject> 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<WebGLTexture> m_webglTexture;
</span><span class="cx"> RefPtr<Uint8Array> m_webglUnsignedByteArray;
</span><span class="cx"> RefPtr<Uint32Array> m_webglUnsignedIntArray;
</span><del>- RefPtr<WebGLVertexArrayObjectOES> m_webglVertexArrayObject;
</del><ins>+ RefPtr<WebGLVertexArrayObjectOES> m_webglVertexArrayObjectOES;
+ RefPtr<WebGLVertexArrayObject> 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 "WebGLDepthTexture.h"
</span><span class="cx"> #include "WebGLDrawBuffers.h"
</span><span class="cx"> #include "WebGLLoseContext.h"
</span><ins>+#include "WebGLVertexArrayObjectOES.h"
</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<GraphicsContext3D> 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& 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->isDefaultObject())
</span><del>- return WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES>(m_boundVertexArrayObject));
</del><ins>+ return WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES>(static_cast<WebGLVertexArrayObjectOES*>(m_boundVertexArrayObject.get())));
</ins><span class="cx"> return WebGLGetInfo();
</span><span class="cx"> }
</span><span class="cx"> synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getParameter", "invalid parameter name, OES_vertex_array_object not enabled");
</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& numElementsRequired) override;
</span><span class="cx"> virtual bool validateDrawElements(const char* functionName, GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, unsigned& 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->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& state = m_boundVertexArrayObject->getVertexAttribState(index);
</del><ins>+ WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
</ins><span class="cx"> state.enabled = false;
</span><span class="cx">
</span><span class="cx"> if (index > 0 || isGLES2Compliant())
</span><span class="lines">@@ -1722,7 +1716,7 @@
</span><span class="cx"> for (int i = 0; i < numActiveAttribLocations; ++i) {
</span><span class="cx"> int loc = m_currentProgram->getActiveAttribLocation(i);
</span><span class="cx"> if (loc >= 0 && loc < static_cast<int>(m_maxVertexAttribs)) {
</span><del>- const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(loc);
</del><ins>+ const WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->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& state = m_boundVertexArrayObject->getVertexAttribState(index);
</del><ins>+ WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
</ins><span class="cx"> state.enabled = true;
</span><span class="cx">
</span><span class="cx"> m_context->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& state = m_boundVertexArrayObject->getVertexAttribState(index);
</del><ins>+ const WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
</ins><span class="cx">
</span><span class="cx"> if (m_angleInstancedArrays && 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& state = m_boundVertexArrayObject->getVertexAttribState(0);
</del><ins>+ WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
</ins><span class="cx">
</span><span class="cx"> m_vertexAttrib0Buffer = createBuffer();
</span><span class="cx"> m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer->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& state = m_boundVertexArrayObject->getVertexAttribState(0);
</del><ins>+ const WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
</ins><span class="cx"> const VertexAttribValue& 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& state = m_boundVertexArrayObject->getVertexAttribState(0);
</del><ins>+ const WebGLVertexArrayObjectBase::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
</ins><span class="cx"> if (state.bufferBinding != m_vertexAttrib0Buffer) {
</span><span class="cx"> m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, objectOrZero(state.bufferBinding.get()));
</span><span class="cx"> m_context->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()->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextrestoredEvent, false, true, ""));
</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<WebGLBuffer> m_boundArrayBuffer;
</span><del>-
- RefPtr<WebGLVertexArrayObjectOES> m_defaultVertexArrayObject;
- RefPtr<WebGLVertexArrayObjectOES> m_boundVertexArrayObject;
- void setBoundVertexArrayObject(PassRefPtr<WebGLVertexArrayObjectOES> arrayObject)
</del><ins>+
+ RefPtr<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject;
+ RefPtr<WebGLVertexArrayObjectBase> m_boundVertexArrayObject;
+ void setBoundVertexArrayObject(PassRefPtr<WebGLVertexArrayObjectBase> 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 "WebGLVertexArrayObject.h"
</span><span class="cx">
</span><ins>+#include "WebGL2RenderingContext.h"
</ins><span class="cx"> #include "WebGLContextGroup.h"
</span><del>-#include "WebGLRenderingContextBase.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-PassRefPtr<WebGLVertexArrayObject> WebGLVertexArrayObject::create(WebGLRenderingContextBase* ctx)
</del><ins>+PassRefPtr<WebGLVertexArrayObject> 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()->graphicsContext3D()->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->deleteVertexArray(object);
+ break;
+ }
+
+ if (m_boundElementArrayBuffer)
+ m_boundElementArrayBuffer->onDetached(context3d);
+
+ for (size_t i = 0; i < m_vertexAttribState.size(); ++i) {
+ VertexAttribState& state = m_vertexAttribState[i];
+ if (state.bufferBinding)
+ state.bufferBinding->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 "WebGLSharedObject.h"
</del><ins>+#include "WebGLBuffer.h"
+#include "WebGLContextObject.h"
+#include "WebGLVertexArrayObjectBase.h"
</ins><span class="cx">
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</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<WebGLVertexArrayObject> create(WebGLRenderingContextBase*, VAOType);
</ins><span class="cx"> virtual ~WebGLVertexArrayObject();
</span><del>-
- static PassRefPtr<WebGLVertexArrayObject> 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 "config.h"
+
+#if ENABLE(WEBGL)
+#include "WebGLVertexArrayObjectBase.h"
+
+#include "WebGLRenderingContextBase.h"
+
+namespace WebCore {
+
+WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase* ctx, VAOType type)
+ : WebGLContextObject(ctx)
+ , m_type(type)
+ , m_hasEverBeenBound(false)
+ , m_boundElementArrayBuffer(0)
+{
+ m_vertexAttribState.resize(ctx->getMaxVertexAttribs());
+}
+
+void WebGLVertexArrayObjectBase::setElementArrayBuffer(PassRefPtr<WebGLBuffer> buffer)
+{
+ if (buffer)
+ buffer->onAttached();
+ if (m_boundElementArrayBuffer)
+ m_boundElementArrayBuffer->onDetached(context()->graphicsContext3D());
+ m_boundElementArrayBuffer = buffer;
+
+}
+
+void WebGLVertexArrayObjectBase::setVertexAttribState(GC3Duint index, GC3Dsizei bytesPerElement, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset, PassRefPtr<WebGLBuffer> buffer)
+{
+ GC3Dsizei validatedStride = stride ? stride : bytesPerElement;
+
+ VertexAttribState& state = m_vertexAttribState[index];
+
+ if (buffer)
+ buffer->onAttached();
+ if (state.bufferBinding)
+ state.bufferBinding->onDetached(context()->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<WebGLBuffer> buffer)
+{
+ if (m_boundElementArrayBuffer == buffer) {
+ m_boundElementArrayBuffer->onDetached(context()->graphicsContext3D());
+ m_boundElementArrayBuffer = 0;
+ }
+
+ for (size_t i = 0; i < m_vertexAttribState.size(); ++i) {
+ VertexAttribState& state = m_vertexAttribState[i];
+ if (state.bufferBinding == buffer) {
+ buffer->onDetached(context()->graphicsContext3D());
+
+ if (!i && !context()->isGLES2Compliant()) {
+ state.bufferBinding = context()->m_vertexAttrib0Buffer;
+ state.bufferBinding->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& 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 "WebGLBuffer.h"
+#include "WebGLContextObject.h"
+
+#include <wtf/PassRefPtr.h>
+
+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 && bufferBinding->object(); }
+ bool validateBinding() const { return !enabled || isBound(); }
+
+ bool enabled;
+ RefPtr<WebGLBuffer> 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() && m_hasEverBeenBound; }
+ void setHasEverBeenBound() { m_hasEverBeenBound = true; }
+
+ PassRefPtr<WebGLBuffer> getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
+ void setElementArrayBuffer(PassRefPtr<WebGLBuffer>);
+
+ VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribState[index]; }
+ void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, PassRefPtr<WebGLBuffer>);
+ void unbindBuffer(PassRefPtr<WebGLBuffer>);
+
+ void setVertexAttribDivisor(GC3Duint index, GC3Duint divisor);
+
+protected:
+ WebGLVertexArrayObjectBase(WebGLRenderingContextBase*, VAOType);
+ virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) = 0;
+
+ VAOType m_type;
+ bool m_hasEverBeenBound;
+ RefPtr<WebGLBuffer> m_boundElementArrayBuffer;
+ Vector<VertexAttribState> 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<WebGLVertexArrayObjectOES> WebGLVertexArrayObjectOES::create(WebGLRenderingContextBase* ctx, VaoType type)
</del><ins>+PassRefPtr<WebGLVertexArrayObjectOES> 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->getMaxVertexAttribs());
-
</del><span class="cx"> Extensions3D* extensions = context()->graphicsContext3D()->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->createVertexArrayOES());
</span><span class="lines">@@ -66,7 +61,7 @@
</span><span class="cx"> {
</span><span class="cx"> Extensions3D* extensions = context3d->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->deleteVertexArrayOES(object);
</span><span class="lines">@@ -82,73 +77,6 @@
</span><span class="cx"> state.bufferBinding->onDetached(context3d);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
-void WebGLVertexArrayObjectOES::setElementArrayBuffer(PassRefPtr<WebGLBuffer> buffer)
-{
- if (buffer)
- buffer->onAttached();
- if (m_boundElementArrayBuffer)
- m_boundElementArrayBuffer->onDetached(context()->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<WebGLBuffer> buffer)
-{
- GC3Dsizei validatedStride = stride ? stride : bytesPerElement;
-
- VertexAttribState& state = m_vertexAttribState[index];
-
- if (buffer)
- buffer->onAttached();
- if (state.bufferBinding)
- state.bufferBinding->onDetached(context()->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<WebGLBuffer> buffer)
-{
- if (m_boundElementArrayBuffer == buffer) {
- m_boundElementArrayBuffer->onDetached(context()->graphicsContext3D());
- m_boundElementArrayBuffer = 0;
- }
-
- for (size_t i = 0; i < m_vertexAttribState.size(); ++i) {
- VertexAttribState& state = m_vertexAttribState[i];
- if (state.bufferBinding == buffer) {
- buffer->onDetached(context()->graphicsContext3D());
-
- if (!i && !context()->isGLES2Compliant()) {
- state.bufferBinding = context()->m_vertexAttrib0Buffer;
- state.bufferBinding->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& 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 "WebGLBuffer.h"
</span><span class="cx"> #include "WebGLContextObject.h"
</span><ins>+#include "WebGLVertexArrayObjectBase.h"
</ins><span class="cx">
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</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<WebGLVertexArrayObjectOES> create(WebGLRenderingContextBase*, VAOType);
</ins><span class="cx"> virtual ~WebGLVertexArrayObjectOES();
</span><del>-
- static PassRefPtr<WebGLVertexArrayObjectOES> 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 && bufferBinding->object(); }
- bool validateBinding() const { return !enabled || isBound(); }
-
- bool enabled;
- RefPtr<WebGLBuffer> 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() && m_hasEverBeenBound; }
- void setHasEverBeenBound() { m_hasEverBeenBound = true; }
-
- PassRefPtr<WebGLBuffer> getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
- void setElementArrayBuffer(PassRefPtr<WebGLBuffer>);
-
- VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribState[index]; }
- void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, PassRefPtr<WebGLBuffer>);
- void unbindBuffer(PassRefPtr<WebGLBuffer>);
-
- 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<WebGLBuffer> m_boundElementArrayBuffer;
- Vector<VertexAttribState> 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, &array);
+#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
+ glGenVertexArraysAPPLE(1, &array);
+#endif
+ return array;
+}
+
+void GraphicsContext3D::deleteVertexArray(Platform3DObject array)
+{
+ if (!array)
+ return;
+
+ makeContextCurrent();
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
+ glDeleteVertexArrays(1, &array);
+#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
+ glDeleteVertexArraysAPPLE(1, &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) && 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) && 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>