WebGL 2 Conformance: primitive restart and draw_primitive_restart WebGL2 sample
https://bugs.webkit.org/show_bug.cgi?id=189625
<rdar://problem/42882620>

Reviewed by Dean Jackson.

Source/WebCore:

Ref test: webgl/webgl2-primitive-restart.html.

Implement support for Primitive Restart Fixed Index as expected
by the WebGL 2 specifications.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::getLastIndex): Template that must be defined in header.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::primitiveRestartIndex):

LayoutTests:

Implement support for Primitive Restart Fixed Index as expected
by the WebGL 2 specifications.

* TestExpectations: Skip some flaky tests between different Mac machines under 2.0.0.
* webgl/webgl2-primitive-restart.html: Canary ref test to be run as part of LayoutTests suite.
* webgl/webgl2-primitive-restart-expected.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations
index 857ad70..f29ecb6 100644
--- a/LayoutTests/TestExpectations
+++ b/LayoutTests/TestExpectations
@@ -965,13 +965,15 @@
 
 webkit.org/b/139640 [ Debug ] webgl/1.0.2/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Slow ]
 
-webkit.org/b/189641 webgl/2.0.0/conformance/buffers/buffer-uninitialized.html [ Failure ]
-webkit.org/b/189641 webgl/2.0.0/conformance/extensions/webgl-draw-buffers.html [ Failure Slow ]
-webkit.org/b/189641 webgl/2.0.0/conformance/renderbuffers/feedback-loop.html [ Failure ] 
-webkit.org/b/189641 webgl/2.0.0/conformance/rendering/clipping-wide-points.html [ Failure ] 
-webkit.org/b/189641 webgl/2.0.0/conformance/textures/misc/copy-tex-image-2d-formats.html [ Failure ] 
-webkit.org/b/189641 webgl/2.0.0/conformance2/state/gl-object-get-calls.html [ Failure Slow ]
-webkit.org/b/189641 webgl/2.0.0/conformance2/textures/misc/tex-3d-size-limit.html [ Failure ]
+# These tests are generating inconsistent results between my machine (AMD) and test bots (INTEL)
+webkit.org/b/189641 webgl/2.0.0/conformance/buffers/buffer-uninitialized.html [ Skip ]
+webkit.org/b/189641 webgl/2.0.0/conformance/extensions/webgl-draw-buffers.html [ Skip ]
+webkit.org/b/189641 webgl/2.0.0/conformance/renderbuffers/feedback-loop.html [ Skip ] 
+webkit.org/b/189641 webgl/2.0.0/conformance/rendering/clipping-wide-points.html [ Skip ] 
+webkit.org/b/189641 webgl/2.0.0/conformance/textures/misc/copy-tex-image-2d-formats.html [ Skip ] 
+webkit.org/b/189641 webgl/2.0.0/conformance2/state/gl-object-get-calls.html [ Skip ]
+webkit.org/b/189641 webgl/2.0.0/conformance2/textures/misc/tex-3d-size-limit.html [ Skip ]
+
 webkit.org/b/189641 webgl/2.0.0/conformance2/rendering/blitframebuffer-filter-outofbounds.html [ Slow ]
 
 [ Debug ] fast/workers/worker-cloneport.html [ Slow ]