Title: [126088] trunk/Source/WebCore
- Revision
- 126088
- Author
- [email protected]
- Date
- 2012-08-20 16:33:47 -0700 (Mon, 20 Aug 2012)
Log Message
[WebGL] OES_vertex_array_object is not correctly un/binding or deleting
https://bugs.webkit.org/show_bug.cgi?id=94029
Reviewed by Ken Russell.
When the currently bound vertex array is deleted, the specification says that
the default object should be bound in its place. Also, binding a null object
as a vertex array was not actually clearing the bound object at the GL layer.
And lastly, it should not be possible to bind a deleted vertex array.
The test case for this is the public Khronos WebGL conformance suite, in particular:
conformance/extensions/oes-vertex-array-object.html
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::deleteVertexArrayOES): Check if the deleted array is
currently bound, and if so, unbind it.
(WebCore::OESVertexArrayObject::bindVertexArrayOES): Make sure never to bind an
array that has been marked as deleted.
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::bindVertexArrayOES): Remove the null check on bind. We
do need to call glBindVertexArrayAPPLE with a null value in order to clear it.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (126087 => 126088)
--- trunk/Source/WebCore/ChangeLog 2012-08-20 23:25:29 UTC (rev 126087)
+++ trunk/Source/WebCore/ChangeLog 2012-08-20 23:33:47 UTC (rev 126088)
@@ -1,3 +1,27 @@
+2012-08-20 Dean Jackson <[email protected]>
+
+ [WebGL] OES_vertex_array_object is not correctly un/binding or deleting
+ https://bugs.webkit.org/show_bug.cgi?id=94029
+
+ Reviewed by Ken Russell.
+
+ When the currently bound vertex array is deleted, the specification says that
+ the default object should be bound in its place. Also, binding a null object
+ as a vertex array was not actually clearing the bound object at the GL layer.
+ And lastly, it should not be possible to bind a deleted vertex array.
+
+ The test case for this is the public Khronos WebGL conformance suite, in particular:
+ conformance/extensions/oes-vertex-array-object.html
+
+ * html/canvas/OESVertexArrayObject.cpp:
+ (WebCore::OESVertexArrayObject::deleteVertexArrayOES): Check if the deleted array is
+ currently bound, and if so, unbind it.
+ (WebCore::OESVertexArrayObject::bindVertexArrayOES): Make sure never to bind an
+ array that has been marked as deleted.
+ * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+ (WebCore::Extensions3DOpenGL::bindVertexArrayOES): Remove the null check on bind. We
+ do need to call glBindVertexArrayAPPLE with a null value in order to clear it.
+
2012-08-20 Kentaro Hara <[email protected]>
[V8] Move clearForClose() and clearForNavigation() from V8Proxy to ScriptController
Modified: trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp (126087 => 126088)
--- trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp 2012-08-20 23:25:29 UTC (rev 126087)
+++ trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp 2012-08-20 23:33:47 UTC (rev 126088)
@@ -69,6 +69,9 @@
if (!arrayObject || m_context->isContextLost())
return;
+ if (!arrayObject->isDefaultObject() && arrayObject == m_context->m_boundVertexArrayObject)
+ m_context->setBoundVertexArrayObject(0);
+
arrayObject->deleteObject(m_context->graphicsContext3D());
}
@@ -90,7 +93,7 @@
if (m_context->isContextLost())
return;
- if (arrayObject && !arrayObject->validate(0, context())) {
+ if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, context()))) {
m_context->graphicsContext3D()->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
@@ -103,7 +106,6 @@
m_context->setBoundVertexArrayObject(arrayObject);
} else {
extensions->bindVertexArrayOES(0);
-
m_context->setBoundVertexArrayObject(0);
}
Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (126087 => 126088)
--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp 2012-08-20 23:25:29 UTC (rev 126087)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp 2012-08-20 23:33:47 UTC (rev 126088)
@@ -99,9 +99,6 @@
void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
{
- if (!array)
- return;
-
m_context->makeContextCurrent();
#if !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
glBindVertexArrayAPPLE(array);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes