When we want to draw the final WebGL output to the screen we call drawInCGLContext which in turn calls GraphicsContext3D::prepareTexture. We used to call glFinish here, which pushes all buffered gl operations and blocks until every operation has been completed and every last pixel has been drawn. glFlush also pushes all buffered gl operations but returns immediately. Using glFinish is a huge performance hit and based on my testing does not seem to offer any particular benefit over glFlush. Thus we will switch to using glFlush. This gives us a 20% performance boost on Unity 3d tests and a 33% boost on the frame rate on http://threejs.org/examples/#webgl_performance.
Created attachment 240154 [details] patch
We should commit this, live on it, and keep an eye out for any unforeseen consequences.
rdar://problem/15846550
Comment on attachment 240154 [details] patch Looks good! r=me.
http://trac.webkit.org/changeset/174915