[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

zmo at google.com zmo at google.com
Fri Jan 21 15:05:48 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 41be671646fe54c2b61a1e8325ac83519ada246e
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 7 01:43:29 2011 +0000

    2011-01-05  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Define GC3D types to match GL types and use them in GraphicsContext3D
            https://bugs.webkit.org/show_bug.cgi?id=45557
    
            * src/GraphicsContext3DChromium.cpp:
            (WebCore::GraphicsContext3DInternal::bindAttribLocation):
            (WebCore::GraphicsContext3DInternal::bufferData):
            (WebCore::GraphicsContext3DInternal::bufferSubData):
            (WebCore::GraphicsContext3DInternal::getActiveAttrib):
            (WebCore::GraphicsContext3DInternal::getActiveUniform):
            (WebCore::GraphicsContext3DInternal::getAttribLocation):
            (WebCore::GraphicsContext3DInternal::getString):
            (WebCore::GraphicsContext3DInternal::getUniformLocation):
            (WebCore::GraphicsContext3DInternal::texImage2D):
            (WebCore::GraphicsContext3DInternal::texSubImage2D):
            (WebCore::GraphicsContext3DInternal::uniform1fv):
            (WebCore::GraphicsContext3DInternal::uniform1iv):
            (WebCore::GraphicsContext3DInternal::uniform2fv):
            (WebCore::GraphicsContext3DInternal::uniform2iv):
            (WebCore::GraphicsContext3DInternal::uniform3fv):
            (WebCore::GraphicsContext3DInternal::uniform3iv):
            (WebCore::GraphicsContext3DInternal::uniform4fv):
            (WebCore::GraphicsContext3DInternal::uniform4iv):
            (WebCore::GraphicsContext3DInternal::uniformMatrix2fv):
            (WebCore::GraphicsContext3DInternal::uniformMatrix3fv):
            (WebCore::GraphicsContext3DInternal::uniformMatrix4fv):
            * src/GraphicsContext3DInternal.h:
    2011-01-05  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Define GC3D types to match GL types and use them in GraphicsContext3D
            https://bugs.webkit.org/show_bug.cgi?id=45557
    
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::readPixels):
            (WebCore::WebGLRenderingContext::validateTexFuncData):
            * platform/graphics/GraphicsContext3D.cpp:
            (WebCore::GraphicsContext3D::texImage2DResourceSafe):
            (WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
            (WebCore::GraphicsContext3D::extractImageData):
            (WebCore::GraphicsContext3D::extractTextureData):
            * platform/graphics/GraphicsContext3D.h:
            * platform/graphics/cg/GraphicsContext3DCG.cpp:
            (WebCore::GraphicsContext3D::getImageData):
            * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
            (WebCore::SharedGraphicsContext3D::enable):
            (WebCore::SharedGraphicsContext3D::disable):
            (WebCore::SharedGraphicsContext3D::clear):
            (WebCore::SharedGraphicsContext3D::drawArrays):
            (WebCore::SharedGraphicsContext3D::getError):
            (WebCore::SharedGraphicsContext3D::getIntegerv):
            (WebCore::SharedGraphicsContext3D::createFramebuffer):
            (WebCore::SharedGraphicsContext3D::createTexture):
            (WebCore::SharedGraphicsContext3D::deleteFramebuffer):
            (WebCore::SharedGraphicsContext3D::deleteTexture):
            (WebCore::SharedGraphicsContext3D::framebufferTexture2D):
            (WebCore::SharedGraphicsContext3D::texParameteri):
            (WebCore::SharedGraphicsContext3D::texImage2D):
            (WebCore::SharedGraphicsContext3D::texSubImage2D):
            (WebCore::SharedGraphicsContext3D::readPixels):
            (WebCore::SharedGraphicsContext3D::setActiveTexture):
            (WebCore::SharedGraphicsContext3D::bindTexture):
            (WebCore::SharedGraphicsContext3D::bindFramebuffer):
            * platform/graphics/gpu/SharedGraphicsContext3D.h:
            * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
            (WebCore::GraphicsContext3D::activeTexture):
            (WebCore::GraphicsContext3D::attachShader):
            (WebCore::GraphicsContext3D::bindAttribLocation):
            (WebCore::GraphicsContext3D::bindBuffer):
            (WebCore::GraphicsContext3D::bindFramebuffer):
            (WebCore::GraphicsContext3D::bindRenderbuffer):
            (WebCore::GraphicsContext3D::bindTexture):
            (WebCore::GraphicsContext3D::blendColor):
            (WebCore::GraphicsContext3D::blendEquation):
            (WebCore::GraphicsContext3D::blendEquationSeparate):
            (WebCore::GraphicsContext3D::blendFunc):
            (WebCore::GraphicsContext3D::blendFuncSeparate):
            (WebCore::GraphicsContext3D::bufferData):
            (WebCore::GraphicsContext3D::bufferSubData):
            (WebCore::GraphicsContext3D::checkFramebufferStatus):
            (WebCore::GraphicsContext3D::clearColor):
            (WebCore::GraphicsContext3D::clear):
            (WebCore::GraphicsContext3D::clearDepth):
            (WebCore::GraphicsContext3D::clearStencil):
            (WebCore::GraphicsContext3D::colorMask):
            (WebCore::GraphicsContext3D::compileShader):
            (WebCore::GraphicsContext3D::copyTexImage2D):
            (WebCore::GraphicsContext3D::copyTexSubImage2D):
            (WebCore::GraphicsContext3D::cullFace):
            (WebCore::GraphicsContext3D::depthFunc):
            (WebCore::GraphicsContext3D::depthMask):
            (WebCore::GraphicsContext3D::depthRange):
            (WebCore::GraphicsContext3D::detachShader):
            (WebCore::GraphicsContext3D::disable):
            (WebCore::GraphicsContext3D::disableVertexAttribArray):
            (WebCore::GraphicsContext3D::drawArrays):
            (WebCore::GraphicsContext3D::drawElements):
            (WebCore::GraphicsContext3D::enable):
            (WebCore::GraphicsContext3D::enableVertexAttribArray):
            (WebCore::GraphicsContext3D::framebufferRenderbuffer):
            (WebCore::GraphicsContext3D::framebufferTexture2D):
            (WebCore::GraphicsContext3D::frontFace):
            (WebCore::GraphicsContext3D::generateMipmap):
            (WebCore::GraphicsContext3D::getActiveAttrib):
            (WebCore::GraphicsContext3D::getActiveUniform):
            (WebCore::GraphicsContext3D::getAttachedShaders):
            (WebCore::GraphicsContext3D::getAttribLocation):
            (WebCore::GraphicsContext3D::getError):
            (WebCore::GraphicsContext3D::getString):
            (WebCore::GraphicsContext3D::hint):
            (WebCore::GraphicsContext3D::isBuffer):
            (WebCore::GraphicsContext3D::isEnabled):
            (WebCore::GraphicsContext3D::isFramebuffer):
            (WebCore::GraphicsContext3D::isProgram):
            (WebCore::GraphicsContext3D::isRenderbuffer):
            (WebCore::GraphicsContext3D::isShader):
            (WebCore::GraphicsContext3D::isTexture):
            (WebCore::GraphicsContext3D::lineWidth):
            (WebCore::GraphicsContext3D::linkProgram):
            (WebCore::GraphicsContext3D::pixelStorei):
            (WebCore::GraphicsContext3D::polygonOffset):
            (WebCore::GraphicsContext3D::readPixels):
            (WebCore::GraphicsContext3D::renderbufferStorage):
            (WebCore::GraphicsContext3D::sampleCoverage):
            (WebCore::GraphicsContext3D::scissor):
            (WebCore::GraphicsContext3D::stencilFunc):
            (WebCore::GraphicsContext3D::stencilFuncSeparate):
            (WebCore::GraphicsContext3D::stencilMask):
            (WebCore::GraphicsContext3D::stencilMaskSeparate):
            (WebCore::GraphicsContext3D::stencilOp):
            (WebCore::GraphicsContext3D::stencilOpSeparate):
            (WebCore::GraphicsContext3D::texParameterf):
            (WebCore::GraphicsContext3D::texParameteri):
            (WebCore::GraphicsContext3D::uniform1f):
            (WebCore::GraphicsContext3D::uniform1fv):
            (WebCore::GraphicsContext3D::uniform2f):
            (WebCore::GraphicsContext3D::uniform2fv):
            (WebCore::GraphicsContext3D::uniform3f):
            (WebCore::GraphicsContext3D::uniform3fv):
            (WebCore::GraphicsContext3D::uniform4f):
            (WebCore::GraphicsContext3D::uniform4fv):
            (WebCore::GraphicsContext3D::uniform1i):
            (WebCore::GraphicsContext3D::uniform1iv):
            (WebCore::GraphicsContext3D::uniform2i):
            (WebCore::GraphicsContext3D::uniform2iv):
            (WebCore::GraphicsContext3D::uniform3i):
            (WebCore::GraphicsContext3D::uniform3iv):
            (WebCore::GraphicsContext3D::uniform4i):
            (WebCore::GraphicsContext3D::uniform4iv):
            (WebCore::GraphicsContext3D::uniformMatrix2fv):
            (WebCore::GraphicsContext3D::uniformMatrix3fv):
            (WebCore::GraphicsContext3D::uniformMatrix4fv):
            (WebCore::GraphicsContext3D::useProgram):
            (WebCore::GraphicsContext3D::validateProgram):
            (WebCore::GraphicsContext3D::vertexAttrib1f):
            (WebCore::GraphicsContext3D::vertexAttrib1fv):
            (WebCore::GraphicsContext3D::vertexAttrib2f):
            (WebCore::GraphicsContext3D::vertexAttrib2fv):
            (WebCore::GraphicsContext3D::vertexAttrib3f):
            (WebCore::GraphicsContext3D::vertexAttrib3fv):
            (WebCore::GraphicsContext3D::vertexAttrib4f):
            (WebCore::GraphicsContext3D::vertexAttrib4fv):
            (WebCore::GraphicsContext3D::vertexAttribPointer):
            (WebCore::GraphicsContext3D::viewport):
            (WebCore::GraphicsContext3D::getBooleanv):
            (WebCore::GraphicsContext3D::getBufferParameteriv):
            (WebCore::GraphicsContext3D::getFloatv):
            (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
            (WebCore::GraphicsContext3D::getIntegerv):
            (WebCore::GraphicsContext3D::getProgramiv):
            (WebCore::GraphicsContext3D::getProgramInfoLog):
            (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
            (WebCore::GraphicsContext3D::getShaderiv):
            (WebCore::GraphicsContext3D::getShaderInfoLog):
            (WebCore::GraphicsContext3D::getTexParameterfv):
            (WebCore::GraphicsContext3D::getTexParameteriv):
            (WebCore::GraphicsContext3D::getUniformfv):
            (WebCore::GraphicsContext3D::getUniformiv):
            (WebCore::GraphicsContext3D::getUniformLocation):
            (WebCore::GraphicsContext3D::getVertexAttribfv):
            (WebCore::GraphicsContext3D::getVertexAttribiv):
            (WebCore::GraphicsContext3D::getVertexAttribOffset):
            (WebCore::GraphicsContext3D::texImage2D):
            (WebCore::GraphicsContext3D::texSubImage2D):
            (WebCore::GraphicsContext3D::createBuffer):
            (WebCore::GraphicsContext3D::createFramebuffer):
            (WebCore::GraphicsContext3D::createProgram):
            (WebCore::GraphicsContext3D::createRenderbuffer):
            (WebCore::GraphicsContext3D::createShader):
            (WebCore::GraphicsContext3D::createTexture):
            (WebCore::GraphicsContext3D::deleteBuffer):
            (WebCore::GraphicsContext3D::deleteFramebuffer):
            (WebCore::GraphicsContext3D::deleteProgram):
            (WebCore::GraphicsContext3D::deleteRenderbuffer):
            (WebCore::GraphicsContext3D::deleteShader):
            (WebCore::GraphicsContext3D::deleteTexture):
            (WebCore::GraphicsContext3D::sizeInBytes):
            (WebCore::GraphicsContext3D::synthesizeGLError):
            * platform/graphics/qt/GraphicsContext3DQt.cpp:
            (WebCore::GraphicsContext3D::activeTexture):
            (WebCore::GraphicsContext3D::attachShader):
            (WebCore::GraphicsContext3D::getAttachedShaders):
            (WebCore::GraphicsContext3D::bindAttribLocation):
            (WebCore::GraphicsContext3D::bindBuffer):
            (WebCore::GraphicsContext3D::bindFramebuffer):
            (WebCore::GraphicsContext3D::bindRenderbuffer):
            (WebCore::GraphicsContext3D::bindTexture):
            (WebCore::GraphicsContext3D::blendColor):
            (WebCore::GraphicsContext3D::blendEquation):
            (WebCore::GraphicsContext3D::blendEquationSeparate):
            (WebCore::GraphicsContext3D::blendFunc):
            (WebCore::GraphicsContext3D::blendFuncSeparate):
            (WebCore::GraphicsContext3D::bufferData):
            (WebCore::GraphicsContext3D::bufferSubData):
            (WebCore::GraphicsContext3D::checkFramebufferStatus):
            (WebCore::GraphicsContext3D::clearColor):
            (WebCore::GraphicsContext3D::clear):
            (WebCore::GraphicsContext3D::clearDepth):
            (WebCore::GraphicsContext3D::clearStencil):
            (WebCore::GraphicsContext3D::colorMask):
            (WebCore::GraphicsContext3D::compileShader):
            (WebCore::GraphicsContext3D::copyTexImage2D):
            (WebCore::GraphicsContext3D::copyTexSubImage2D):
            (WebCore::GraphicsContext3D::cullFace):
            (WebCore::GraphicsContext3D::depthFunc):
            (WebCore::GraphicsContext3D::depthMask):
            (WebCore::GraphicsContext3D::depthRange):
            (WebCore::GraphicsContext3D::detachShader):
            (WebCore::GraphicsContext3D::disable):
            (WebCore::GraphicsContext3D::disableVertexAttribArray):
            (WebCore::GraphicsContext3D::drawArrays):
            (WebCore::GraphicsContext3D::drawElements):
            (WebCore::GraphicsContext3D::enable):
            (WebCore::GraphicsContext3D::enableVertexAttribArray):
            (WebCore::GraphicsContext3D::framebufferRenderbuffer):
            (WebCore::GraphicsContext3D::framebufferTexture2D):
            (WebCore::GraphicsContext3D::frontFace):
            (WebCore::GraphicsContext3D::generateMipmap):
            (WebCore::GraphicsContext3D::getActiveAttrib):
            (WebCore::GraphicsContext3D::getActiveUniform):
            (WebCore::GraphicsContext3D::getAttribLocation):
            (WebCore::GraphicsContext3D::getError):
            (WebCore::GraphicsContext3D::getString):
            (WebCore::GraphicsContext3D::hint):
            (WebCore::GraphicsContext3D::isBuffer):
            (WebCore::GraphicsContext3D::isEnabled):
            (WebCore::GraphicsContext3D::isFramebuffer):
            (WebCore::GraphicsContext3D::isProgram):
            (WebCore::GraphicsContext3D::isRenderbuffer):
            (WebCore::GraphicsContext3D::isShader):
            (WebCore::GraphicsContext3D::isTexture):
            (WebCore::GraphicsContext3D::linkProgram):
            (WebCore::GraphicsContext3D::pixelStorei):
            (WebCore::GraphicsContext3D::polygonOffset):
            (WebCore::GraphicsContext3D::readPixels):
            (WebCore::GraphicsContext3D::renderbufferStorage):
            (WebCore::GraphicsContext3D::sampleCoverage):
            (WebCore::GraphicsContext3D::scissor):
            (WebCore::GraphicsContext3D::stencilFunc):
            (WebCore::GraphicsContext3D::stencilFuncSeparate):
            (WebCore::GraphicsContext3D::stencilMask):
            (WebCore::GraphicsContext3D::stencilMaskSeparate):
            (WebCore::GraphicsContext3D::stencilOp):
            (WebCore::GraphicsContext3D::stencilOpSeparate):
            (WebCore::GraphicsContext3D::texParameterf):
            (WebCore::GraphicsContext3D::texParameteri):
            (WebCore::GraphicsContext3D::uniform1f):
            (WebCore::GraphicsContext3D::uniform1fv):
            (WebCore::GraphicsContext3D::uniform2f):
            (WebCore::GraphicsContext3D::uniform2fv):
            (WebCore::GraphicsContext3D::uniform3f):
            (WebCore::GraphicsContext3D::uniform3fv):
            (WebCore::GraphicsContext3D::uniform4f):
            (WebCore::GraphicsContext3D::uniform4fv):
            (WebCore::GraphicsContext3D::uniform1i):
            (WebCore::GraphicsContext3D::uniform1iv):
            (WebCore::GraphicsContext3D::uniform2i):
            (WebCore::GraphicsContext3D::uniform2iv):
            (WebCore::GraphicsContext3D::uniform3i):
            (WebCore::GraphicsContext3D::uniform3iv):
            (WebCore::GraphicsContext3D::uniform4i):
            (WebCore::GraphicsContext3D::uniform4iv):
            (WebCore::GraphicsContext3D::uniformMatrix2fv):
            (WebCore::GraphicsContext3D::uniformMatrix3fv):
            (WebCore::GraphicsContext3D::uniformMatrix4fv):
            (WebCore::GraphicsContext3D::useProgram):
            (WebCore::GraphicsContext3D::validateProgram):
            (WebCore::GraphicsContext3D::vertexAttrib1f):
            (WebCore::GraphicsContext3D::vertexAttrib1fv):
            (WebCore::GraphicsContext3D::vertexAttrib2f):
            (WebCore::GraphicsContext3D::vertexAttrib2fv):
            (WebCore::GraphicsContext3D::vertexAttrib3f):
            (WebCore::GraphicsContext3D::vertexAttrib3fv):
            (WebCore::GraphicsContext3D::vertexAttrib4f):
            (WebCore::GraphicsContext3D::vertexAttrib4fv):
            (WebCore::GraphicsContext3D::vertexAttribPointer):
            (WebCore::GraphicsContext3D::viewport):
            (WebCore::GraphicsContext3D::getBooleanv):
            (WebCore::GraphicsContext3D::getBufferParameteriv):
            (WebCore::GraphicsContext3D::getFloatv):
            (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
            (WebCore::GraphicsContext3D::getIntegerv):
            (WebCore::GraphicsContext3D::getProgramiv):
            (WebCore::GraphicsContext3D::getProgramInfoLog):
            (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
            (WebCore::GraphicsContext3D::getShaderiv):
            (WebCore::GraphicsContext3D::getShaderInfoLog):
            (WebCore::GraphicsContext3D::getShaderSource):
            (WebCore::GraphicsContext3D::getTexParameterfv):
            (WebCore::GraphicsContext3D::getTexParameteriv):
            (WebCore::GraphicsContext3D::getUniformfv):
            (WebCore::GraphicsContext3D::getUniformiv):
            (WebCore::GraphicsContext3D::getUniformLocation):
            (WebCore::GraphicsContext3D::getVertexAttribfv):
            (WebCore::GraphicsContext3D::getVertexAttribiv):
            (WebCore::GraphicsContext3D::getVertexAttribOffset):
            (WebCore::GraphicsContext3D::texImage2D):
            (WebCore::GraphicsContext3D::texSubImage2D):
            (WebCore::GraphicsContext3D::createBuffer):
            (WebCore::GraphicsContext3D::createFramebuffer):
            (WebCore::GraphicsContext3D::createProgram):
            (WebCore::GraphicsContext3D::createRenderbuffer):
            (WebCore::GraphicsContext3D::createShader):
            (WebCore::GraphicsContext3D::createTexture):
            (WebCore::GraphicsContext3D::deleteBuffer):
            (WebCore::GraphicsContext3D::deleteFramebuffer):
            (WebCore::GraphicsContext3D::deleteProgram):
            (WebCore::GraphicsContext3D::deleteRenderbuffer):
            (WebCore::GraphicsContext3D::deleteShader):
            (WebCore::GraphicsContext3D::deleteTexture):
            (WebCore::GraphicsContext3D::sizeInBytes):
            (WebCore::GraphicsContext3D::synthesizeGLError):
            (WebCore::GraphicsContext3D::getImageData):
            * platform/graphics/skia/GraphicsContext3DSkia.cpp:
            (WebCore::GraphicsContext3D::getImageData):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6d81d20..74c2491 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,313 @@
+2011-01-05  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Define GC3D types to match GL types and use them in GraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=45557
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::readPixels):
+        (WebCore::WebGLRenderingContext::validateTexFuncData):
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::texImage2DResourceSafe):
+        (WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
+        (WebCore::GraphicsContext3D::extractImageData):
+        (WebCore::GraphicsContext3D::extractTextureData):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::GraphicsContext3D::getImageData):
+        * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
+        (WebCore::SharedGraphicsContext3D::enable):
+        (WebCore::SharedGraphicsContext3D::disable):
+        (WebCore::SharedGraphicsContext3D::clear):
+        (WebCore::SharedGraphicsContext3D::drawArrays):
+        (WebCore::SharedGraphicsContext3D::getError):
+        (WebCore::SharedGraphicsContext3D::getIntegerv):
+        (WebCore::SharedGraphicsContext3D::createFramebuffer):
+        (WebCore::SharedGraphicsContext3D::createTexture):
+        (WebCore::SharedGraphicsContext3D::deleteFramebuffer):
+        (WebCore::SharedGraphicsContext3D::deleteTexture):
+        (WebCore::SharedGraphicsContext3D::framebufferTexture2D):
+        (WebCore::SharedGraphicsContext3D::texParameteri):
+        (WebCore::SharedGraphicsContext3D::texImage2D):
+        (WebCore::SharedGraphicsContext3D::texSubImage2D):
+        (WebCore::SharedGraphicsContext3D::readPixels):
+        (WebCore::SharedGraphicsContext3D::setActiveTexture):
+        (WebCore::SharedGraphicsContext3D::bindTexture):
+        (WebCore::SharedGraphicsContext3D::bindFramebuffer):
+        * platform/graphics/gpu/SharedGraphicsContext3D.h:
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::activeTexture):
+        (WebCore::GraphicsContext3D::attachShader):
+        (WebCore::GraphicsContext3D::bindAttribLocation):
+        (WebCore::GraphicsContext3D::bindBuffer):
+        (WebCore::GraphicsContext3D::bindFramebuffer):
+        (WebCore::GraphicsContext3D::bindRenderbuffer):
+        (WebCore::GraphicsContext3D::bindTexture):
+        (WebCore::GraphicsContext3D::blendColor):
+        (WebCore::GraphicsContext3D::blendEquation):
+        (WebCore::GraphicsContext3D::blendEquationSeparate):
+        (WebCore::GraphicsContext3D::blendFunc):
+        (WebCore::GraphicsContext3D::blendFuncSeparate):
+        (WebCore::GraphicsContext3D::bufferData):
+        (WebCore::GraphicsContext3D::bufferSubData):
+        (WebCore::GraphicsContext3D::checkFramebufferStatus):
+        (WebCore::GraphicsContext3D::clearColor):
+        (WebCore::GraphicsContext3D::clear):
+        (WebCore::GraphicsContext3D::clearDepth):
+        (WebCore::GraphicsContext3D::clearStencil):
+        (WebCore::GraphicsContext3D::colorMask):
+        (WebCore::GraphicsContext3D::compileShader):
+        (WebCore::GraphicsContext3D::copyTexImage2D):
+        (WebCore::GraphicsContext3D::copyTexSubImage2D):
+        (WebCore::GraphicsContext3D::cullFace):
+        (WebCore::GraphicsContext3D::depthFunc):
+        (WebCore::GraphicsContext3D::depthMask):
+        (WebCore::GraphicsContext3D::depthRange):
+        (WebCore::GraphicsContext3D::detachShader):
+        (WebCore::GraphicsContext3D::disable):
+        (WebCore::GraphicsContext3D::disableVertexAttribArray):
+        (WebCore::GraphicsContext3D::drawArrays):
+        (WebCore::GraphicsContext3D::drawElements):
+        (WebCore::GraphicsContext3D::enable):
+        (WebCore::GraphicsContext3D::enableVertexAttribArray):
+        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
+        (WebCore::GraphicsContext3D::framebufferTexture2D):
+        (WebCore::GraphicsContext3D::frontFace):
+        (WebCore::GraphicsContext3D::generateMipmap):
+        (WebCore::GraphicsContext3D::getActiveAttrib):
+        (WebCore::GraphicsContext3D::getActiveUniform):
+        (WebCore::GraphicsContext3D::getAttachedShaders):
+        (WebCore::GraphicsContext3D::getAttribLocation):
+        (WebCore::GraphicsContext3D::getError):
+        (WebCore::GraphicsContext3D::getString):
+        (WebCore::GraphicsContext3D::hint):
+        (WebCore::GraphicsContext3D::isBuffer):
+        (WebCore::GraphicsContext3D::isEnabled):
+        (WebCore::GraphicsContext3D::isFramebuffer):
+        (WebCore::GraphicsContext3D::isProgram):
+        (WebCore::GraphicsContext3D::isRenderbuffer):
+        (WebCore::GraphicsContext3D::isShader):
+        (WebCore::GraphicsContext3D::isTexture):
+        (WebCore::GraphicsContext3D::lineWidth):
+        (WebCore::GraphicsContext3D::linkProgram):
+        (WebCore::GraphicsContext3D::pixelStorei):
+        (WebCore::GraphicsContext3D::polygonOffset):
+        (WebCore::GraphicsContext3D::readPixels):
+        (WebCore::GraphicsContext3D::renderbufferStorage):
+        (WebCore::GraphicsContext3D::sampleCoverage):
+        (WebCore::GraphicsContext3D::scissor):
+        (WebCore::GraphicsContext3D::stencilFunc):
+        (WebCore::GraphicsContext3D::stencilFuncSeparate):
+        (WebCore::GraphicsContext3D::stencilMask):
+        (WebCore::GraphicsContext3D::stencilMaskSeparate):
+        (WebCore::GraphicsContext3D::stencilOp):
+        (WebCore::GraphicsContext3D::stencilOpSeparate):
+        (WebCore::GraphicsContext3D::texParameterf):
+        (WebCore::GraphicsContext3D::texParameteri):
+        (WebCore::GraphicsContext3D::uniform1f):
+        (WebCore::GraphicsContext3D::uniform1fv):
+        (WebCore::GraphicsContext3D::uniform2f):
+        (WebCore::GraphicsContext3D::uniform2fv):
+        (WebCore::GraphicsContext3D::uniform3f):
+        (WebCore::GraphicsContext3D::uniform3fv):
+        (WebCore::GraphicsContext3D::uniform4f):
+        (WebCore::GraphicsContext3D::uniform4fv):
+        (WebCore::GraphicsContext3D::uniform1i):
+        (WebCore::GraphicsContext3D::uniform1iv):
+        (WebCore::GraphicsContext3D::uniform2i):
+        (WebCore::GraphicsContext3D::uniform2iv):
+        (WebCore::GraphicsContext3D::uniform3i):
+        (WebCore::GraphicsContext3D::uniform3iv):
+        (WebCore::GraphicsContext3D::uniform4i):
+        (WebCore::GraphicsContext3D::uniform4iv):
+        (WebCore::GraphicsContext3D::uniformMatrix2fv):
+        (WebCore::GraphicsContext3D::uniformMatrix3fv):
+        (WebCore::GraphicsContext3D::uniformMatrix4fv):
+        (WebCore::GraphicsContext3D::useProgram):
+        (WebCore::GraphicsContext3D::validateProgram):
+        (WebCore::GraphicsContext3D::vertexAttrib1f):
+        (WebCore::GraphicsContext3D::vertexAttrib1fv):
+        (WebCore::GraphicsContext3D::vertexAttrib2f):
+        (WebCore::GraphicsContext3D::vertexAttrib2fv):
+        (WebCore::GraphicsContext3D::vertexAttrib3f):
+        (WebCore::GraphicsContext3D::vertexAttrib3fv):
+        (WebCore::GraphicsContext3D::vertexAttrib4f):
+        (WebCore::GraphicsContext3D::vertexAttrib4fv):
+        (WebCore::GraphicsContext3D::vertexAttribPointer):
+        (WebCore::GraphicsContext3D::viewport):
+        (WebCore::GraphicsContext3D::getBooleanv):
+        (WebCore::GraphicsContext3D::getBufferParameteriv):
+        (WebCore::GraphicsContext3D::getFloatv):
+        (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
+        (WebCore::GraphicsContext3D::getIntegerv):
+        (WebCore::GraphicsContext3D::getProgramiv):
+        (WebCore::GraphicsContext3D::getProgramInfoLog):
+        (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
+        (WebCore::GraphicsContext3D::getShaderiv):
+        (WebCore::GraphicsContext3D::getShaderInfoLog):
+        (WebCore::GraphicsContext3D::getTexParameterfv):
+        (WebCore::GraphicsContext3D::getTexParameteriv):
+        (WebCore::GraphicsContext3D::getUniformfv):
+        (WebCore::GraphicsContext3D::getUniformiv):
+        (WebCore::GraphicsContext3D::getUniformLocation):
+        (WebCore::GraphicsContext3D::getVertexAttribfv):
+        (WebCore::GraphicsContext3D::getVertexAttribiv):
+        (WebCore::GraphicsContext3D::getVertexAttribOffset):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::texSubImage2D):
+        (WebCore::GraphicsContext3D::createBuffer):
+        (WebCore::GraphicsContext3D::createFramebuffer):
+        (WebCore::GraphicsContext3D::createProgram):
+        (WebCore::GraphicsContext3D::createRenderbuffer):
+        (WebCore::GraphicsContext3D::createShader):
+        (WebCore::GraphicsContext3D::createTexture):
+        (WebCore::GraphicsContext3D::deleteBuffer):
+        (WebCore::GraphicsContext3D::deleteFramebuffer):
+        (WebCore::GraphicsContext3D::deleteProgram):
+        (WebCore::GraphicsContext3D::deleteRenderbuffer):
+        (WebCore::GraphicsContext3D::deleteShader):
+        (WebCore::GraphicsContext3D::deleteTexture):
+        (WebCore::GraphicsContext3D::sizeInBytes):
+        (WebCore::GraphicsContext3D::synthesizeGLError):
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::activeTexture):
+        (WebCore::GraphicsContext3D::attachShader):
+        (WebCore::GraphicsContext3D::getAttachedShaders):
+        (WebCore::GraphicsContext3D::bindAttribLocation):
+        (WebCore::GraphicsContext3D::bindBuffer):
+        (WebCore::GraphicsContext3D::bindFramebuffer):
+        (WebCore::GraphicsContext3D::bindRenderbuffer):
+        (WebCore::GraphicsContext3D::bindTexture):
+        (WebCore::GraphicsContext3D::blendColor):
+        (WebCore::GraphicsContext3D::blendEquation):
+        (WebCore::GraphicsContext3D::blendEquationSeparate):
+        (WebCore::GraphicsContext3D::blendFunc):
+        (WebCore::GraphicsContext3D::blendFuncSeparate):
+        (WebCore::GraphicsContext3D::bufferData):
+        (WebCore::GraphicsContext3D::bufferSubData):
+        (WebCore::GraphicsContext3D::checkFramebufferStatus):
+        (WebCore::GraphicsContext3D::clearColor):
+        (WebCore::GraphicsContext3D::clear):
+        (WebCore::GraphicsContext3D::clearDepth):
+        (WebCore::GraphicsContext3D::clearStencil):
+        (WebCore::GraphicsContext3D::colorMask):
+        (WebCore::GraphicsContext3D::compileShader):
+        (WebCore::GraphicsContext3D::copyTexImage2D):
+        (WebCore::GraphicsContext3D::copyTexSubImage2D):
+        (WebCore::GraphicsContext3D::cullFace):
+        (WebCore::GraphicsContext3D::depthFunc):
+        (WebCore::GraphicsContext3D::depthMask):
+        (WebCore::GraphicsContext3D::depthRange):
+        (WebCore::GraphicsContext3D::detachShader):
+        (WebCore::GraphicsContext3D::disable):
+        (WebCore::GraphicsContext3D::disableVertexAttribArray):
+        (WebCore::GraphicsContext3D::drawArrays):
+        (WebCore::GraphicsContext3D::drawElements):
+        (WebCore::GraphicsContext3D::enable):
+        (WebCore::GraphicsContext3D::enableVertexAttribArray):
+        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
+        (WebCore::GraphicsContext3D::framebufferTexture2D):
+        (WebCore::GraphicsContext3D::frontFace):
+        (WebCore::GraphicsContext3D::generateMipmap):
+        (WebCore::GraphicsContext3D::getActiveAttrib):
+        (WebCore::GraphicsContext3D::getActiveUniform):
+        (WebCore::GraphicsContext3D::getAttribLocation):
+        (WebCore::GraphicsContext3D::getError):
+        (WebCore::GraphicsContext3D::getString):
+        (WebCore::GraphicsContext3D::hint):
+        (WebCore::GraphicsContext3D::isBuffer):
+        (WebCore::GraphicsContext3D::isEnabled):
+        (WebCore::GraphicsContext3D::isFramebuffer):
+        (WebCore::GraphicsContext3D::isProgram):
+        (WebCore::GraphicsContext3D::isRenderbuffer):
+        (WebCore::GraphicsContext3D::isShader):
+        (WebCore::GraphicsContext3D::isTexture):
+        (WebCore::GraphicsContext3D::linkProgram):
+        (WebCore::GraphicsContext3D::pixelStorei):
+        (WebCore::GraphicsContext3D::polygonOffset):
+        (WebCore::GraphicsContext3D::readPixels):
+        (WebCore::GraphicsContext3D::renderbufferStorage):
+        (WebCore::GraphicsContext3D::sampleCoverage):
+        (WebCore::GraphicsContext3D::scissor):
+        (WebCore::GraphicsContext3D::stencilFunc):
+        (WebCore::GraphicsContext3D::stencilFuncSeparate):
+        (WebCore::GraphicsContext3D::stencilMask):
+        (WebCore::GraphicsContext3D::stencilMaskSeparate):
+        (WebCore::GraphicsContext3D::stencilOp):
+        (WebCore::GraphicsContext3D::stencilOpSeparate):
+        (WebCore::GraphicsContext3D::texParameterf):
+        (WebCore::GraphicsContext3D::texParameteri):
+        (WebCore::GraphicsContext3D::uniform1f):
+        (WebCore::GraphicsContext3D::uniform1fv):
+        (WebCore::GraphicsContext3D::uniform2f):
+        (WebCore::GraphicsContext3D::uniform2fv):
+        (WebCore::GraphicsContext3D::uniform3f):
+        (WebCore::GraphicsContext3D::uniform3fv):
+        (WebCore::GraphicsContext3D::uniform4f):
+        (WebCore::GraphicsContext3D::uniform4fv):
+        (WebCore::GraphicsContext3D::uniform1i):
+        (WebCore::GraphicsContext3D::uniform1iv):
+        (WebCore::GraphicsContext3D::uniform2i):
+        (WebCore::GraphicsContext3D::uniform2iv):
+        (WebCore::GraphicsContext3D::uniform3i):
+        (WebCore::GraphicsContext3D::uniform3iv):
+        (WebCore::GraphicsContext3D::uniform4i):
+        (WebCore::GraphicsContext3D::uniform4iv):
+        (WebCore::GraphicsContext3D::uniformMatrix2fv):
+        (WebCore::GraphicsContext3D::uniformMatrix3fv):
+        (WebCore::GraphicsContext3D::uniformMatrix4fv):
+        (WebCore::GraphicsContext3D::useProgram):
+        (WebCore::GraphicsContext3D::validateProgram):
+        (WebCore::GraphicsContext3D::vertexAttrib1f):
+        (WebCore::GraphicsContext3D::vertexAttrib1fv):
+        (WebCore::GraphicsContext3D::vertexAttrib2f):
+        (WebCore::GraphicsContext3D::vertexAttrib2fv):
+        (WebCore::GraphicsContext3D::vertexAttrib3f):
+        (WebCore::GraphicsContext3D::vertexAttrib3fv):
+        (WebCore::GraphicsContext3D::vertexAttrib4f):
+        (WebCore::GraphicsContext3D::vertexAttrib4fv):
+        (WebCore::GraphicsContext3D::vertexAttribPointer):
+        (WebCore::GraphicsContext3D::viewport):
+        (WebCore::GraphicsContext3D::getBooleanv):
+        (WebCore::GraphicsContext3D::getBufferParameteriv):
+        (WebCore::GraphicsContext3D::getFloatv):
+        (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
+        (WebCore::GraphicsContext3D::getIntegerv):
+        (WebCore::GraphicsContext3D::getProgramiv):
+        (WebCore::GraphicsContext3D::getProgramInfoLog):
+        (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
+        (WebCore::GraphicsContext3D::getShaderiv):
+        (WebCore::GraphicsContext3D::getShaderInfoLog):
+        (WebCore::GraphicsContext3D::getShaderSource):
+        (WebCore::GraphicsContext3D::getTexParameterfv):
+        (WebCore::GraphicsContext3D::getTexParameteriv):
+        (WebCore::GraphicsContext3D::getUniformfv):
+        (WebCore::GraphicsContext3D::getUniformiv):
+        (WebCore::GraphicsContext3D::getUniformLocation):
+        (WebCore::GraphicsContext3D::getVertexAttribfv):
+        (WebCore::GraphicsContext3D::getVertexAttribiv):
+        (WebCore::GraphicsContext3D::getVertexAttribOffset):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::texSubImage2D):
+        (WebCore::GraphicsContext3D::createBuffer):
+        (WebCore::GraphicsContext3D::createFramebuffer):
+        (WebCore::GraphicsContext3D::createProgram):
+        (WebCore::GraphicsContext3D::createRenderbuffer):
+        (WebCore::GraphicsContext3D::createShader):
+        (WebCore::GraphicsContext3D::createTexture):
+        (WebCore::GraphicsContext3D::deleteBuffer):
+        (WebCore::GraphicsContext3D::deleteFramebuffer):
+        (WebCore::GraphicsContext3D::deleteProgram):
+        (WebCore::GraphicsContext3D::deleteRenderbuffer):
+        (WebCore::GraphicsContext3D::deleteShader):
+        (WebCore::GraphicsContext3D::deleteTexture):
+        (WebCore::GraphicsContext3D::sizeInBytes):
+        (WebCore::GraphicsContext3D::synthesizeGLError):
+        (WebCore::GraphicsContext3D::getImageData):
+        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
+        (WebCore::GraphicsContext3D::getImageData):
+
 2011-01-06  Martin Robinson  <mrobinson at igalia.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 4ddff4f..783d205 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -2351,7 +2351,7 @@ void WebGLRenderingContext::readPixels(long x, long y, long width, long height,
         return;
     }
     // Validate input parameters.
-    unsigned long componentsPerPixel, bytesPerComponent;
+    unsigned int componentsPerPixel, bytesPerComponent;
     if (!m_context->computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
         return;
@@ -3900,7 +3900,7 @@ bool WebGLRenderingContext::validateTexFuncData(long width, long height,
         ASSERT_NOT_REACHED();
     }
 
-    unsigned long componentsPerPixel, bytesPerComponent;
+    unsigned int componentsPerPixel, bytesPerComponent;
     if (!m_context->computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
         return false;
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 7fae4a1..1224bce 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -43,7 +43,7 @@ namespace WebCore {
 
 namespace {
 
-    unsigned bytesPerComponent(unsigned type)
+    unsigned int bytesPerComponent(GC3Denum type)
     {
         switch (type) {
         case GraphicsContext3D::UNSIGNED_BYTE:
@@ -59,7 +59,7 @@ namespace {
         }
     }
 
-    unsigned componentsPerPixel(unsigned format, unsigned type)
+    unsigned int componentsPerPixel(GC3Denum format, GC3Denum type)
     {
         switch (type) {
         case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
@@ -87,9 +87,9 @@ namespace {
 
     // This function should only be called if width and height is non-zero and
     // format/type are valid.  Return 0 if overflow happens.
-    size_t imageSizeInBytes(unsigned width, unsigned height, unsigned format, unsigned type)
+    unsigned int imageSizeInBytes(GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type)
     {
-        ASSERT(width && height);
+        ASSERT(width > 0 && height > 0);
         CheckedInt<uint32_t> checkedWidth(width);
         CheckedInt<uint32_t> checkedHeight(height);
         CheckedInt<uint32_t> checkedBytesPerPixel(bytesPerComponent(type) * componentsPerPixel(format, type));
@@ -117,26 +117,29 @@ PassRefPtr<DrawingBuffer> GraphicsContext3D::createDrawingBuffer(const IntSize&
     return DrawingBuffer::create(this, size);
 }
 
-bool GraphicsContext3D::texImage2DResourceSafe(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type)
+bool GraphicsContext3D::texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type)
 {
     OwnArrayPtr<unsigned char> zero;
-    if (width && height) {
-        size_t size = imageSizeInBytes(width, height, format, type);
+    if (width > 0 && height > 0) {
+        unsigned int size = imageSizeInBytes(width, height, format, type);
         if (!size) {
             synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
             return false;
         }
         zero = adoptArrayPtr(new unsigned char[size]);
+        if (!zero.get()) {
+            synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+            return false;
+        }
         memset(zero.get(), 0, size);
     }
-    texImage2D(target, level, internalformat, width, height, border, format, type, zero.get());
-    return true;
+    return texImage2D(target, level, internalformat, width, height, border, format, type, zero.get());
 }
 
-bool GraphicsContext3D::computeFormatAndTypeParameters(unsigned int format,
-                                                       unsigned int type,
-                                                       unsigned long* componentsPerPixel,
-                                                       unsigned long* bytesPerComponent)
+bool GraphicsContext3D::computeFormatAndTypeParameters(GC3Denum format,
+                                                       GC3Denum type,
+                                                       unsigned int* componentsPerPixel,
+                                                       unsigned int* bytesPerComponent)
 {
     switch (format) {
     case GraphicsContext3D::ALPHA:
@@ -177,8 +180,8 @@ bool GraphicsContext3D::computeFormatAndTypeParameters(unsigned int format,
 }
 
 bool GraphicsContext3D::extractImageData(Image* image,
-                                         unsigned int format,
-                                         unsigned int type,
+                                         GC3Denum format,
+                                         GC3Denum type,
                                          bool flipY,
                                          bool premultiplyAlpha,
                                          bool ignoreGammaAndColorProfile,
@@ -189,7 +192,7 @@ bool GraphicsContext3D::extractImageData(Image* image,
     if (!getImageData(image, format, type, premultiplyAlpha, ignoreGammaAndColorProfile, data))
         return false;
     if (flipY) {
-        unsigned long componentsPerPixel, bytesPerComponent;
+        unsigned int componentsPerPixel, bytesPerComponent;
         if (!computeFormatAndTypeParameters(format, type,
                                             &componentsPerPixel,
                                             &bytesPerComponent))
@@ -204,8 +207,8 @@ bool GraphicsContext3D::extractImageData(Image* image,
 }
 
 bool GraphicsContext3D::extractImageData(ImageData* imageData,
-                                         unsigned int format,
-                                         unsigned int type,
+                                         GC3Denum format,
+                                         GC3Denum type,
                                          bool flipY,
                                          bool premultiplyAlpha,
                                          Vector<uint8_t>& data)
@@ -227,7 +230,7 @@ bool GraphicsContext3D::extractImageData(ImageData* imageData,
                     data.data()))
         return false;
     if (flipY) {
-        unsigned long componentsPerPixel, bytesPerComponent;
+        unsigned int componentsPerPixel, bytesPerComponent;
         if (!computeFormatAndTypeParameters(format, type,
                                             &componentsPerPixel,
                                             &bytesPerComponent))
@@ -242,7 +245,7 @@ bool GraphicsContext3D::extractImageData(ImageData* imageData,
 }
 
 bool GraphicsContext3D::extractTextureData(unsigned int width, unsigned int height,
-                                           unsigned int format, unsigned int type,
+                                           GC3Denum format, GC3Denum type,
                                            unsigned int unpackAlignment,
                                            bool flipY, bool premultiplyAlpha,
                                            const void* pixels,
@@ -307,12 +310,12 @@ bool GraphicsContext3D::extractTextureData(unsigned int width, unsigned int heig
     }
 
     // Resize the output buffer.
-    unsigned long componentsPerPixel, bytesPerComponent;
+    unsigned int componentsPerPixel, bytesPerComponent;
     if (!computeFormatAndTypeParameters(format, type,
                                         &componentsPerPixel,
                                         &bytesPerComponent))
         return false;
-    unsigned long bytesPerPixel = componentsPerPixel * bytesPerComponent;
+    unsigned int bytesPerPixel = componentsPerPixel * bytesPerComponent;
     data.resize(width * height * bytesPerPixel);
 
     if (!packPixels(static_cast<const uint8_t*>(pixels),
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index 5e7eb5a..a0d2778 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -42,6 +42,21 @@
 #undef VERSION
 #endif
 
+// GC3D types match the corresponding GL types as defined in OpenGL ES 2.0
+// header file gl2.h from khronos.org.
+typedef unsigned int GC3Denum;
+typedef unsigned char GC3Dboolean;
+typedef unsigned int GC3Dbitfield;
+typedef int GC3Dint;
+typedef int GC3Dsizei;
+typedef unsigned int GC3Duint;
+typedef float GC3Dfloat;
+typedef float GC3Dclampf;
+typedef signed long int GC3Dintptr;
+typedef signed long int GC3Dsizeiptr;
+
+typedef GC3Duint Platform3DObject;
+
 #if PLATFORM(MAC)
 #include "ANGLEWebKitBridge.h"
 #include <OpenGL/OpenGL.h>
@@ -68,12 +83,6 @@ typedef CGLContextObj PlatformGraphicsContext3D;
 typedef void* PlatformGraphicsContext3D;
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(GTK)
-typedef GLuint Platform3DObject;
-#else
-typedef int Platform3DObject;
-#endif
-
 // These are currently the same among all implementations.
 const PlatformGraphicsContext3D NullPlatformGraphicsContext3D = 0;
 const Platform3DObject NullPlatform3DObject = 0;
@@ -92,12 +101,11 @@ class Extensions3DOpenGL;
 class HostWindow;
 class Image;
 class ImageData;
-class WebGLActiveInfo;
 
 struct ActiveInfo {
     String name;
-    unsigned type;
-    int size;
+    GC3Denum type;
+    GC3Dint size;
 };
 
 // FIXME: ideally this would be used on all platforms.
@@ -479,11 +487,11 @@ public:
 
     // Helper to return the size in bytes of OpenGL data types
     // like GL_FLOAT, GL_INT, etc.
-    int sizeInBytes(int type);
+    unsigned int sizeInBytes(GC3Denum type);
 
     // Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
     // Return true if no GL error is synthesized.
-    bool texImage2DResourceSafe(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type);
+    bool texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type);
 
     bool isGLES2Compliant() const;
 
@@ -494,18 +502,18 @@ public:
     // Computes the components per pixel and bytes per component
     // for the given format and type combination. Returns false if
     // either was an invalid enum.
-    bool computeFormatAndTypeParameters(unsigned int format,
-                                        unsigned int type,
-                                        unsigned long* componentsPerPixel,
-                                        unsigned long* bytesPerComponent);
+    bool computeFormatAndTypeParameters(GC3Denum format,
+                                        GC3Denum type,
+                                        unsigned int* componentsPerPixel,
+                                        unsigned int* bytesPerComponent);
 
     // Extracts the contents of the given Image into the passed Vector,
     // packing the pixel data according to the given format and type,
     // and obeying the flipY, premultiplyAlpha, and ignoreGammaAndColorProfile
     // flags. Returns true upon success.
     bool extractImageData(Image* image,
-                          unsigned int format,
-                          unsigned int type,
+                          GC3Denum format,
+                          GC3Denum type,
                           bool flipY,
                           bool premultiplyAlpha,
                           bool ignoreGammaAndColorProfile,
@@ -516,8 +524,8 @@ public:
     // and obeying the flipY and premultiplyAlpha flags. Returns true
     // upon success.
     bool extractImageData(ImageData*,
-                          unsigned int format,
-                          unsigned int type,
+                          GC3Denum format,
+                          GC3Denum type,
                           bool flipY,
                           bool premultiplyAlpha,
                           Vector<uint8_t>& data);
@@ -528,7 +536,7 @@ public:
     // unpackAlignment, the output data will be tightly packed.
     // Returns true if successful, false if any error occurred.
     bool extractTextureData(unsigned int width, unsigned int height,
-                            unsigned int format, unsigned int type,
+                            GC3Denum format, GC3Denum type,
                             unsigned int unpackAlignment,
                             bool flipY, bool premultiplyAlpha,
                             const void* pixels,
@@ -587,174 +595,155 @@ public:
     // Entry points for WebGL.
     //
 
-    void activeTexture(unsigned long texture);
+    void activeTexture(GC3Denum texture);
     void attachShader(Platform3DObject program, Platform3DObject shader);
-    void bindAttribLocation(Platform3DObject, unsigned long index, const String& name);
-    void bindBuffer(unsigned long target, Platform3DObject);
-    void bindFramebuffer(unsigned long target, Platform3DObject);
-    void bindRenderbuffer(unsigned long target, Platform3DObject);
-    void bindTexture(unsigned long target, Platform3DObject texture);
-    void blendColor(double red, double green, double blue, double alpha);
-    void blendEquation(unsigned long mode);
-    void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha);
-    void blendFunc(unsigned long sfactor, unsigned long dfactor);
-    void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha);
-
-    void bufferData(unsigned long target, int size, unsigned long usage);
-    void bufferData(unsigned long target, int size, const void* data, unsigned long usage);
-    void bufferSubData(unsigned long target, long offset, int size, const void* data);
-
-    unsigned long checkFramebufferStatus(unsigned long target);
-    void clear(unsigned long mask);
-    void clearColor(double red, double green, double blue, double alpha);
-    void clearDepth(double depth);
-    void clearStencil(long s);
-    void colorMask(bool red, bool green, bool blue, bool alpha);
+    void bindAttribLocation(Platform3DObject, GC3Duint index, const String& name);
+    void bindBuffer(GC3Denum target, Platform3DObject);
+    void bindFramebuffer(GC3Denum target, Platform3DObject);
+    void bindRenderbuffer(GC3Denum target, Platform3DObject);
+    void bindTexture(GC3Denum target, Platform3DObject);
+    void blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
+    void blendEquation(GC3Denum mode);
+    void blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha);
+    void blendFunc(GC3Denum sfactor, GC3Denum dfactor);
+    void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha);
+
+    void bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage);
+    void bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage);
+    void bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data);
+
+    GC3Denum checkFramebufferStatus(GC3Denum target);
+    void clear(GC3Dbitfield mask);
+    void clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
+    void clearDepth(GC3Dclampf depth);
+    void clearStencil(GC3Dint s);
+    void colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha);
     void compileShader(Platform3DObject);
 
-    // void compressedTexImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long width, unsigned long height, long border, unsigned long imageSize, const void* data);
-    // void compressedTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long width, unsigned long height, unsigned long format, unsigned long imageSize, const void* data);
+    // void compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data);
+    // void compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data);
 
-    void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
-    void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
-    void cullFace(unsigned long mode);
-    void depthFunc(unsigned long func);
-    void depthMask(bool flag);
-    void depthRange(double zNear, double zFar);
+    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border);
+    void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
+    void cullFace(GC3Denum mode);
+    void depthFunc(GC3Denum func);
+    void depthMask(GC3Dboolean flag);
+    void depthRange(GC3Dclampf zNear, GC3Dclampf zFar);
     void detachShader(Platform3DObject, Platform3DObject);
-    void disable(unsigned long cap);
-    void disableVertexAttribArray(unsigned long index);
-    void drawArrays(unsigned long mode, long first, long count);
-    void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset);
+    void disable(GC3Denum cap);
+    void disableVertexAttribArray(GC3Duint index);
+    void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count);
+    void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset);
 
-    void enable(unsigned long cap);
-    void enableVertexAttribArray(unsigned long index);
+    void enable(GC3Denum cap);
+    void enableVertexAttribArray(GC3Duint index);
     void finish();
     void flush();
-    void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject);
-    void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level);
-    void frontFace(unsigned long mode);
-    void generateMipmap(unsigned long target);
-
-    bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&);
-    bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&);
-
-    void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders);
-
-    int getAttribLocation(Platform3DObject, const String& name);
-
-    void getBooleanv(unsigned long pname, unsigned char* value);
-
-    void getBufferParameteriv(unsigned long target, unsigned long pname, int* value);
-
+    void framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject);
+    void framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject, GC3Dint level);
+    void frontFace(GC3Denum mode);
+    void generateMipmap(GC3Denum target);
+
+    bool getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo&);
+    bool getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo&);
+    void getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders);
+    GC3Dint getAttribLocation(Platform3DObject, const String& name);
+    void getBooleanv(GC3Denum pname, GC3Dboolean* value);
+    void getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
     Attributes getContextAttributes();
-
-    unsigned long getError();
-
-    void getFloatv(unsigned long pname, float* value);
-
-    void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value);
-
-    void getIntegerv(unsigned long pname, int* value);
-
-    void getProgramiv(Platform3DObject program, unsigned long pname, int* value);
-
+    GC3Denum getError();
+    void getFloatv(GC3Denum pname, GC3Dfloat* value);
+    void getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value);
+    void getIntegerv(GC3Denum pname, GC3Dint* value);
+    void getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value);
     String getProgramInfoLog(Platform3DObject);
-
-    void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
-
-    void getShaderiv(Platform3DObject, unsigned long pname, int* value);
-
+    void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
     String getShaderInfoLog(Platform3DObject);
 
     // TBD
-    // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+    // void glGetShaderPrecisionFormat (GC3Denum shadertype, GC3Denum precisiontype, GC3Dint* range, GC3Dint* precision);
 
     String getShaderSource(Platform3DObject);
-    String getString(unsigned long name);
-
-    void getTexParameterfv(unsigned long target, unsigned long pname, float* value);
-    void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
-
-    void getUniformfv(Platform3DObject program, long location, float* value);
-    void getUniformiv(Platform3DObject program, long location, int* value);
-
-    long getUniformLocation(Platform3DObject, const String& name);
-
-    void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
-    void getVertexAttribiv(unsigned long index, unsigned long pname, int* value);
-
-    long getVertexAttribOffset(unsigned long index, unsigned long pname);
-
-    void hint(unsigned long target, unsigned long mode);
-    bool isBuffer(Platform3DObject);
-    bool isEnabled(unsigned long cap);
-    bool isFramebuffer(Platform3DObject);
-    bool isProgram(Platform3DObject);
-    bool isRenderbuffer(Platform3DObject);
-    bool isShader(Platform3DObject);
-    bool isTexture(Platform3DObject);
-    void lineWidth(double);
+    String getString(GC3Denum name);
+    void getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value);
+    void getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    void getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value);
+    void getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value);
+    GC3Dint getUniformLocation(Platform3DObject, const String& name);
+    void getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value);
+    void getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value);
+    GC3Dsizeiptr getVertexAttribOffset(GC3Duint index, GC3Denum pname);
+
+    void hint(GC3Denum target, GC3Denum mode);
+    GC3Dboolean isBuffer(Platform3DObject);
+    GC3Dboolean isEnabled(GC3Denum cap);
+    GC3Dboolean isFramebuffer(Platform3DObject);
+    GC3Dboolean isProgram(Platform3DObject);
+    GC3Dboolean isRenderbuffer(Platform3DObject);
+    GC3Dboolean isShader(Platform3DObject);
+    GC3Dboolean isTexture(Platform3DObject);
+    void lineWidth(GC3Dfloat);
     void linkProgram(Platform3DObject);
-    void pixelStorei(unsigned long pname, long param);
-    void polygonOffset(double factor, double units);
+    void pixelStorei(GC3Denum pname, GC3Dint param);
+    void polygonOffset(GC3Dfloat factor, GC3Dfloat units);
 
-    void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
+    void readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
 
     void releaseShaderCompiler();
-    void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
-    void sampleCoverage(double value, bool invert);
-    void scissor(long x, long y, unsigned long width, unsigned long height);
+
+    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
+    void sampleCoverage(GC3Dclampf value, GC3Dboolean invert);
+    void scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
     void shaderSource(Platform3DObject, const String& string);
-    void stencilFunc(unsigned long func, long ref, unsigned long mask);
-    void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
-    void stencilMask(unsigned long mask);
-    void stencilMaskSeparate(unsigned long face, unsigned long mask);
-    void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass);
-    void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
-
-    int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels);
-
-    void texParameterf(unsigned target, unsigned pname, float param);
-    void texParameteri(unsigned target, unsigned pname, int param);
-
-    int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels);
-
-    void uniform1f(long location, float x);
-    void uniform1fv(long location, float* v, int size);
-    void uniform1i(long location, int x);
-    void uniform1iv(long location, int* v, int size);
-    void uniform2f(long location, float x, float y);
-    void uniform2fv(long location, float* v, int size);
-    void uniform2i(long location, int x, int y);
-    void uniform2iv(long location, int* v, int size);
-    void uniform3f(long location, float x, float y, float z);
-    void uniform3fv(long location, float* v, int size);
-    void uniform3i(long location, int x, int y, int z);
-    void uniform3iv(long location, int* v, int size);
-    void uniform4f(long location, float x, float y, float z, float w);
-    void uniform4fv(long location, float* v, int size);
-    void uniform4i(long location, int x, int y, int z, int w);
-    void uniform4iv(long location, int* v, int size);
-    void uniformMatrix2fv(long location, bool transpose, float* value, int size);
-    void uniformMatrix3fv(long location, bool transpose, float* value, int size);
-    void uniformMatrix4fv(long location, bool transpose, float* value, int size);
+    void stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask);
+    void stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask);
+    void stencilMask(GC3Duint mask);
+    void stencilMaskSeparate(GC3Denum face, GC3Duint mask);
+    void stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
+    void stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
+
+    bool texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
+    void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
+    void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels);
+
+    // FIXME: change the argument orders to match OpenGL's.
+    void uniform1f(GC3Dint location, GC3Dfloat x);
+    void uniform1fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform1i(GC3Dint location, GC3Dint x);
+    void uniform1iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniform2f(GC3Dint location, GC3Dfloat x, float y);
+    void uniform2fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform2i(GC3Dint location, GC3Dint x, GC3Dint y);
+    void uniform2iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
+    void uniform3fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z);
+    void uniform3iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
+    void uniform4fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w);
+    void uniform4iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
+    void uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
+    void uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
 
     void useProgram(Platform3DObject);
     void validateProgram(Platform3DObject);
 
-    void vertexAttrib1f(unsigned long indx, float x);
-    void vertexAttrib1fv(unsigned long indx, float* values);
-    void vertexAttrib2f(unsigned long indx, float x, float y);
-    void vertexAttrib2fv(unsigned long indx, float* values);
-    void vertexAttrib3f(unsigned long indx, float x, float y, float z);
-    void vertexAttrib3fv(unsigned long indx, float* values);
-    void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w);
-    void vertexAttrib4fv(unsigned long indx, float* values);
-    void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
-                             unsigned long stride, unsigned long offset);
+    void vertexAttrib1f(GC3Duint index, GC3Dfloat x);
+    void vertexAttrib1fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y);
+    void vertexAttrib2fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
+    void vertexAttrib3fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
+    void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized,
+                             GC3Dsizei stride, GC3Dintptr offset);
 
-    void viewport(long x, long y, unsigned long width, unsigned long height);
+    void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
 
     void reshape(int width, int height);
 
@@ -775,19 +764,19 @@ public:
 #endif
 
     // Support for buffer creation and deletion
-    unsigned createBuffer();
-    unsigned createFramebuffer();
-    unsigned createProgram();
-    unsigned createRenderbuffer();
-    unsigned createShader(unsigned long);
-    unsigned createTexture();
-
-    void deleteBuffer(unsigned);
-    void deleteFramebuffer(unsigned);
-    void deleteProgram(unsigned);
-    void deleteRenderbuffer(unsigned);
-    void deleteShader(unsigned);
-    void deleteTexture(unsigned);
+    Platform3DObject createBuffer();
+    Platform3DObject createFramebuffer();
+    Platform3DObject createProgram();
+    Platform3DObject createRenderbuffer();
+    Platform3DObject createShader(GC3Denum);
+    Platform3DObject createTexture();
+
+    void deleteBuffer(Platform3DObject);
+    void deleteFramebuffer(Platform3DObject);
+    void deleteProgram(Platform3DObject);
+    void deleteRenderbuffer(Platform3DObject);
+    void deleteShader(Platform3DObject);
+    void deleteTexture(Platform3DObject);
 
     // Synthesizes an OpenGL error which will be returned from a
     // later call to getError. This is used to emulate OpenGL ES
@@ -797,7 +786,7 @@ public:
     // Per the behavior of glGetError, this stores at most one
     // instance of any given error, and returns them from calls to
     // getError in the order they were added.
-    void synthesizeGLError(unsigned long error);
+    void synthesizeGLError(GC3Denum error);
 
     // Support for extensions. Returns a non-null object, though not
     // all methods it contains may necessarily be supported on the
@@ -830,8 +819,8 @@ public:
     // No vertical flip of the image data is performed by this
     // method.
     bool getImageData(Image* image,
-                      unsigned int format,
-                      unsigned int type,
+                      GC3Denum format,
+                      GC3Denum type,
                       bool premultiplyAlpha,
                       bool ignoreGammaAndColorProfile,
                       Vector<uint8_t>& outputVector);
@@ -887,20 +876,20 @@ public:
 
     CGLContextObj m_contextObj;
     RetainPtr<WebGLLayer> m_webGLLayer;
-    GLuint m_texture;
-    GLuint m_fbo;
-    GLuint m_depthStencilBuffer;
+    GC3Duint m_texture;
+    GC3Duint m_fbo;
+    GC3Duint m_depthStencilBuffer;
 
     // For tracking which FBO is bound
-    GLuint m_boundFBO;
+    GC3Duint m_boundFBO;
 
     // For multisampling
-    GLuint m_multisampleFBO;
-    GLuint m_multisampleDepthStencilBuffer;
-    GLuint m_multisampleColorBuffer;
+    GC3Duint m_multisampleFBO;
+    GC3Duint m_multisampleDepthStencilBuffer;
+    GC3Duint m_multisampleColorBuffer;
 
     // Errors raised by synthesizeGLError().
-    ListHashSet<unsigned long> m_syntheticErrors;
+    ListHashSet<GC3Denum> m_syntheticErrors;
 #endif
 
     // FIXME: ideally this would be used on all platforms.
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index f7712b4..c19bd72 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -89,8 +89,8 @@ static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int comp
 }
 
 bool GraphicsContext3D::getImageData(Image* image,
-                                     unsigned int format,
-                                     unsigned int type,
+                                     GC3Denum format,
+                                     GC3Denum type,
                                      bool premultiplyAlpha,
                                      bool ignoreGammaAndColorProfile,
                                      Vector<uint8_t>& outputVector)
diff --git a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
index a166d9c..9d1298f 100644
--- a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
@@ -38,8 +38,6 @@
 #include "Color.h"
 #include "Extensions3D.h"
 #include "FloatRect.h"
-#include "GraphicsContext3D.h"
-#include "GraphicsTypes.h"
 #include "IntSize.h"
 #include "SolidFillShader.h"
 #include "TexShader.h"
@@ -98,12 +96,12 @@ void SharedGraphicsContext3D::scissor(const FloatRect& rect)
     m_context->scissor(rect.x(), rect.y(), rect.width(), rect.height());
 }
 
-void SharedGraphicsContext3D::enable(unsigned capacity)
+void SharedGraphicsContext3D::enable(GC3Denum capacity)
 {
     m_context->enable(capacity);
 }
 
-void SharedGraphicsContext3D::disable(unsigned capacity)
+void SharedGraphicsContext3D::disable(GC3Denum capacity)
 {
     m_context->disable(capacity);
 }
@@ -115,22 +113,22 @@ void SharedGraphicsContext3D::clearColor(const Color& color)
     m_context->clearColor(rgba[0], rgba[1], rgba[2], rgba[3]);
 }
 
-void SharedGraphicsContext3D::clear(unsigned mask)
+void SharedGraphicsContext3D::clear(GC3Dbitfield mask)
 {
     m_context->clear(mask);
 }
 
-void SharedGraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
+void SharedGraphicsContext3D::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count)
 {
     m_context->drawArrays(mode, first, count);
 }
 
-unsigned long SharedGraphicsContext3D::getError()
+GC3Denum SharedGraphicsContext3D::getError()
 {
     return m_context->getError();
 }
 
-void SharedGraphicsContext3D::getIntegerv(unsigned long pname, int* value)
+void SharedGraphicsContext3D::getIntegerv(GC3Denum pname, GC3Dint* value)
 {
     m_context->getIntegerv(pname, value);
 }
@@ -140,51 +138,49 @@ void SharedGraphicsContext3D::flush()
     m_context->flush();
 }
 
-unsigned SharedGraphicsContext3D::createFramebuffer()
+Platform3DObject SharedGraphicsContext3D::createFramebuffer()
 {
     return m_context->createFramebuffer();
 }
 
-unsigned SharedGraphicsContext3D::createTexture()
+Platform3DObject SharedGraphicsContext3D::createTexture()
 {
     return m_context->createTexture();
 }
 
-void SharedGraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
+void SharedGraphicsContext3D::deleteFramebuffer(Platform3DObject framebuffer)
 {
     m_context->deleteFramebuffer(framebuffer);
 }
 
-void SharedGraphicsContext3D::deleteTexture(unsigned texture)
+void SharedGraphicsContext3D::deleteTexture(Platform3DObject texture)
 {
     m_context->deleteTexture(texture);
 }
 
-void SharedGraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, unsigned texture, long level)
+void SharedGraphicsContext3D::framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject texture, GC3Dint level)
 {
     m_context->framebufferTexture2D(target, attachment, textarget, texture, level);
 }
 
-void SharedGraphicsContext3D::texParameteri(unsigned target, unsigned pname, int param)
+void SharedGraphicsContext3D::texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param)
 {
     m_context->texParameteri(target, pname, param);
 }
 
-int SharedGraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+bool SharedGraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
 {
-    if (!pixels) {
-        m_context->texImage2DResourceSafe(target, level, internalformat, width, height, border, format, type);
-        return 0;
-    }
+    if (!pixels)
+        return m_context->texImage2DResourceSafe(target, level, internalformat, width, height, border, format, type);
     return m_context->texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
 }
 
-int SharedGraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+void SharedGraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels)
 {
-    return m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
 }
 
-void SharedGraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
+void SharedGraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data)
 {
     m_context->readPixels(x, y, width, height, format, type, data);
 }
@@ -312,12 +308,12 @@ void SharedGraphicsContext3D::useQuadVertices()
     }
 }
 
-void SharedGraphicsContext3D::setActiveTexture(unsigned textureUnit)
+void SharedGraphicsContext3D::setActiveTexture(GC3Denum textureUnit)
 {
     m_context->activeTexture(textureUnit);
 }
 
-void SharedGraphicsContext3D::bindTexture(unsigned target, unsigned texture)
+void SharedGraphicsContext3D::bindTexture(GC3Denum target, Platform3DObject texture)
 {
     m_context->bindTexture(target, texture);
 }
@@ -332,7 +328,7 @@ void SharedGraphicsContext3D::useTextureProgram(const AffineTransform& transform
     m_texShader->use(transform, texTransform, 0, alpha);
 }
 
-void SharedGraphicsContext3D::bindFramebuffer(unsigned framebuffer)
+void SharedGraphicsContext3D::bindFramebuffer(Platform3DObject framebuffer)
 {
     m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, framebuffer);
 }
diff --git a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h
index a1ae8f2..ea1810d 100644
--- a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h
+++ b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.h
@@ -31,6 +31,7 @@
 #ifndef SharedGraphicsContext3D_h
 #define SharedGraphicsContext3D_h
 
+#include "GraphicsContext3D.h"
 #include "GraphicsTypes.h"
 #include "ImageSource.h"
 #include "Texture.h"
@@ -45,7 +46,6 @@ namespace WebCore {
 
 class AffineTransform;
 class Color;
-class GraphicsContext3D;
 class FloatRect;
 class HostWindow;
 class IntSize;
@@ -61,30 +61,30 @@ public:
 
     // Functions that delegate directly to GraphicsContext3D, with caching
     void makeContextCurrent();
-    void bindFramebuffer(unsigned framebuffer);
+    void bindFramebuffer(Platform3DObject framebuffer);
     void setViewport(const IntSize&);
     void scissor(const FloatRect&);
-    void enable(unsigned capacity);
-    void disable(unsigned capacity);
+    void enable(GC3Denum capacity);
+    void disable(GC3Denum capacity);
     void clearColor(const Color&);
-    void clear(unsigned mask);
-    void drawArrays(unsigned long mode, long first, long count);
-    unsigned long getError();
-    void getIntegerv(unsigned long pname, int* value);
+    void clear(GC3Dbitfield mask);
+    void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count);
+    GC3Denum getError();
+    void getIntegerv(GC3Denum pname, GC3Dint* value);
     void flush();
 
-    unsigned createFramebuffer();
-    unsigned createTexture();
+    Platform3DObject createFramebuffer();
+    Platform3DObject createTexture();
 
-    void deleteFramebuffer(unsigned framebuffer);
-    void deleteTexture(unsigned texture);
+    void deleteFramebuffer(Platform3DObject framebuffer);
+    void deleteTexture(Platform3DObject texture);
 
-    void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, unsigned, long level);
-    void texParameteri(unsigned target, unsigned pname, int param);
-    int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels);
-    int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels);
+    void framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject, GC3Dint level);
+    void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
+    bool texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels);
 
-    void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
+    void readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
 
     bool paintsIntoCanvasBuffer() const;
 
@@ -95,8 +95,8 @@ public:
     void useFillSolidProgram(const AffineTransform&, const Color&);
     void useTextureProgram(const AffineTransform&, const AffineTransform&, float alpha);
 
-    void setActiveTexture(unsigned textureUnit);
-    void bindTexture(unsigned target, unsigned texture);
+    void setActiveTexture(GC3Denum textureUnit);
+    void bindTexture(GC3Denum target, Platform3DObject texture);
 
     bool supportsBGRA();
 
diff --git a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
index 0e72aea..221ee11 100644
--- a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
+++ b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
@@ -288,7 +288,7 @@ void GraphicsContext3D::prepareTexture()
     ::glFinish();
 }
 
-void GraphicsContext3D::activeTexture(unsigned long texture)
+void GraphicsContext3D::activeTexture(GC3Denum texture)
 {
     makeContextCurrent();
     ::glActiveTexture(texture);
@@ -299,29 +299,29 @@ void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject
     ASSERT(program);
     ASSERT(shader);
     makeContextCurrent();
-    ::glAttachShader((GLuint) program, (GLuint) shader);
+    ::glAttachShader(program, shader);
 }
 
-void GraphicsContext3D::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
+void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
 {
     ASSERT(program);
     makeContextCurrent();
-    ::glBindAttribLocation((GLuint) program, index, name.utf8().data());
+    ::glBindAttribLocation(program, index, name.utf8().data());
 }
 
-void GraphicsContext3D::bindBuffer(unsigned long target, Platform3DObject buffer)
+void GraphicsContext3D::bindBuffer(GC3Denum target, Platform3DObject buffer)
 {
     makeContextCurrent();
-    ::glBindBuffer(target, (GLuint) buffer);
+    ::glBindBuffer(target, buffer);
 }
 
 
-void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject buffer)
+void GraphicsContext3D::bindFramebuffer(GC3Denum target, Platform3DObject buffer)
 {
     makeContextCurrent();
     GLuint fbo;
     if (buffer)
-        fbo = (GLuint)buffer;
+        fbo = buffer;
     else
         fbo = (m_attrs.antialias ? m_multisampleFBO : m_fbo);
     if (fbo != m_boundFBO) {
@@ -330,99 +330,99 @@ void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject b
     }
 }
 
-void GraphicsContext3D::bindRenderbuffer(unsigned long target, Platform3DObject renderbuffer)
+void GraphicsContext3D::bindRenderbuffer(GC3Denum target, Platform3DObject renderbuffer)
 {
     makeContextCurrent();
-    ::glBindRenderbufferEXT(target, (GLuint) renderbuffer);
+    ::glBindRenderbufferEXT(target, renderbuffer);
 }
 
 
-void GraphicsContext3D::bindTexture(unsigned long target, Platform3DObject texture)
+void GraphicsContext3D::bindTexture(GC3Denum target, Platform3DObject texture)
 {
     makeContextCurrent();
-    ::glBindTexture(target, (GLuint) texture);
+    ::glBindTexture(target, texture);
 }
 
-void GraphicsContext3D::blendColor(double red, double green, double blue, double alpha)
+void GraphicsContext3D::blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha)
 {
     makeContextCurrent();
-    ::glBlendColor(static_cast<float>(red), static_cast<float>(green), static_cast<float>(blue), static_cast<float>(alpha));
+    ::glBlendColor(red, green, blue, alpha);
 }
 
-void GraphicsContext3D::blendEquation( unsigned long mode )
+void GraphicsContext3D::blendEquation(GC3Denum mode)
 {
     makeContextCurrent();
     ::glBlendEquation(mode);
 }
 
-void GraphicsContext3D::blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha)
+void GraphicsContext3D::blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha)
 {
     makeContextCurrent();
     ::glBlendEquationSeparate(modeRGB, modeAlpha);
 }
 
 
-void GraphicsContext3D::blendFunc(unsigned long sfactor, unsigned long dfactor)
+void GraphicsContext3D::blendFunc(GC3Denum sfactor, GC3Denum dfactor)
 {
     makeContextCurrent();
     ::glBlendFunc(sfactor, dfactor);
 }       
 
-void GraphicsContext3D::blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha)
+void GraphicsContext3D::blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha)
 {
     makeContextCurrent();
     ::glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
 }
 
-void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long usage)
+void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
 {
     makeContextCurrent();
     ::glBufferData(target, size, 0, usage);
 }
 
-void GraphicsContext3D::bufferData(unsigned long target, int size, const void* data, unsigned long usage)
+void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage)
 {
     makeContextCurrent();
     ::glBufferData(target, size, data, usage);
 }
 
-void GraphicsContext3D::bufferSubData(unsigned long target, long offset, int size, const void* data)
+void GraphicsContext3D::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data)
 {
     makeContextCurrent();
     ::glBufferSubData(target, offset, size, data);
 }
 
-unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
+GC3Denum GraphicsContext3D::checkFramebufferStatus(GC3Denum target)
 {
     makeContextCurrent();
     return ::glCheckFramebufferStatusEXT(target);
 }
 
-void GraphicsContext3D::clearColor(double r, double g, double b, double a)
+void GraphicsContext3D::clearColor(GC3Dclampf r, GC3Dclampf g, GC3Dclampf b, GC3Dclampf a)
 {
     makeContextCurrent();
-    ::glClearColor(static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a));
+    ::glClearColor(r, g, b, a);
 }
 
-void GraphicsContext3D::clear(unsigned long mask)
+void GraphicsContext3D::clear(GC3Dbitfield mask)
 {
     makeContextCurrent();
     ::glClear(mask);
 }
 
-void GraphicsContext3D::clearDepth(double depth)
+void GraphicsContext3D::clearDepth(GC3Dclampf depth)
 {
     makeContextCurrent();
     ::glClearDepth(depth);
 }
 
-void GraphicsContext3D::clearStencil(long s)
+void GraphicsContext3D::clearStencil(GC3Dint s)
 {
     makeContextCurrent();
     ::glClearStencil(s);
 }
 
-void GraphicsContext3D::colorMask(bool red, bool green, bool blue, bool alpha)
+void GraphicsContext3D::colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha)
 {
     makeContextCurrent();
     ::glColorMask(red, green, blue, alpha);
@@ -468,19 +468,19 @@ void GraphicsContext3D::compileShader(Platform3DObject shader)
     const CString& translatedShaderCString = translatedShaderSource.utf8();
     const char* translatedShaderPtr = translatedShaderCString.data();
     
-    ::glShaderSource((GLuint) shader, 1, &translatedShaderPtr, &translatedShaderLength);
+    ::glShaderSource(shader, 1, &translatedShaderPtr, &translatedShaderLength);
     
-    ::glCompileShader((GLuint) shader);
+    ::glCompileShader(shader);
     
     int GLCompileSuccess;
     
-    ::glGetShaderiv((GLuint) shader, COMPILE_STATUS, &GLCompileSuccess);
+    ::glGetShaderiv(shader, COMPILE_STATUS, &GLCompileSuccess);
     
     // ASSERT that ANGLE generated GLSL will be accepted by OpenGL
     ASSERT(GLCompileSuccess == GL_TRUE);
 }
 
-void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
+void GraphicsContext3D::copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border)
 {
     makeContextCurrent();
     if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
@@ -494,7 +494,7 @@ void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigne
         ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
 }
 
-void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
+void GraphicsContext3D::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
 {
     makeContextCurrent();
     if (m_attrs.antialias && m_boundFBO == m_multisampleFBO) {
@@ -508,25 +508,25 @@ void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long
         ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO);
 }
 
-void GraphicsContext3D::cullFace(unsigned long mode)
+void GraphicsContext3D::cullFace(GC3Denum mode)
 {
     makeContextCurrent();
     ::glCullFace(mode);
 }
 
-void GraphicsContext3D::depthFunc(unsigned long func)
+void GraphicsContext3D::depthFunc(GC3Denum func)
 {
     makeContextCurrent();
     ::glDepthFunc(func);
 }
 
-void GraphicsContext3D::depthMask(bool flag)
+void GraphicsContext3D::depthMask(GC3Dboolean flag)
 {
     makeContextCurrent();
     ::glDepthMask(flag);
 }
 
-void GraphicsContext3D::depthRange(double zNear, double zFar)
+void GraphicsContext3D::depthRange(GC3Dclampf zNear, GC3Dclampf zFar)
 {
     makeContextCurrent();
     ::glDepthRange(zNear, zFar);
@@ -537,40 +537,40 @@ void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject
     ASSERT(program);
     ASSERT(shader);
     makeContextCurrent();
-    ::glDetachShader((GLuint) program, (GLuint) shader);
+    ::glDetachShader(program, shader);
 }
 
-void GraphicsContext3D::disable(unsigned long cap)
+void GraphicsContext3D::disable(GC3Denum cap)
 {
     makeContextCurrent();
     ::glDisable(cap);
 }
 
-void GraphicsContext3D::disableVertexAttribArray(unsigned long index)
+void GraphicsContext3D::disableVertexAttribArray(GC3Duint index)
 {
     makeContextCurrent();
     ::glDisableVertexAttribArray(index);
 }
 
-void GraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
+void GraphicsContext3D::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count)
 {
     makeContextCurrent();
     ::glDrawArrays(mode, first, count);
 }
 
-void GraphicsContext3D::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
+void GraphicsContext3D::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset)
 {
     makeContextCurrent();
-    ::glDrawElements(mode, count, type, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+    ::glDrawElements(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)));
 }
 
-void GraphicsContext3D::enable(unsigned long cap)
+void GraphicsContext3D::enable(GC3Denum cap)
 {
     makeContextCurrent();
     ::glEnable(cap);
 }
 
-void GraphicsContext3D::enableVertexAttribArray(unsigned long index)
+void GraphicsContext3D::enableVertexAttribArray(GC3Duint index)
 {
     makeContextCurrent();
     ::glEnableVertexAttribArray(index);
@@ -588,31 +588,31 @@ void GraphicsContext3D::flush()
     ::glFlush();
 }
 
-void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
+void GraphicsContext3D::framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject buffer)
 {
     makeContextCurrent();
-    ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, (GLuint) buffer);
+    ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, buffer);
 }
 
-void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
+void GraphicsContext3D::framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject texture, GC3Dint level)
 {
     makeContextCurrent();
-    ::glFramebufferTexture2DEXT(target, attachment, textarget, (GLuint) texture, level);
+    ::glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
 }
 
-void GraphicsContext3D::frontFace(unsigned long mode)
+void GraphicsContext3D::frontFace(GC3Denum mode)
 {
     makeContextCurrent();
     ::glFrontFace(mode);
 }
 
-void GraphicsContext3D::generateMipmap(unsigned long target)
+void GraphicsContext3D::generateMipmap(GC3Denum target)
 {
     makeContextCurrent();
     ::glGenerateMipmapEXT(target);
 }
 
-bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
+bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
 {
     if (!program) {
         synthesizeGLError(INVALID_VALUE);
@@ -620,12 +620,12 @@ bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long
     }
     makeContextCurrent();
     GLint maxAttributeSize = 0;
-    ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
+    ::glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
     GLchar name[maxAttributeSize]; // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination
     GLsizei nameLength = 0;
     GLint size = 0;
     GLenum type = 0;
-    ::glGetActiveAttrib(static_cast<GLuint>(program), index, maxAttributeSize, &nameLength, &size, &type, name);
+    ::glGetActiveAttrib(program, index, maxAttributeSize, &nameLength, &size, &type, name);
     if (!nameLength)
         return false;
     info.name = String(name, nameLength);
@@ -634,7 +634,7 @@ bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long
     return true;
 }
     
-bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
+bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
 {
     if (!program) {
         synthesizeGLError(INVALID_VALUE);
@@ -642,12 +642,12 @@ bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long
     }
     makeContextCurrent();
     GLint maxUniformSize = 0;
-    ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
+    ::glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
     GLchar name[maxUniformSize]; // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination
     GLsizei nameLength = 0;
     GLint size = 0;
     GLenum type = 0;
-    ::glGetActiveUniform(static_cast<GLuint>(program), index, maxUniformSize, &nameLength, &size, &type, name);
+    ::glGetActiveUniform(program, index, maxUniformSize, &nameLength, &size, &type, name);
     if (!nameLength)
         return false;
     info.name = String(name, nameLength);
@@ -656,14 +656,14 @@ bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long
     return true;
 }
 
-void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders)
+void GraphicsContext3D::getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders)
 {
     if (!program) {
         synthesizeGLError(INVALID_VALUE);
         return;
     }
     makeContextCurrent();
-    ::glGetAttachedShaders(static_cast<GLuint>(program), maxCount, count, shaders);
+    ::glGetAttachedShaders(program, maxCount, count, shaders);
 }
 
 int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
@@ -672,7 +672,7 @@ int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String&
         return -1;
 
     makeContextCurrent();
-    return ::glGetAttribLocation((GLuint) program, name.utf8().data());
+    return ::glGetAttribLocation(program, name.utf8().data());
 }
 
 GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
@@ -680,11 +680,11 @@ GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
     return m_attrs;
 }
 
-unsigned long GraphicsContext3D::getError()
+GC3Denum GraphicsContext3D::getError()
 {
     if (m_syntheticErrors.size() > 0) {
-        ListHashSet<unsigned long>::iterator iter = m_syntheticErrors.begin();
-        unsigned long err = *iter;
+        ListHashSet<GC3Denum>::iterator iter = m_syntheticErrors.begin();
+        GC3Denum err = *iter;
         m_syntheticErrors.remove(iter);
         return err;
     }
@@ -693,104 +693,104 @@ unsigned long GraphicsContext3D::getError()
     return ::glGetError();
 }
 
-String GraphicsContext3D::getString(unsigned long name)
+String GraphicsContext3D::getString(GC3Denum name)
 {
     makeContextCurrent();
     return String((const char*) ::glGetString(name));
 }
 
-void GraphicsContext3D::hint(unsigned long target, unsigned long mode)
+void GraphicsContext3D::hint(GC3Denum target, GC3Denum mode)
 {
     makeContextCurrent();
     ::glHint(target, mode);
 }
 
-bool GraphicsContext3D::isBuffer(Platform3DObject buffer)
+GC3Dboolean GraphicsContext3D::isBuffer(Platform3DObject buffer)
 {
     if (!buffer)
-        return false;
+        return GL_FALSE;
 
     makeContextCurrent();
-    return ::glIsBuffer((GLuint) buffer);
+    return ::glIsBuffer(buffer);
 }
 
-bool GraphicsContext3D::isEnabled(unsigned long cap)
+GC3Dboolean GraphicsContext3D::isEnabled(GC3Denum cap)
 {
     makeContextCurrent();
     return ::glIsEnabled(cap);
 }
 
-bool GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
+GC3Dboolean GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
 {
     if (!framebuffer)
-        return false;
+        return GL_FALSE;
 
     makeContextCurrent();
-    return ::glIsFramebufferEXT((GLuint) framebuffer);
+    return ::glIsFramebufferEXT(framebuffer);
 }
 
-bool GraphicsContext3D::isProgram(Platform3DObject program)
+GC3Dboolean GraphicsContext3D::isProgram(Platform3DObject program)
 {
     if (!program)
-        return false;
+        return GL_FALSE;
 
     makeContextCurrent();
-    return ::glIsProgram((GLuint) program);
+    return ::glIsProgram(program);
 }
 
-bool GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
+GC3Dboolean GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
 {
     if (!renderbuffer)
-        return false;
+        return GL_FALSE;
 
     makeContextCurrent();
-    return ::glIsRenderbufferEXT((GLuint) renderbuffer);
+    return ::glIsRenderbufferEXT(renderbuffer);
 }
 
-bool GraphicsContext3D::isShader(Platform3DObject shader)
+GC3Dboolean GraphicsContext3D::isShader(Platform3DObject shader)
 {
     if (!shader)
-        return false;
+        return GL_FALSE;
 
     makeContextCurrent();
-    return ::glIsShader((GLuint) shader);
+    return ::glIsShader(shader);
 }
 
-bool GraphicsContext3D::isTexture(Platform3DObject texture)
+GC3Dboolean GraphicsContext3D::isTexture(Platform3DObject texture)
 {
     if (!texture)
-        return false;
+        return GL_FALSE;
 
     makeContextCurrent();
-    return ::glIsTexture((GLuint) texture);
+    return ::glIsTexture(texture);
 }
 
-void GraphicsContext3D::lineWidth(double width)
+void GraphicsContext3D::lineWidth(GC3Dfloat width)
 {
     makeContextCurrent();
-    ::glLineWidth(static_cast<float>(width));
+    ::glLineWidth(width);
 }
 
 void GraphicsContext3D::linkProgram(Platform3DObject program)
 {
     ASSERT(program);
     makeContextCurrent();
-    ::glLinkProgram((GLuint) program);
+    ::glLinkProgram(program);
 }
 
-void GraphicsContext3D::pixelStorei(unsigned long pname, long param)
+void GraphicsContext3D::pixelStorei(GC3Denum pname, GC3Dint param)
 {
     makeContextCurrent();
     ::glPixelStorei(pname, param);
 }
 
-void GraphicsContext3D::polygonOffset(double factor, double units)
+void GraphicsContext3D::polygonOffset(GC3Dfloat factor, GC3Dfloat units)
 {
     makeContextCurrent();
-    ::glPolygonOffset(static_cast<float>(factor), static_cast<float>(units));
+    ::glPolygonOffset(factor, units);
 }
 
-void GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
+void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data)
 {
     // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
     // all previous rendering calls should be done before reading pixels.
@@ -815,7 +815,7 @@ void GraphicsContext3D::releaseShaderCompiler()
     //::glReleaseShaderCompiler();
 }
 
-void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
+void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
 {
     makeContextCurrent();
     switch (internalformat) {
@@ -836,13 +836,13 @@ void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long
     ::glRenderbufferStorageEXT(target, internalformat, width, height);
 }
 
-void GraphicsContext3D::sampleCoverage(double value, bool invert)
+void GraphicsContext3D::sampleCoverage(GC3Dclampf value, GC3Dboolean invert)
 {
     makeContextCurrent();
-    ::glSampleCoverage(static_cast<float>(value), invert);
+    ::glSampleCoverage(value, invert);
 }
 
-void GraphicsContext3D::scissor(long x, long y, unsigned long width, unsigned long height)
+void GraphicsContext3D::scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
 {
     makeContextCurrent();
     ::glScissor(x, y, width, height);
@@ -861,171 +861,171 @@ void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& stri
     m_shaderSourceMap.set(shader, entry);
 }
 
-void GraphicsContext3D::stencilFunc(unsigned long func, long ref, unsigned long mask)
+void GraphicsContext3D::stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask)
 {
     makeContextCurrent();
     ::glStencilFunc(func, ref, mask);
 }
 
-void GraphicsContext3D::stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask)
+void GraphicsContext3D::stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask)
 {
     makeContextCurrent();
     ::glStencilFuncSeparate(face, func, ref, mask);
 }
 
-void GraphicsContext3D::stencilMask(unsigned long mask)
+void GraphicsContext3D::stencilMask(GC3Duint mask)
 {
     makeContextCurrent();
     ::glStencilMask(mask);
 }
 
-void GraphicsContext3D::stencilMaskSeparate(unsigned long face, unsigned long mask)
+void GraphicsContext3D::stencilMaskSeparate(GC3Denum face, GC3Duint mask)
 {
     makeContextCurrent();
     ::glStencilMaskSeparate(face, mask);
 }
 
-void GraphicsContext3D::stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass)
+void GraphicsContext3D::stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
 {
     makeContextCurrent();
     ::glStencilOp(fail, zfail, zpass);
 }
 
-void GraphicsContext3D::stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass)
+void GraphicsContext3D::stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
 {
     makeContextCurrent();
     ::glStencilOpSeparate(face, fail, zfail, zpass);
 }
 
-void GraphicsContext3D::texParameterf(unsigned target, unsigned pname, float value)
+void GraphicsContext3D::texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat value)
 {
     makeContextCurrent();
-    ::glTexParameterf(target, pname, static_cast<float>(value));
+    ::glTexParameterf(target, pname, value);
 }
 
-void GraphicsContext3D::texParameteri(unsigned target, unsigned pname, int value)
+void GraphicsContext3D::texParameteri(GC3Denum target, GC3Denum pname, GC3Dint value)
 {
     makeContextCurrent();
-    ::glTexParameteri(target, pname, static_cast<float>(value));
+    ::glTexParameteri(target, pname, value);
 }
 
-void GraphicsContext3D::uniform1f(long location, float v0)
+void GraphicsContext3D::uniform1f(GC3Dint location, GC3Dfloat v0)
 {
     makeContextCurrent();
     ::glUniform1f(location, v0);
 }
 
-void GraphicsContext3D::uniform1fv(long location, float* array, int size)
+void GraphicsContext3D::uniform1fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     makeContextCurrent();
     ::glUniform1fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform2f(long location, float v0, float v1)
+void GraphicsContext3D::uniform2f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1)
 {
     makeContextCurrent();
     ::glUniform2f(location, v0, v1);
 }
 
-void GraphicsContext3D::uniform2fv(long location, float* array, int size)
+void GraphicsContext3D::uniform2fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 2
     makeContextCurrent();
     ::glUniform2fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform3f(long location, float v0, float v1, float v2)
+void GraphicsContext3D::uniform3f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2)
 {
     makeContextCurrent();
     ::glUniform3f(location, v0, v1, v2);
 }
 
-void GraphicsContext3D::uniform3fv(long location, float* array, int size)
+void GraphicsContext3D::uniform3fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 3
     makeContextCurrent();
     ::glUniform3fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform4f(long location, float v0, float v1, float v2, float v3)
+void GraphicsContext3D::uniform4f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
 {
     makeContextCurrent();
     ::glUniform4f(location, v0, v1, v2, v3);
 }
 
-void GraphicsContext3D::uniform4fv(long location, float* array, int size)
+void GraphicsContext3D::uniform4fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 4
     makeContextCurrent();
     ::glUniform4fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform1i(long location, int v0)
+void GraphicsContext3D::uniform1i(GC3Dint location, GC3Dint v0)
 {
     makeContextCurrent();
     ::glUniform1i(location, v0);
 }
 
-void GraphicsContext3D::uniform1iv(long location, int* array, int size)
+void GraphicsContext3D::uniform1iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     makeContextCurrent();
     ::glUniform1iv(location, size, array);
 }
 
-void GraphicsContext3D::uniform2i(long location, int v0, int v1)
+void GraphicsContext3D::uniform2i(GC3Dint location, GC3Dint v0, GC3Dint v1)
 {
     makeContextCurrent();
     ::glUniform2i(location, v0, v1);
 }
 
-void GraphicsContext3D::uniform2iv(long location, int* array, int size)
+void GraphicsContext3D::uniform2iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 2
     makeContextCurrent();
     ::glUniform2iv(location, size, array);
 }
 
-void GraphicsContext3D::uniform3i(long location, int v0, int v1, int v2)
+void GraphicsContext3D::uniform3i(GC3Dint location, GC3Dint v0, GC3Dint v1, GC3Dint v2)
 {
     makeContextCurrent();
     ::glUniform3i(location, v0, v1, v2);
 }
 
-void GraphicsContext3D::uniform3iv(long location, int* array, int size)
+void GraphicsContext3D::uniform3iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 3
     makeContextCurrent();
     ::glUniform3iv(location, size, array);
 }
 
-void GraphicsContext3D::uniform4i(long location, int v0, int v1, int v2, int v3)
+void GraphicsContext3D::uniform4i(GC3Dint location, GC3Dint v0, GC3Dint v1, GC3Dint v2, GC3Dint v3)
 {
     makeContextCurrent();
     ::glUniform4i(location, v0, v1, v2, v3);
 }
 
-void GraphicsContext3D::uniform4iv(long location, int* array, int size)
+void GraphicsContext3D::uniform4iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 4
     makeContextCurrent();
     ::glUniform4iv(location, size, array);
 }
 
-void GraphicsContext3D::uniformMatrix2fv(long location, bool transpose, float* array, int size)
+void GraphicsContext3D::uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 4
     makeContextCurrent();
     ::glUniformMatrix2fv(location, size, transpose, array);
 }
 
-void GraphicsContext3D::uniformMatrix3fv(long location, bool transpose, float* array, int size)
+void GraphicsContext3D::uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 9
     makeContextCurrent();
     ::glUniformMatrix3fv(location, size, transpose, array);
 }
 
-void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* array, int size)
+void GraphicsContext3D::uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* array, GC3Dsizei size)
 {
     // FIXME: length needs to be a multiple of 16
     makeContextCurrent();
@@ -1035,7 +1035,7 @@ void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* a
 void GraphicsContext3D::useProgram(Platform3DObject program)
 {
     makeContextCurrent();
-    ::glUseProgram((GLuint) program);
+    ::glUseProgram(program);
 }
 
 void GraphicsContext3D::validateProgram(Platform3DObject program)
@@ -1043,88 +1043,88 @@ void GraphicsContext3D::validateProgram(Platform3DObject program)
     ASSERT(program);
 
     makeContextCurrent();
-    ::glValidateProgram((GLuint) program);
+    ::glValidateProgram(program);
 }
 
-void GraphicsContext3D::vertexAttrib1f(unsigned long indx, float v0)
+void GraphicsContext3D::vertexAttrib1f(GC3Duint index, GC3Dfloat v0)
 {
     makeContextCurrent();
-    ::glVertexAttrib1f(indx, v0);
+    ::glVertexAttrib1f(index, v0);
 }
 
-void GraphicsContext3D::vertexAttrib1fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib1fv(GC3Duint index, GC3Dfloat* array)
 {
     makeContextCurrent();
-    ::glVertexAttrib1fv(indx, array);
+    ::glVertexAttrib1fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttrib2f(unsigned long indx, float v0, float v1)
+void GraphicsContext3D::vertexAttrib2f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1)
 {
     makeContextCurrent();
-    ::glVertexAttrib2f(indx, v0, v1);
+    ::glVertexAttrib2f(index, v0, v1);
 }
 
-void GraphicsContext3D::vertexAttrib2fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib2fv(GC3Duint index, GC3Dfloat* array)
 {
     makeContextCurrent();
-    ::glVertexAttrib2fv(indx, array);
+    ::glVertexAttrib2fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttrib3f(unsigned long indx, float v0, float v1, float v2)
+void GraphicsContext3D::vertexAttrib3f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2)
 {
     makeContextCurrent();
-    ::glVertexAttrib3f(indx, v0, v1, v2);
+    ::glVertexAttrib3f(index, v0, v1, v2);
 }
 
-void GraphicsContext3D::vertexAttrib3fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib3fv(GC3Duint index, GC3Dfloat* array)
 {
     makeContextCurrent();
-    ::glVertexAttrib3fv(indx, array);
+    ::glVertexAttrib3fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttrib4f(unsigned long indx, float v0, float v1, float v2, float v3)
+void GraphicsContext3D::vertexAttrib4f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
 {
     makeContextCurrent();
-    ::glVertexAttrib4f(indx, v0, v1, v2, v3);
+    ::glVertexAttrib4f(index, v0, v1, v2, v3);
 }
 
-void GraphicsContext3D::vertexAttrib4fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib4fv(GC3Duint index, GC3Dfloat* array)
 {
     makeContextCurrent();
-    ::glVertexAttrib4fv(indx, array);
+    ::glVertexAttrib4fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, unsigned long stride, unsigned long offset)
+void GraphicsContext3D::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset)
 {
     makeContextCurrent();
-    ::glVertexAttribPointer(indx, size, type, normalized, stride, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+    ::glVertexAttribPointer(index, size, type, normalized, stride, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)));
 }
 
-void GraphicsContext3D::viewport(long x, long y, unsigned long width, unsigned long height)
+void GraphicsContext3D::viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
 {
     makeContextCurrent();
-    ::glViewport(static_cast<GLint>(x), static_cast<GLint>(y), static_cast<GLsizei>(width), static_cast<GLsizei>(height));
+    ::glViewport(x, y, width, height);
 }
 
-void GraphicsContext3D::getBooleanv(unsigned long pname, unsigned char* value)
+void GraphicsContext3D::getBooleanv(GC3Denum pname, GC3Dboolean* value)
 {
     makeContextCurrent();
     ::glGetBooleanv(pname, value);
 }
 
-void GraphicsContext3D::getBufferParameteriv(unsigned long target, unsigned long pname, int* value)
+void GraphicsContext3D::getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value)
 {
     makeContextCurrent();
     ::glGetBufferParameteriv(target, pname, value);
 }
 
-void GraphicsContext3D::getFloatv(unsigned long pname, float* value)
+void GraphicsContext3D::getFloatv(GC3Denum pname, GC3Dfloat* value)
 {
     makeContextCurrent();
     ::glGetFloatv(pname, value);
 }
 
-void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value)
+void GraphicsContext3D::getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value)
 {
     makeContextCurrent();
     if (attachment == DEPTH_STENCIL_ATTACHMENT)
@@ -1132,7 +1132,7 @@ void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target
     ::glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, value);
 }
 
-void GraphicsContext3D::getIntegerv(unsigned long pname, int* value)
+void GraphicsContext3D::getIntegerv(GC3Denum pname, GC3Dint* value)
 {
     // Need to emulate MAX_FRAGMENT/VERTEX_UNIFORM_VECTORS and MAX_VARYING_VECTORS
     // because desktop GL's corresponding queries return the number of components
@@ -1157,10 +1157,10 @@ void GraphicsContext3D::getIntegerv(unsigned long pname, int* value)
     }
 }
 
-void GraphicsContext3D::getProgramiv(Platform3DObject program, unsigned long pname, int* value)
+void GraphicsContext3D::getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value)
 {
     makeContextCurrent();
-    ::glGetProgramiv((GLuint) program, pname, value);
+    ::glGetProgramiv(program, pname, value);
 }
 
 String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
@@ -1169,26 +1169,26 @@ String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
 
     makeContextCurrent();
     GLint length;
-    ::glGetProgramiv((GLuint) program, GL_INFO_LOG_LENGTH, &length);
+    ::glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length);
     if (!length)
         return "";
 
     GLsizei size;
     GLchar* info = (GLchar*) fastMalloc(length);
 
-    ::glGetProgramInfoLog((GLuint) program, length, &size, info);
+    ::glGetProgramInfoLog(program, length, &size, info);
     String s(info);
     fastFree(info);
     return s;
 }
 
-void GraphicsContext3D::getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value)
+void GraphicsContext3D::getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value)
 {
     makeContextCurrent();
     ::glGetRenderbufferParameterivEXT(target, pname, value);
 }
 
-void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long pname, int* value)
+void GraphicsContext3D::getShaderiv(Platform3DObject shader, GC3Denum pname, GC3Dint* value)
 {
     ASSERT(shader);
 
@@ -1201,7 +1201,7 @@ void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long pname
         case SHADER_TYPE:
             // Let OpenGL handle these.
         
-            ::glGetShaderiv((GLuint) shader, pname, value);
+            ::glGetShaderiv(shader, pname, value);
             break;
         
         case COMPILE_STATUS:
@@ -1246,14 +1246,14 @@ String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
 
      if (entry.isValid) {
          GLint length;
-         ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
+         ::glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
          if (!length)
              return "";
 
          GLsizei size;
          GLchar* info = (GLchar*) fastMalloc(length);
 
-         ::glGetShaderInfoLog((GLuint) shader, length, &size, info);
+         ::glGetShaderInfoLog(shader, length, &size, info);
 
          String s(info);
          fastFree(info);
@@ -1277,67 +1277,67 @@ String GraphicsContext3D::getShaderSource(Platform3DObject shader)
 }
 
 
-void GraphicsContext3D::getTexParameterfv(unsigned long target, unsigned long pname, float* value)
+void GraphicsContext3D::getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value)
 {
     makeContextCurrent();
     ::glGetTexParameterfv(target, pname, value);
 }
 
-void GraphicsContext3D::getTexParameteriv(unsigned long target, unsigned long pname, int* value)
+void GraphicsContext3D::getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value)
 {
     makeContextCurrent();
     ::glGetTexParameteriv(target, pname, value);
 }
 
-void GraphicsContext3D::getUniformfv(Platform3DObject program, long location, float* value)
+void GraphicsContext3D::getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value)
 {
     makeContextCurrent();
-    ::glGetUniformfv((GLuint) program, location, value);
+    ::glGetUniformfv(program, location, value);
 }
 
-void GraphicsContext3D::getUniformiv(Platform3DObject program, long location, int* value)
+void GraphicsContext3D::getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value)
 {
     makeContextCurrent();
-    ::glGetUniformiv((GLuint) program, location, value);
+    ::glGetUniformiv(program, location, value);
 }
 
-long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
+GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
 {
     ASSERT(program);
 
     makeContextCurrent();
-    return ::glGetUniformLocation((GLuint) program, name.utf8().data());
+    return ::glGetUniformLocation(program, name.utf8().data());
 }
 
-void GraphicsContext3D::getVertexAttribfv(unsigned long index, unsigned long pname, float* value)
+void GraphicsContext3D::getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value)
 {
     makeContextCurrent();
     ::glGetVertexAttribfv(index, pname, value);
 }
 
-void GraphicsContext3D::getVertexAttribiv(unsigned long index, unsigned long pname, int* value)
+void GraphicsContext3D::getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value)
 {
     makeContextCurrent();
     ::glGetVertexAttribiv(index, pname, value);
 }
 
-long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long pname)
+GC3Dsizeiptr GraphicsContext3D::getVertexAttribOffset(GC3Duint index, GC3Denum pname)
 {
     makeContextCurrent();
 
-    void* pointer;
+    GLvoid* pointer = 0;
     ::glGetVertexAttribPointerv(index, pname, &pointer);
-    return reinterpret_cast<long>(pointer);
+    return static_cast<GC3Dsizeiptr>(reinterpret_cast<intptr_t>(pointer));
 }
 
-int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
 {
     if (width && height && !pixels) {
         synthesizeGLError(INVALID_VALUE);
-        return 1;
+        return false;
     }
     makeContextCurrent();
-    unsigned openGLInternalFormat = internalformat;
+    GC3Denum openGLInternalFormat = internalformat;
     if (type == GL_FLOAT) {
         if (format == GL_RGBA)
             openGLInternalFormat = GL_RGBA32F_ARB;
@@ -1346,99 +1346,98 @@ int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned inte
     }
 
     ::glTexImage2D(target, level, openGLInternalFormat, width, height, border, format, type, pixels);
-    return 0;
+    return true;
 }
 
-int GraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoff, unsigned yoff, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+void GraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoff, GC3Dint yoff, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels)
 {
     makeContextCurrent();
 
     // FIXME: we will need to deal with PixelStore params when dealing with image buffers that differ from the subimage size
     ::glTexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
-    return 0;
 }
 
-unsigned GraphicsContext3D::createBuffer()
+Platform3DObject GraphicsContext3D::createBuffer()
 {
     makeContextCurrent();
-    GLuint o;
+    GLuint o = 0;
     glGenBuffers(1, &o);
     return o;
 }
 
-unsigned GraphicsContext3D::createFramebuffer()
+Platform3DObject GraphicsContext3D::createFramebuffer()
 {
     makeContextCurrent();
-    GLuint o;
+    GLuint o = 0;
     glGenFramebuffersEXT(1, &o);
     return o;
 }
 
-unsigned GraphicsContext3D::createProgram()
+Platform3DObject GraphicsContext3D::createProgram()
 {
     makeContextCurrent();
     return glCreateProgram();
 }
 
-unsigned GraphicsContext3D::createRenderbuffer()
+Platform3DObject GraphicsContext3D::createRenderbuffer()
 {
     makeContextCurrent();
-    GLuint o;
+    GLuint o = 0;
     glGenRenderbuffersEXT(1, &o);
     return o;
 }
 
-unsigned GraphicsContext3D::createShader(unsigned long type)
+Platform3DObject GraphicsContext3D::createShader(GC3Denum type)
 {
     makeContextCurrent();
     return glCreateShader((type == FRAGMENT_SHADER) ? GL_FRAGMENT_SHADER : GL_VERTEX_SHADER);
 }
 
-unsigned GraphicsContext3D::createTexture()
+Platform3DObject GraphicsContext3D::createTexture()
 {
     makeContextCurrent();
-    GLuint o;
+    GLuint o = 0;
     glGenTextures(1, &o);
     return o;
 }
 
-void GraphicsContext3D::deleteBuffer(unsigned buffer)
+void GraphicsContext3D::deleteBuffer(Platform3DObject buffer)
 {
     makeContextCurrent();
     glDeleteBuffers(1, &buffer);
 }
 
-void GraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
+void GraphicsContext3D::deleteFramebuffer(Platform3DObject framebuffer)
 {
     makeContextCurrent();
     glDeleteFramebuffersEXT(1, &framebuffer);
 }
 
-void GraphicsContext3D::deleteProgram(unsigned program)
+void GraphicsContext3D::deleteProgram(Platform3DObject program)
 {
     makeContextCurrent();
     glDeleteProgram(program);
 }
 
-void GraphicsContext3D::deleteRenderbuffer(unsigned renderbuffer)
+void GraphicsContext3D::deleteRenderbuffer(Platform3DObject renderbuffer)
 {
     makeContextCurrent();
     glDeleteRenderbuffersEXT(1, &renderbuffer);
 }
 
-void GraphicsContext3D::deleteShader(unsigned shader)
+void GraphicsContext3D::deleteShader(Platform3DObject shader)
 {
     makeContextCurrent();
     glDeleteShader(shader);
 }
 
-void GraphicsContext3D::deleteTexture(unsigned texture)
+void GraphicsContext3D::deleteTexture(Platform3DObject texture)
 {
     makeContextCurrent();
     glDeleteTextures(1, &texture);
 }
 
-int GraphicsContext3D::sizeInBytes(int type)
+uint32_t GraphicsContext3D::sizeInBytes(GC3Denum type)
 {
     switch (type) {
         case GL_BYTE:
@@ -1460,7 +1459,7 @@ int GraphicsContext3D::sizeInBytes(int type)
     }
 }
 
-void GraphicsContext3D::synthesizeGLError(unsigned long error)
+void GraphicsContext3D::synthesizeGLError(GC3Denum error)
 {
     m_syntheticErrors.add(error);
 }
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 70fc46c..295212c 100644
--- a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -603,7 +603,7 @@ IntSize GraphicsContext3D::getInternalFramebufferSize()
     return IntSize(m_currentWidth, m_currentHeight);
 }
 
-void GraphicsContext3D::activeTexture(unsigned long texture)
+void GraphicsContext3D::activeTexture(GC3Denum texture)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->activeTexture(texture);
@@ -614,10 +614,10 @@ void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject
     ASSERT(program);
     ASSERT(shader);
     m_internal->m_glWidget->makeCurrent();
-    m_internal->attachShader((GLuint) program, (GLuint) shader);
+    m_internal->attachShader(program, shader);
 }
 
-void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders)
+void GraphicsContext3D::getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders)
 {
     if (!program) {
         synthesizeGLError(INVALID_VALUE);
@@ -625,108 +625,108 @@ void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCoun
     }
 
     m_internal->m_glWidget->makeCurrent();
-    getAttachedShaders((GLuint) program, maxCount, count, shaders);
+    getAttachedShaders(program, maxCount, count, shaders);
 }
 
-void GraphicsContext3D::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
+void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
 {
     ASSERT(program);
     m_internal->m_glWidget->makeCurrent();
-    m_internal->bindAttribLocation((GLuint) program, index, name.utf8().data());
+    m_internal->bindAttribLocation(program, index, name.utf8().data());
 }
 
-void GraphicsContext3D::bindBuffer(unsigned long target, Platform3DObject buffer)
+void GraphicsContext3D::bindBuffer(GC3Denum target, Platform3DObject buffer)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->bindBuffer(target, (GLuint) buffer);
+    m_internal->bindBuffer(target, buffer);
 }
 
-void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject buffer)
+void GraphicsContext3D::bindFramebuffer(GC3Denum target, Platform3DObject buffer)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->m_currentFbo = buffer ? (GLuint) buffer : m_internal->m_mainFbo;
+    m_internal->m_currentFbo = buffer ? buffer : m_internal->m_mainFbo;
     m_internal->bindFramebuffer(target, m_internal->m_currentFbo);
 }
 
-void GraphicsContext3D::bindRenderbuffer(unsigned long target, Platform3DObject renderbuffer)
+void GraphicsContext3D::bindRenderbuffer(GC3Denum target, Platform3DObject renderbuffer)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->bindRenderbuffer(target, (GLuint) renderbuffer);
+    m_internal->bindRenderbuffer(target, renderbuffer);
 }
 
-void GraphicsContext3D::bindTexture(unsigned long target, Platform3DObject texture)
+void GraphicsContext3D::bindTexture(GC3Denum target, Platform3DObject texture)
 {
     m_internal->m_glWidget->makeCurrent();
-    glBindTexture(target, (GLuint) texture);
+    glBindTexture(target, texture);
 }
 
-void GraphicsContext3D::blendColor(double red, double green, double blue, double alpha)
+void GraphicsContext3D::blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->blendColor(static_cast<float>(red), static_cast<float>(green), static_cast<float>(blue), static_cast<float>(alpha));
+    m_internal->blendColor(red, green, blue, alpha);
 }
 
-void GraphicsContext3D::blendEquation(unsigned long mode)
+void GraphicsContext3D::blendEquation(GC3Denum mode)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->blendEquation(mode);
 }
 
-void GraphicsContext3D::blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha)
+void GraphicsContext3D::blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->blendEquationSeparate(modeRGB, modeAlpha);
 }
 
-void GraphicsContext3D::blendFunc(unsigned long sfactor, unsigned long dfactor)
+void GraphicsContext3D::blendFunc(GC3Denum sfactor, GC3Denum dfactor)
 {
     m_internal->m_glWidget->makeCurrent();
     glBlendFunc(sfactor, dfactor);
 }       
 
-void GraphicsContext3D::blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha)
+void GraphicsContext3D::blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
 }
 
-void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long usage)
+void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->bufferData(target, size, /* data */ 0, usage);
 }
 
-void GraphicsContext3D::bufferData(unsigned long target, int size, const void* data, unsigned long usage)
+void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->bufferData(target, size, data, usage);
 }
 
-void GraphicsContext3D::bufferSubData(unsigned long target, long offset, int size, const void* data)
+void GraphicsContext3D::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->bufferSubData(target, offset, size, data);
 }
 
-unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
+GC3Denum GraphicsContext3D::checkFramebufferStatus(GC3Denum target)
 {
     m_internal->m_glWidget->makeCurrent();
     return m_internal->checkFramebufferStatus(target);
 }
 
-void GraphicsContext3D::clearColor(double r, double g, double b, double a)
+void GraphicsContext3D::clearColor(GC3Dclampf r, GC3Dclampf g, GC3Dclampf b, GC3Dclampf a)
 {
     m_internal->m_glWidget->makeCurrent();
-    glClearColor(static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a));
+    glClearColor(r, g, b, a);
 }
 
-void GraphicsContext3D::clear(unsigned long mask)
+void GraphicsContext3D::clear(GC3Dbitfield mask)
 {
     m_internal->m_glWidget->makeCurrent();
     glClear(mask);
 }
 
-void GraphicsContext3D::clearDepth(double depth)
+void GraphicsContext3D::clearDepth(GC3Dclampf depth)
 {
     m_internal->m_glWidget->makeCurrent();
 #if defined(QT_OPENGL_ES_2)
@@ -736,13 +736,13 @@ void GraphicsContext3D::clearDepth(double depth)
 #endif
 }
 
-void GraphicsContext3D::clearStencil(long s)
+void GraphicsContext3D::clearStencil(GC3Dint s)
 {
     m_internal->m_glWidget->makeCurrent();
     glClearStencil(s);
 }
 
-void GraphicsContext3D::colorMask(bool red, bool green, bool blue, bool alpha)
+void GraphicsContext3D::colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha)
 {
     m_internal->m_glWidget->makeCurrent();
     glColorMask(red, green, blue, alpha);
@@ -752,40 +752,40 @@ void GraphicsContext3D::compileShader(Platform3DObject shader)
 {
     ASSERT(shader);
     m_internal->m_glWidget->makeCurrent();
-    m_internal->compileShader((GLuint) shader);
+    m_internal->compileShader(shader);
 }
 
-void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
+void GraphicsContext3D::copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border)
 {
     m_internal->m_glWidget->makeCurrent();
     glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
 }
 
-void GraphicsContext3D::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
+void GraphicsContext3D::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
 {
     m_internal->m_glWidget->makeCurrent();
     glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
 }
 
-void GraphicsContext3D::cullFace(unsigned long mode)
+void GraphicsContext3D::cullFace(GC3Denum mode)
 {
     m_internal->m_glWidget->makeCurrent();
     glCullFace(mode);
 }
 
-void GraphicsContext3D::depthFunc(unsigned long func)
+void GraphicsContext3D::depthFunc(GC3Denum func)
 {
     m_internal->m_glWidget->makeCurrent();
     glDepthFunc(func);
 }
 
-void GraphicsContext3D::depthMask(bool flag)
+void GraphicsContext3D::depthMask(GC3Dboolean flag)
 {
     m_internal->m_glWidget->makeCurrent();
     glDepthMask(flag);
 }
 
-void GraphicsContext3D::depthRange(double zNear, double zFar)
+void GraphicsContext3D::depthRange(GC3Dclampf zNear, GC3Dclampf zFar)
 {
     m_internal->m_glWidget->makeCurrent();
 #if defined(QT_OPENGL_ES_2)
@@ -800,40 +800,40 @@ void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject
     ASSERT(program);
     ASSERT(shader);
     m_internal->m_glWidget->makeCurrent();
-    m_internal->detachShader((GLuint) program, (GLuint) shader);
+    m_internal->detachShader(program, shader);
 }
 
-void GraphicsContext3D::disable(unsigned long cap)
+void GraphicsContext3D::disable(GC3Denum cap)
 {
     m_internal->m_glWidget->makeCurrent();
     glDisable(cap);
 }
 
-void GraphicsContext3D::disableVertexAttribArray(unsigned long index)
+void GraphicsContext3D::disableVertexAttribArray(GC3Duint index)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->disableVertexAttribArray(index);
 }
 
-void GraphicsContext3D::drawArrays(unsigned long mode, long first, long count)
+void GraphicsContext3D::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count)
 {
     m_internal->m_glWidget->makeCurrent();
     glDrawArrays(mode, first, count);
 }
 
-void GraphicsContext3D::drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset)
+void GraphicsContext3D::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset)
 {
     m_internal->m_glWidget->makeCurrent();
-    glDrawElements(mode, count, type, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+    glDrawElements(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)));
 }
 
-void GraphicsContext3D::enable(unsigned long cap)
+void GraphicsContext3D::enable(GC3Denum cap)
 {
     m_internal->m_glWidget->makeCurrent();
     glEnable(cap);
 }
 
-void GraphicsContext3D::enableVertexAttribArray(unsigned long index)
+void GraphicsContext3D::enableVertexAttribArray(GC3Duint index)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->enableVertexAttribArray(index);
@@ -851,31 +851,31 @@ void GraphicsContext3D::flush()
     glFlush();
 }
 
-void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
+void GraphicsContext3D::framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject buffer)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->framebufferRenderbuffer(target, attachment, renderbuffertarget, (GLuint) buffer);
+    m_internal->framebufferRenderbuffer(target, attachment, renderbuffertarget, buffer);
 }
 
-void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
+void GraphicsContext3D::framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject texture, GC3Dint level)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->framebufferTexture2D(target, attachment, textarget, (GLuint) texture, level);
+    m_internal->framebufferTexture2D(target, attachment, textarget, texture, level);
 }
 
-void GraphicsContext3D::frontFace(unsigned long mode)
+void GraphicsContext3D::frontFace(GC3Denum mode)
 {
     m_internal->m_glWidget->makeCurrent();
     glFrontFace(mode);
 }
 
-void GraphicsContext3D::generateMipmap(unsigned long target)
+void GraphicsContext3D::generateMipmap(GC3Denum target)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->generateMipmap(target);
 }
 
-bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
+bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
 {
     if (!program) {
         synthesizeGLError(INVALID_VALUE);
@@ -884,15 +884,15 @@ bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long
 
     m_internal->m_glWidget->makeCurrent();
 
-    GLint maxLength;
-    m_internal->getProgramiv(static_cast<GLuint>(program), GraphicsContext3D::ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength);
+    GLint maxLength = 0;
+    m_internal->getProgramiv(program, GraphicsContext3D::ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength);
 
     GLchar* name = (GLchar*) fastMalloc(maxLength);
-    GLsizei nameLength;
-    GLint size;
-    GLenum type;
+    GLsizei nameLength = 0;
+    GLint size = 0;
+    GLenum type = 0;
 
-    m_internal->getActiveAttrib(static_cast<GLuint>(program), index, maxLength, &nameLength, &size, &type, name);
+    m_internal->getActiveAttrib(program, index, maxLength, &nameLength, &size, &type, name);
 
     if (!nameLength) {
         fastFree(name);
@@ -907,7 +907,7 @@ bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long
     return true;
 }
     
-bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
+bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
 {
     if (!program) {
         synthesizeGLError(INVALID_VALUE);
@@ -916,13 +916,13 @@ bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long
 
     m_internal->m_glWidget->makeCurrent();
 
-    GLint maxLength;
+    GLint maxLength = 0;
     m_internal->getProgramiv(static_cast<GLuint>(program), GraphicsContext3D::ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
 
     GLchar* name = (GLchar*) fastMalloc(maxLength);
-    GLsizei nameLength;
-    GLint size;
-    GLenum type;
+    GLsizei nameLength = 0;
+    GLint size = 0;
+    GLenum type = 0;
 
     m_internal->getActiveUniform(static_cast<GLuint>(program), index, maxLength, &nameLength, &size, &type, name);
 
@@ -945,7 +945,7 @@ int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String&
         return -1;
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->getAttribLocation((GLuint) program, name.utf8().data());
+    return m_internal->getAttribLocation(program, name.utf8().data());
 }
 
 GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
@@ -953,11 +953,11 @@ GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
     return m_internal->m_attrs;
 }
 
-unsigned long GraphicsContext3D::getError()
+GC3Denum GraphicsContext3D::getError()
 {
     if (m_internal->m_syntheticErrors.size() > 0) {
-        ListHashSet<unsigned long>::iterator iter = m_internal->m_syntheticErrors.begin();
-        unsigned long err = *iter;
+        ListHashSet<GC3Denum>::iterator iter = m_internal->m_syntheticErrors.begin();
+        GC3Denum err = *iter;
         m_internal->m_syntheticErrors.remove(iter);
         return err;
     }
@@ -966,76 +966,76 @@ unsigned long GraphicsContext3D::getError()
     return glGetError();
 }
 
-String GraphicsContext3D::getString(unsigned long name)
+String GraphicsContext3D::getString(GC3Denum name)
 {
     m_internal->m_glWidget->makeCurrent();
     return String((const char*) glGetString(name));
 }
 
-void GraphicsContext3D::hint(unsigned long target, unsigned long mode)
+void GraphicsContext3D::hint(GC3Denum target, GC3Denum mode)
 {
     m_internal->m_glWidget->makeCurrent();
     glHint(target, mode);
 }
 
-bool GraphicsContext3D::isBuffer(Platform3DObject buffer)
+GC3Dboolean GraphicsContext3D::isBuffer(Platform3DObject buffer)
 {
     if (!buffer)
-        return false;
+        return GL_FALSE;
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->isBuffer((GLuint) buffer);
+    return m_internal->isBuffer(buffer);
 }
 
-bool GraphicsContext3D::isEnabled(unsigned long cap)
+GC3Dboolean GraphicsContext3D::isEnabled(GC3Denum cap)
 {
     m_internal->m_glWidget->makeCurrent();
     return glIsEnabled(cap);
 }
 
-bool GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
+GC3Dboolean GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
 {
     if (!framebuffer)
-        return false;
+        return GL_FALSE;
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->isFramebuffer((GLuint) framebuffer);
+    return m_internal->isFramebuffer(framebuffer);
 }
 
-bool GraphicsContext3D::isProgram(Platform3DObject program)
+GC3Dboolean GraphicsContext3D::isProgram(Platform3DObject program)
 {
     if (!program)
-        return false;
+        return GL_FALSE;
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->isProgram((GLuint) program);
+    return m_internal->isProgram(program);
 }
 
-bool GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
+GC3Dboolean GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
 {
     if (!renderbuffer)
-        return false;
+        return GL_FALSE;
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->isRenderbuffer((GLuint) renderbuffer);
+    return m_internal->isRenderbuffer(renderbuffer);
 }
 
-bool GraphicsContext3D::isShader(Platform3DObject shader)
+GC3Dboolean GraphicsContext3D::isShader(Platform3DObject shader)
 {
     if (!shader)
-        return false;
+        return GL_FALSE;
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->isShader((GLuint) shader);
+    return m_internal->isShader(shader);
 }
 
-bool GraphicsContext3D::isTexture(Platform3DObject texture)
+GC3Dboolean GraphicsContext3D::isTexture(Platform3DObject texture)
 {
     if (!texture)
-        return false;
+        return GL_FALSE;
     
     m_internal->m_glWidget->makeCurrent();
-    return glIsTexture((GLuint) texture);
+    return glIsTexture(texture);
 }
 
 void GraphicsContext3D::lineWidth(double width)
@@ -1048,29 +1048,29 @@ void GraphicsContext3D::linkProgram(Platform3DObject program)
 {
     ASSERT(program);
     m_internal->m_glWidget->makeCurrent();
-    m_internal->linkProgram((GLuint) program);
+    m_internal->linkProgram(program);
 }
 
-void GraphicsContext3D::pixelStorei(unsigned long paramName, long param)
+void GraphicsContext3D::pixelStorei(GC3Denum paramName, GC3Dint param)
 {
     m_internal->m_glWidget->makeCurrent();
     glPixelStorei(paramName, param);
 }
 
-void GraphicsContext3D::polygonOffset(double factor, double units)
+void GraphicsContext3D::polygonOffset(GC3Dfloat factor, GC3Dfloat units)
 {
     m_internal->m_glWidget->makeCurrent();
-    glPolygonOffset(static_cast<float>(factor), static_cast<float>(units));
+    glPolygonOffset(factor, units);
 }
 
-void GraphicsContext3D::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data)
+void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data)
 {
     m_internal->m_glWidget->makeCurrent();
     
     if (type != GraphicsContext3D::UNSIGNED_BYTE || format != GraphicsContext3D::RGBA)
         return;
         
-    glReadPixels(x, y, width, height, format, type, (GLvoid*) data);
+    glReadPixels(x, y, width, height, format, type, data);
 }
 
 void GraphicsContext3D::releaseShaderCompiler()
@@ -1079,19 +1079,19 @@ void GraphicsContext3D::releaseShaderCompiler()
     notImplemented();
 }
 
-void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
+void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->renderbufferStorage(target, internalformat, width, height);
 }
 
-void GraphicsContext3D::sampleCoverage(double value, bool invert)
+void GraphicsContext3D::sampleCoverage(GC3Dclampf value, GC3Dboolean invert)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->sampleCoverage(static_cast<float>(value), invert);
+    m_internal->sampleCoverage(value, invert);
 }
 
-void GraphicsContext3D::scissor(long x, long y, unsigned long width, unsigned long height)
+void GraphicsContext3D::scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
 {
     m_internal->m_glWidget->makeCurrent();
     glScissor(x, y, width, height);
@@ -1117,163 +1117,163 @@ void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& sour
     m_internal->shaderSource((GLuint) shader, /* count */ 1, &data, &length);
 }
 
-void GraphicsContext3D::stencilFunc(unsigned long func, long ref, unsigned long mask)
+void GraphicsContext3D::stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask)
 {
     m_internal->m_glWidget->makeCurrent();
     glStencilFunc(func, ref, mask);
 }
 
-void GraphicsContext3D::stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask)
+void GraphicsContext3D::stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->stencilFuncSeparate(face, func, ref, mask);
 }
 
-void GraphicsContext3D::stencilMask(unsigned long mask)
+void GraphicsContext3D::stencilMask(GC3Duint mask)
 {
     m_internal->m_glWidget->makeCurrent();
     glStencilMask(mask);
 }
 
-void GraphicsContext3D::stencilMaskSeparate(unsigned long face, unsigned long mask)
+void GraphicsContext3D::stencilMaskSeparate(GC3Denum face, GC3Duint mask)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->stencilMaskSeparate(face, mask);
 }
 
-void GraphicsContext3D::stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass)
+void GraphicsContext3D::stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
 {
     m_internal->m_glWidget->makeCurrent();
     glStencilOp(fail, zfail, zpass);
 }
 
-void GraphicsContext3D::stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass)
+void GraphicsContext3D::stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->stencilOpSeparate(face, fail, zfail, zpass);
 }
 
-void GraphicsContext3D::texParameterf(unsigned target, unsigned paramName, float value)
+void GraphicsContext3D::texParameterf(GC3Denum target, GC3Denum paramName, GC3Dfloat value)
 {
     m_internal->m_glWidget->makeCurrent();
-    glTexParameterf(target, paramName, static_cast<float>(value));
+    glTexParameterf(target, paramName, value);
 }
 
-void GraphicsContext3D::texParameteri(unsigned target, unsigned paramName, int value)
+void GraphicsContext3D::texParameteri(GC3Denum target, GC3Denum paramName, GC3Dint value)
 {
     m_internal->m_glWidget->makeCurrent();
-    glTexParameteri(target, paramName, static_cast<float>(value));
+    glTexParameteri(target, paramName, value);
 }
 
-void GraphicsContext3D::uniform1f(long location, float v0)
+void GraphicsContext3D::uniform1f(GC3Dint location, GC3Dfloat v0)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform1f(location, v0);
 }
 
-void GraphicsContext3D::uniform1fv(long location, float* array, int size)
+void GraphicsContext3D::uniform1fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform1fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform2f(long location, float v0, float v1)
+void GraphicsContext3D::uniform2f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform2f(location, v0, v1);
 }
 
-void GraphicsContext3D::uniform2fv(long location, float* array, int size)
+void GraphicsContext3D::uniform2fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform2fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform3f(long location, float v0, float v1, float v2)
+void GraphicsContext3D::uniform3f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform3f(location, v0, v1, v2);
 }
 
-void GraphicsContext3D::uniform3fv(long location, float* array, int size)
+void GraphicsContext3D::uniform3fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform3fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform4f(long location, float v0, float v1, float v2, float v3)
+void GraphicsContext3D::uniform4f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform4f(location, v0, v1, v2, v3);
 }
 
-void GraphicsContext3D::uniform4fv(long location, float* array, int size)
+void GraphicsContext3D::uniform4fv(GC3Dint location, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform4fv(location, size, array);
 }
 
-void GraphicsContext3D::uniform1i(long location, int v0)
+void GraphicsContext3D::uniform1i(GC3Dint location, GC3Dint v0)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform1i(location, v0);
 }
 
-void GraphicsContext3D::uniform1iv(long location, int* array, int size)
+void GraphicsContext3D::uniform1iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform1iv(location, size, array);
 }
 
-void GraphicsContext3D::uniform2i(long location, int v0, int v1)
+void GraphicsContext3D::uniform2i(GC3Dint location, GC3Dint v0, GC3Dint v1)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform2i(location, v0, v1);
 }
 
-void GraphicsContext3D::uniform2iv(long location, int* array, int size)
+void GraphicsContext3D::uniform2iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform2iv(location, size, array);
 }
 
-void GraphicsContext3D::uniform3i(long location, int v0, int v1, int v2)
+void GraphicsContext3D::uniform3i(GC3Dint location, GC3Dint v0, GC3Dint v1, GC3Dint v2)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform3i(location, v0, v1, v2);
 }
 
-void GraphicsContext3D::uniform3iv(long location, int* array, int size)
+void GraphicsContext3D::uniform3iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform3iv(location, size, array);
 }
 
-void GraphicsContext3D::uniform4i(long location, int v0, int v1, int v2, int v3)
+void GraphicsContext3D::uniform4i(GC3Dint location, GC3Dint v0, GC3Dint v1, GC3Dint v2, GC3Dint v3)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform4i(location, v0, v1, v2, v3);
 }
 
-void GraphicsContext3D::uniform4iv(long location, int* array, int size)
+void GraphicsContext3D::uniform4iv(GC3Dint location, GC3Dint* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniform4iv(location, size, array);
 }
 
-void GraphicsContext3D::uniformMatrix2fv(long location, bool transpose, float* array, int size)
+void GraphicsContext3D::uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniformMatrix2fv(location, size, transpose, array);
 }
 
-void GraphicsContext3D::uniformMatrix3fv(long location, bool transpose, float* array, int size)
+void GraphicsContext3D::uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniformMatrix3fv(location, size, transpose, array);
 }
 
-void GraphicsContext3D::uniformMatrix4fv(long location, bool transpose, float* array, int size)
+void GraphicsContext3D::uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* array, GC3Dsizei size)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->uniformMatrix4fv(location, size, transpose, array);
@@ -1284,7 +1284,7 @@ void GraphicsContext3D::useProgram(Platform3DObject program)
     ASSERT(program);
     
     m_internal->m_glWidget->makeCurrent();
-    m_internal->useProgram((GLuint) program);
+    m_internal->useProgram(program);
 }
 
 void GraphicsContext3D::validateProgram(Platform3DObject program)
@@ -1292,119 +1292,119 @@ void GraphicsContext3D::validateProgram(Platform3DObject program)
     ASSERT(program);
     
     m_internal->m_glWidget->makeCurrent();
-    m_internal->validateProgram((GLuint) program);
+    m_internal->validateProgram(program);
 }
 
-void GraphicsContext3D::vertexAttrib1f(unsigned long indx, float v0)
+void GraphicsContext3D::vertexAttrib1f(GC3Duint index, GC3Dfloat v0)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib1f(indx, v0);
+    m_internal->vertexAttrib1f(index, v0);
 }
 
-void GraphicsContext3D::vertexAttrib1fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib1fv(GC3Duint index, GC3Dfloat* array)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib1fv(indx, array);
+    m_internal->vertexAttrib1fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttrib2f(unsigned long indx, float v0, float v1)
+void GraphicsContext3D::vertexAttrib2f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib2f(indx, v0, v1);
+    m_internal->vertexAttrib2f(index, v0, v1);
 }
 
-void GraphicsContext3D::vertexAttrib2fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib2fv(GC3Duint index, GC3Dfloat* array)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib2fv(indx, array);
+    m_internal->vertexAttrib2fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttrib3f(unsigned long indx, float v0, float v1, float v2)
+void GraphicsContext3D::vertexAttrib3f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib3f(indx, v0, v1, v2);
+    m_internal->vertexAttrib3f(index, v0, v1, v2);
 }
 
-void GraphicsContext3D::vertexAttrib3fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib3fv(GC3Duint index, GC3Dfloat* array)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib3fv(indx, array);
+    m_internal->vertexAttrib3fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttrib4f(unsigned long indx, float v0, float v1, float v2, float v3)
+void GraphicsContext3D::vertexAttrib4f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib4f(indx, v0, v1, v2, v3);
+    m_internal->vertexAttrib4f(index, v0, v1, v2, v3);
 }
 
-void GraphicsContext3D::vertexAttrib4fv(unsigned long indx, float* array)
+void GraphicsContext3D::vertexAttrib4fv(GC3Duint index, GC3Dfloat* array)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttrib4fv(indx, array);
+    m_internal->vertexAttrib4fv(index, array);
 }
 
-void GraphicsContext3D::vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, unsigned long stride, unsigned long offset)
+void GraphicsContext3D::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->vertexAttribPointer(indx, size, type, normalized, stride, reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
+    m_internal->vertexAttribPointer(index, size, type, normalized, stride, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)));
 }
 
-void GraphicsContext3D::viewport(long x, long y, unsigned long width, unsigned long height)
+void GraphicsContext3D::viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
 {
     m_internal->m_glWidget->makeCurrent();
-    glViewport(static_cast<GLint>(x), static_cast<GLint>(y), static_cast<GLsizei>(width), static_cast<GLsizei>(height));
+    glViewport(x, y, width, height);
 }
 
-void GraphicsContext3D::getBooleanv(unsigned long paramName, unsigned char* value)
+void GraphicsContext3D::getBooleanv(GC3Denum paramName, GC3Dboolean* value)
 {
     m_internal->m_glWidget->makeCurrent();
     glGetBooleanv(paramName, value);
 }
 
-void GraphicsContext3D::getBufferParameteriv(unsigned long target, unsigned long paramName, int* value)
+void GraphicsContext3D::getBufferParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->getBufferParameteriv(target, paramName, value);
 }
 
-void GraphicsContext3D::getFloatv(unsigned long paramName, float* value)
+void GraphicsContext3D::getFloatv(GC3Denum paramName, GC3Dfloat* value)
 {
     m_internal->m_glWidget->makeCurrent();
     glGetFloatv(paramName, value);
 }
 
-void GraphicsContext3D::getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long paramName, int* value)
+void GraphicsContext3D::getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->getFramebufferAttachmentParameteriv(target, attachment, paramName, value);
 }
 
-void GraphicsContext3D::getIntegerv(unsigned long paramName, int* value)
+void GraphicsContext3D::getIntegerv(GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
     glGetIntegerv(paramName, value);
 }
 
-void GraphicsContext3D::getProgramiv(Platform3DObject program, unsigned long paramName, int* value)
+void GraphicsContext3D::getProgramiv(Platform3DObject program, GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->getProgramiv((GLuint) program, paramName, value);
+    m_internal->getProgramiv(program, paramName, value);
 }
 
 String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
 {
     m_internal->m_glWidget->makeCurrent();
 
-    GLint length;
-    m_internal->getProgramiv((GLuint) program, GraphicsContext3D::INFO_LOG_LENGTH, &length);
+    GLint length = 0;
+    m_internal->getProgramiv(program, GraphicsContext3D::INFO_LOG_LENGTH, &length);
 
-    GLsizei size;
+    GLsizei size = 0;
 
     GLchar* info = (GLchar*) fastMalloc(length);
     if (!info)
         return "";
 
-    m_internal->getProgramInfoLog((GLuint) program, length, &size, info);
+    m_internal->getProgramInfoLog(program, length, &size, info);
 
     String result(info);
     fastFree(info);
@@ -1412,32 +1412,32 @@ String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
     return result;
 }
 
-void GraphicsContext3D::getRenderbufferParameteriv(unsigned long target, unsigned long paramName, int* value)
+void GraphicsContext3D::getRenderbufferParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->getRenderbufferParameteriv(target, paramName, value);
 }
 
-void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long paramName, int* value)
+void GraphicsContext3D::getShaderiv(Platform3DObject shader, GC3Denum paramName, GC3Dint* value)
 {
     ASSERT(shader);
     m_internal->m_glWidget->makeCurrent();
-    m_internal->getShaderiv((GLuint) shader, paramName, value);
+    m_internal->getShaderiv(shader, paramName, value);
 }
 
 String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
 {
     m_internal->m_glWidget->makeCurrent();
 
-    GLint length;
-    m_internal->getShaderiv((GLuint) shader, GraphicsContext3D::INFO_LOG_LENGTH, &length);
+    GLint length = 0;
+    m_internal->getShaderiv(shader, GraphicsContext3D::INFO_LOG_LENGTH, &length);
 
-    GLsizei size;
+    GLsizei size = 0;
     GLchar* info = (GLchar*) fastMalloc(length);
     if (!info)
         return "";
 
-    m_internal->getShaderInfoLog((GLuint) shader, length, &size, info);
+    m_internal->getShaderInfoLog(shader, length, &size, info);
 
     String result(info);
     fastFree(info);
@@ -1449,15 +1449,15 @@ String GraphicsContext3D::getShaderSource(Platform3DObject shader)
 {
     m_internal->m_glWidget->makeCurrent();
 
-    GLint length;
-    m_internal->getShaderiv((GLuint) shader, GraphicsContext3D::SHADER_SOURCE_LENGTH, &length);
+    GLint length = 0;
+    m_internal->getShaderiv(shader, GraphicsContext3D::SHADER_SOURCE_LENGTH, &length);
 
-    GLsizei size;
+    GLsizei size = 0;
     GLchar* info = (GLchar*) fastMalloc(length);
     if (!info)
         return "";
 
-    m_internal->getShaderSource((GLuint) shader, length, &size, info);
+    m_internal->getShaderSource(shader, length, &size, info);
 
     String result(info);
     fastFree(info);
@@ -1465,28 +1465,28 @@ String GraphicsContext3D::getShaderSource(Platform3DObject shader)
     return result;
 }
 
-void GraphicsContext3D::getTexParameterfv(unsigned long target, unsigned long paramName, float* value)
+void GraphicsContext3D::getTexParameterfv(GC3Denum target, GC3Denum paramName, GC3Dfloat* value)
 {
     m_internal->m_glWidget->makeCurrent();
     glGetTexParameterfv(target, paramName, value);
 }
 
-void GraphicsContext3D::getTexParameteriv(unsigned long target, unsigned long paramName, int* value)
+void GraphicsContext3D::getTexParameteriv(GC3Denum target, GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
     glGetTexParameteriv(target, paramName, value);
 }
 
-void GraphicsContext3D::getUniformfv(Platform3DObject program, long location, float* value)
+void GraphicsContext3D::getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->getUniformfv((GLuint) program, location, value);
+    m_internal->getUniformfv(program, location, value);
 }
 
-void GraphicsContext3D::getUniformiv(Platform3DObject program, long location, int* value)
+void GraphicsContext3D::getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
-    m_internal->getUniformiv((GLuint) program, location, value);
+    m_internal->getUniformiv(program, location, value);
 }
 
 long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
@@ -1494,126 +1494,124 @@ long GraphicsContext3D::getUniformLocation(Platform3DObject program, const Strin
     ASSERT(program);
     
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->getUniformLocation((GLuint) program, name.utf8().data());
+    return m_internal->getUniformLocation(program, name.utf8().data());
 }
 
-void GraphicsContext3D::getVertexAttribfv(unsigned long index, unsigned long paramName, float* value)
+void GraphicsContext3D::getVertexAttribfv(GC3Duint index, GC3Denum paramName, GC3Dfloat* value)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->getVertexAttribfv(index, paramName, value);
 }
 
-void GraphicsContext3D::getVertexAttribiv(unsigned long index, unsigned long paramName, int* value)
+void GraphicsContext3D::getVertexAttribiv(GC3Duint index, GC3Denum paramName, GC3Dint* value)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->getVertexAttribiv(index, paramName, value);
 }
 
-long GraphicsContext3D::getVertexAttribOffset(unsigned long index, unsigned long paramName)
+GC3Dsizeiptr GraphicsContext3D::getVertexAttribOffset(GC3Duint index, GC3Denum paramName)
 {
     m_internal->m_glWidget->makeCurrent();
     
-    void* pointer;
+    GLvoid* pointer = 0;
     m_internal->getVertexAttribPointerv(index, paramName, &pointer);
-    return reinterpret_cast<long>(pointer);
+    return static_cast<GC3Dsizeiptr>(reinterpret_cast<intptr_t>(pointer));
 }
 
-int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
 {
     m_internal->m_glWidget->makeCurrent();
     glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-    return 0;
+    return true;
 }
 
-   
-int GraphicsContext3D::texSubImage2D(unsigned target, unsigned level, unsigned xoff, unsigned yoff, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+void GraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoff, GC3Dint yoff, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels)
 {
     m_internal->m_glWidget->makeCurrent();
     glTexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
-    return 0;
 }
 
-unsigned GraphicsContext3D::createBuffer()
+Platform3DObject GraphicsContext3D::createBuffer()
 {
     m_internal->m_glWidget->makeCurrent();
-    GLuint handle;
+    GLuint handle = 0;
     m_internal->genBuffers(/* count */ 1, &handle);
     return handle;
 }
 
-unsigned GraphicsContext3D::createFramebuffer()
+Platform3DObject GraphicsContext3D::createFramebuffer()
 {
     m_internal->m_glWidget->makeCurrent();
-    GLuint handle;
+    GLuint handle = 0;
     m_internal->genFramebuffers(/* count */ 1, &handle);
     return handle;
 }
 
-unsigned GraphicsContext3D::createProgram()
+Platform3DObject GraphicsContext3D::createProgram()
 {
     m_internal->m_glWidget->makeCurrent();
     return m_internal->createProgram();
 }
 
-unsigned GraphicsContext3D::createRenderbuffer()
+Platform3DObject GraphicsContext3D::createRenderbuffer()
 {
     m_internal->m_glWidget->makeCurrent();
-    GLuint handle;
+    GLuint handle = 0;
     m_internal->genRenderbuffers(/* count */ 1, &handle);
     return handle;
 }
 
-unsigned GraphicsContext3D::createShader(unsigned long type)
+Platform3DObject GraphicsContext3D::createShader(GC3Denum type)
 {
     m_internal->m_glWidget->makeCurrent();
-    return m_internal->createShader((type == FRAGMENT_SHADER) ? GraphicsContext3D::FRAGMENT_SHADER : GraphicsContext3D::VERTEX_SHADER);
+    return m_internal->createShader(type);
 }
 
-unsigned GraphicsContext3D::createTexture()
+Platform3DObject GraphicsContext3D::createTexture()
 {
     m_internal->m_glWidget->makeCurrent();
-    GLuint handle;
+    GLuint handle = 0;
     glGenTextures(1, &handle);
     return handle;
 }
 
-void GraphicsContext3D::deleteBuffer(unsigned buffer)
+void GraphicsContext3D::deleteBuffer(Platform3DObject buffer)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->deleteBuffers(1, &buffer);
 }
 
-void GraphicsContext3D::deleteFramebuffer(unsigned framebuffer)
+void GraphicsContext3D::deleteFramebuffer(Platform3DObject framebuffer)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->deleteFramebuffers(1, &framebuffer);
 }
 
-void GraphicsContext3D::deleteProgram(unsigned program)
+void GraphicsContext3D::deleteProgram(Platform3DObject program)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->deleteProgram(program);
 }
 
-void GraphicsContext3D::deleteRenderbuffer(unsigned renderbuffer)
+void GraphicsContext3D::deleteRenderbuffer(Platform3DObject renderbuffer)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->deleteRenderbuffers(1, &renderbuffer);
 }
 
-void GraphicsContext3D::deleteShader(unsigned shader)
+void GraphicsContext3D::deleteShader(Platform3DObject shader)
 {
     m_internal->m_glWidget->makeCurrent();
     m_internal->deleteShader(shader);
 }
 
-void GraphicsContext3D::deleteTexture(unsigned texture)
+void GraphicsContext3D::deleteTexture(Platform3DObject texture)
 {
     m_internal->m_glWidget->makeCurrent();
     glDeleteTextures(1, &texture);
 }
 
-int GraphicsContext3D::sizeInBytes(int type)
+unsigned int GraphicsContext3D::sizeInBytes(GC3Denum type)
 {
     switch (type) {
     case GraphicsContext3D::BYTE:
@@ -1635,7 +1633,7 @@ int GraphicsContext3D::sizeInBytes(int type)
     }
 }
 
-void GraphicsContext3D::synthesizeGLError(unsigned long error)
+void GraphicsContext3D::synthesizeGLError(GC3Denum error)
 {
     m_internal->m_syntheticErrors.add(error);
 }
@@ -1648,8 +1646,8 @@ Extensions3D* GraphicsContext3D::getExtensions()
 }
 
 bool GraphicsContext3D::getImageData(Image* image,
-                                     unsigned int format,
-                                     unsigned int type,
+                                     GC3Denum format,
+                                     GC3Denum type,
                                      bool premultiplyAlpha,
                                      bool ignoreGammaAndColorProfile,
                                      Vector<uint8_t>& outputVector)
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
index 8b7ac86..c4b753b 100644
--- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
@@ -41,8 +41,8 @@
 namespace WebCore {
 
 bool GraphicsContext3D::getImageData(Image* image,
-                                     unsigned int format,
-                                     unsigned int type,
+                                     GC3Denum format,
+                                     GC3Denum type,
                                      bool premultiplyAlpha,
                                      bool ignoreGammaAndColorProfile,
                                      Vector<uint8_t>& outputVector)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 78d4657..5ae1712 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,34 @@
+2011-01-05  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Define GC3D types to match GL types and use them in GraphicsContext3D
+        https://bugs.webkit.org/show_bug.cgi?id=45557
+
+        * src/GraphicsContext3DChromium.cpp:
+        (WebCore::GraphicsContext3DInternal::bindAttribLocation):
+        (WebCore::GraphicsContext3DInternal::bufferData):
+        (WebCore::GraphicsContext3DInternal::bufferSubData):
+        (WebCore::GraphicsContext3DInternal::getActiveAttrib):
+        (WebCore::GraphicsContext3DInternal::getActiveUniform):
+        (WebCore::GraphicsContext3DInternal::getAttribLocation):
+        (WebCore::GraphicsContext3DInternal::getString):
+        (WebCore::GraphicsContext3DInternal::getUniformLocation):
+        (WebCore::GraphicsContext3DInternal::texImage2D):
+        (WebCore::GraphicsContext3DInternal::texSubImage2D):
+        (WebCore::GraphicsContext3DInternal::uniform1fv):
+        (WebCore::GraphicsContext3DInternal::uniform1iv):
+        (WebCore::GraphicsContext3DInternal::uniform2fv):
+        (WebCore::GraphicsContext3DInternal::uniform2iv):
+        (WebCore::GraphicsContext3DInternal::uniform3fv):
+        (WebCore::GraphicsContext3DInternal::uniform3iv):
+        (WebCore::GraphicsContext3DInternal::uniform4fv):
+        (WebCore::GraphicsContext3DInternal::uniform4iv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix2fv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix3fv):
+        (WebCore::GraphicsContext3DInternal::uniformMatrix4fv):
+        * src/GraphicsContext3DInternal.h:
+
 2011-01-06  James Simonsen  <simonjam at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/WebKit/chromium/src/GraphicsContext3DChromium.cpp
index 08b50c2..686d01c 100644
--- a/WebKit/chromium/src/GraphicsContext3DChromium.cpp
+++ b/WebKit/chromium/src/GraphicsContext3DChromium.cpp
@@ -368,76 +368,76 @@ rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7
 }
 
 DELEGATE_TO_IMPL_R(makeContextCurrent, bool)
-DELEGATE_TO_IMPL_1R(sizeInBytes, int, int)
+DELEGATE_TO_IMPL_1R(sizeInBytes, GC3Denum, unsigned int)
 
 bool GraphicsContext3DInternal::isGLES2Compliant() const
 {
     return m_impl->isGLES2Compliant();
 }
 
-DELEGATE_TO_IMPL_1(activeTexture, unsigned long)
+DELEGATE_TO_IMPL_1(activeTexture, GC3Denum)
 DELEGATE_TO_IMPL_2(attachShader, Platform3DObject, Platform3DObject)
 
-void GraphicsContext3DInternal::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
+void GraphicsContext3DInternal::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
 {
     m_impl->bindAttribLocation(program, index, name.utf8().data());
 }
 
-DELEGATE_TO_IMPL_2(bindBuffer, unsigned long, Platform3DObject)
-DELEGATE_TO_IMPL_2(bindFramebuffer, unsigned long, Platform3DObject)
-DELEGATE_TO_IMPL_2(bindRenderbuffer, unsigned long, Platform3DObject)
-DELEGATE_TO_IMPL_2(bindTexture, unsigned long, Platform3DObject)
-DELEGATE_TO_IMPL_4(blendColor, double, double, double, double)
-DELEGATE_TO_IMPL_1(blendEquation, unsigned long)
-DELEGATE_TO_IMPL_2(blendEquationSeparate, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_2(blendFunc, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_4(blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_2(bindBuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_2(bindFramebuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_2(bindRenderbuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_2(bindTexture, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_4(blendColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_IMPL_1(blendEquation, GC3Denum)
+DELEGATE_TO_IMPL_2(blendEquationSeparate, GC3Denum, GC3Denum)
+DELEGATE_TO_IMPL_2(blendFunc, GC3Denum, GC3Denum)
+DELEGATE_TO_IMPL_4(blendFuncSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
 
-void GraphicsContext3DInternal::bufferData(unsigned long target, int size, unsigned long usage)
+void GraphicsContext3DInternal::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
 {
     m_impl->bufferData(target, size, 0, usage);
 }
 
-void GraphicsContext3DInternal::bufferData(unsigned long target, int size, const void* data, unsigned long usage)
+void GraphicsContext3DInternal::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage)
 {
     m_impl->bufferData(target, size, data, usage);
 }
 
-void GraphicsContext3DInternal::bufferSubData(unsigned long target, long offset, int size, const void* data)
+void GraphicsContext3DInternal::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data)
 {
     m_impl->bufferSubData(target, offset, size, data);
 }
 
-DELEGATE_TO_IMPL_1R(checkFramebufferStatus, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_1(clear, unsigned long)
-DELEGATE_TO_IMPL_4(clearColor, double, double, double, double)
-DELEGATE_TO_IMPL_1(clearDepth, double)
-DELEGATE_TO_IMPL_1(clearStencil, long)
-DELEGATE_TO_IMPL_4(colorMask, bool, bool, bool, bool)
+DELEGATE_TO_IMPL_1R(checkFramebufferStatus, GC3Denum, GC3Denum)
+DELEGATE_TO_IMPL_1(clear, GC3Dbitfield)
+DELEGATE_TO_IMPL_4(clearColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_IMPL_1(clearDepth, GC3Dclampf)
+DELEGATE_TO_IMPL_1(clearStencil, GC3Dint)
+DELEGATE_TO_IMPL_4(colorMask, GC3Dboolean, GC3Dboolean, GC3Dboolean, GC3Dboolean)
 DELEGATE_TO_IMPL_1(compileShader, Platform3DObject)
 
-DELEGATE_TO_IMPL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
-DELEGATE_TO_IMPL_8(copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_1(cullFace, unsigned long)
-DELEGATE_TO_IMPL_1(depthFunc, unsigned long)
-DELEGATE_TO_IMPL_1(depthMask, bool)
-DELEGATE_TO_IMPL_2(depthRange, double, double)
+DELEGATE_TO_IMPL_8(copyTexImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Dint)
+DELEGATE_TO_IMPL_8(copyTexSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_IMPL_1(cullFace, GC3Denum)
+DELEGATE_TO_IMPL_1(depthFunc, GC3Denum)
+DELEGATE_TO_IMPL_1(depthMask, GC3Dboolean)
+DELEGATE_TO_IMPL_2(depthRange, GC3Dclampf, GC3Dclampf)
 DELEGATE_TO_IMPL_2(detachShader, Platform3DObject, Platform3DObject)
-DELEGATE_TO_IMPL_1(disable, unsigned long)
-DELEGATE_TO_IMPL_1(disableVertexAttribArray, unsigned long)
-DELEGATE_TO_IMPL_3(drawArrays, unsigned long, long, long)
-DELEGATE_TO_IMPL_4(drawElements, unsigned long, unsigned long, unsigned long, long)
+DELEGATE_TO_IMPL_1(disable, GC3Denum)
+DELEGATE_TO_IMPL_1(disableVertexAttribArray, GC3Duint)
+DELEGATE_TO_IMPL_3(drawArrays, GC3Denum, GC3Dint, GC3Dsizei)
+DELEGATE_TO_IMPL_4(drawElements, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizeiptr)
 
-DELEGATE_TO_IMPL_1(enable, unsigned long)
-DELEGATE_TO_IMPL_1(enableVertexAttribArray, unsigned long)
+DELEGATE_TO_IMPL_1(enable, GC3Denum)
+DELEGATE_TO_IMPL_1(enableVertexAttribArray, GC3Duint)
 DELEGATE_TO_IMPL(finish)
 DELEGATE_TO_IMPL(flush)
-DELEGATE_TO_IMPL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, Platform3DObject)
-DELEGATE_TO_IMPL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, Platform3DObject, long)
-DELEGATE_TO_IMPL_1(frontFace, unsigned long)
-DELEGATE_TO_IMPL_1(generateMipmap, unsigned long)
+DELEGATE_TO_IMPL_4(framebufferRenderbuffer, GC3Denum, GC3Denum, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_5(framebufferTexture2D, GC3Denum, GC3Denum, GC3Denum, Platform3DObject, GC3Dint)
+DELEGATE_TO_IMPL_1(frontFace, GC3Denum)
+DELEGATE_TO_IMPL_1(generateMipmap, GC3Denum)
 
-bool GraphicsContext3DInternal::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
+bool GraphicsContext3DInternal::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
 {
     WebKit::WebGraphicsContext3D::ActiveInfo webInfo;
     if (!m_impl->getActiveAttrib(program, index, webInfo))
@@ -448,7 +448,7 @@ bool GraphicsContext3DInternal::getActiveAttrib(Platform3DObject program, unsign
     return true;
 }
 
-bool GraphicsContext3DInternal::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
+bool GraphicsContext3DInternal::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
 {
     WebKit::WebGraphicsContext3D::ActiveInfo webInfo;
     if (!m_impl->getActiveUniform(program, index, webInfo))
@@ -459,16 +459,16 @@ bool GraphicsContext3DInternal::getActiveUniform(Platform3DObject program, unsig
     return true;
 }
 
-DELEGATE_TO_IMPL_4(getAttachedShaders, Platform3DObject, int, int*, unsigned int*)
+DELEGATE_TO_IMPL_4(getAttachedShaders, Platform3DObject, GC3Dsizei, GC3Dsizei*, Platform3DObject*)
 
-int GraphicsContext3DInternal::getAttribLocation(Platform3DObject program, const String& name)
+GC3Dint GraphicsContext3DInternal::getAttribLocation(Platform3DObject program, const String& name)
 {
     return m_impl->getAttribLocation(program, name.utf8().data());
 }
 
-DELEGATE_TO_IMPL_2(getBooleanv, unsigned long, unsigned char*)
+DELEGATE_TO_IMPL_2(getBooleanv, GC3Denum, GC3Dboolean*)
 
-DELEGATE_TO_IMPL_3(getBufferParameteriv, unsigned long, unsigned long, int*)
+DELEGATE_TO_IMPL_3(getBufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
 
 GraphicsContext3D::Attributes GraphicsContext3DInternal::getContextAttributes()
 {
@@ -482,24 +482,24 @@ GraphicsContext3D::Attributes GraphicsContext3DInternal::getContextAttributes()
     return attributes;
 }
 
-DELEGATE_TO_IMPL_R(getError, unsigned long)
+DELEGATE_TO_IMPL_R(getError, GC3Denum)
 
-DELEGATE_TO_IMPL_2(getFloatv, unsigned long, float*)
+DELEGATE_TO_IMPL_2(getFloatv, GC3Denum, GC3Dfloat*)
 
-DELEGATE_TO_IMPL_4(getFramebufferAttachmentParameteriv, unsigned long, unsigned long, unsigned long, int*)
+DELEGATE_TO_IMPL_4(getFramebufferAttachmentParameteriv, GC3Denum, GC3Denum, GC3Denum, GC3Dint*)
 
-DELEGATE_TO_IMPL_2(getIntegerv, unsigned long, int*)
+DELEGATE_TO_IMPL_2(getIntegerv, GC3Denum, GC3Dint*)
 
-DELEGATE_TO_IMPL_3(getProgramiv, Platform3DObject, unsigned long, int*)
+DELEGATE_TO_IMPL_3(getProgramiv, Platform3DObject, GC3Denum, GC3Dint*)
 
 String GraphicsContext3DInternal::getProgramInfoLog(Platform3DObject program)
 {
     return m_impl->getProgramInfoLog(program);
 }
 
-DELEGATE_TO_IMPL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*)
+DELEGATE_TO_IMPL_3(getRenderbufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
 
-DELEGATE_TO_IMPL_3(getShaderiv, Platform3DObject, unsigned long, int*)
+DELEGATE_TO_IMPL_3(getShaderiv, Platform3DObject, GC3Denum, GC3Dint*)
 
 String GraphicsContext3DInternal::getShaderInfoLog(Platform3DObject shader)
 {
@@ -511,139 +511,138 @@ String GraphicsContext3DInternal::getShaderSource(Platform3DObject shader)
     return m_impl->getShaderSource(shader);
 }
 
-String GraphicsContext3DInternal::getString(unsigned long name)
+String GraphicsContext3DInternal::getString(GC3Denum name)
 {
     return m_impl->getString(name);
 }
 
-DELEGATE_TO_IMPL_3(getTexParameterfv, unsigned long, unsigned long, float*)
-DELEGATE_TO_IMPL_3(getTexParameteriv, unsigned long, unsigned long, int*)
+DELEGATE_TO_IMPL_3(getTexParameterfv, GC3Denum, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_IMPL_3(getTexParameteriv, GC3Denum, GC3Denum, GC3Dint*)
 
-DELEGATE_TO_IMPL_3(getUniformfv, Platform3DObject, long, float*)
-DELEGATE_TO_IMPL_3(getUniformiv, Platform3DObject, long, int*)
+DELEGATE_TO_IMPL_3(getUniformfv, Platform3DObject, GC3Dint, GC3Dfloat*)
+DELEGATE_TO_IMPL_3(getUniformiv, Platform3DObject, GC3Dint, GC3Dint*)
 
-long GraphicsContext3DInternal::getUniformLocation(Platform3DObject program, const String& name)
+GC3Dint GraphicsContext3DInternal::getUniformLocation(Platform3DObject program, const String& name)
 {
     return m_impl->getUniformLocation(program, name.utf8().data());
 }
 
-DELEGATE_TO_IMPL_3(getVertexAttribfv, unsigned long, unsigned long, float*)
-DELEGATE_TO_IMPL_3(getVertexAttribiv, unsigned long, unsigned long, int*)
+DELEGATE_TO_IMPL_3(getVertexAttribfv, GC3Duint, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_IMPL_3(getVertexAttribiv, GC3Duint, GC3Denum, GC3Dint*)
 
-DELEGATE_TO_IMPL_2R(getVertexAttribOffset, unsigned long, unsigned long, long)
+DELEGATE_TO_IMPL_2R(getVertexAttribOffset, GC3Duint, GC3Denum, GC3Dsizeiptr)
 
-DELEGATE_TO_IMPL_2(hint, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_1R(isBuffer, Platform3DObject, bool)
-DELEGATE_TO_IMPL_1R(isEnabled, unsigned long, bool)
-DELEGATE_TO_IMPL_1R(isFramebuffer, Platform3DObject, bool)
-DELEGATE_TO_IMPL_1R(isProgram, Platform3DObject, bool)
-DELEGATE_TO_IMPL_1R(isRenderbuffer, Platform3DObject, bool)
-DELEGATE_TO_IMPL_1R(isShader, Platform3DObject, bool)
-DELEGATE_TO_IMPL_1R(isTexture, Platform3DObject, bool)
-DELEGATE_TO_IMPL_1(lineWidth, double)
+DELEGATE_TO_IMPL_2(hint, GC3Denum, GC3Denum)
+DELEGATE_TO_IMPL_1R(isBuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_1R(isEnabled, GC3Denum, GC3Dboolean)
+DELEGATE_TO_IMPL_1R(isFramebuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_1R(isProgram, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_1R(isRenderbuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_1R(isShader, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_1R(isTexture, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_1(lineWidth, GC3Dfloat)
 DELEGATE_TO_IMPL_1(linkProgram, Platform3DObject)
-DELEGATE_TO_IMPL_2(pixelStorei, unsigned long, long)
-DELEGATE_TO_IMPL_2(polygonOffset, double, double)
-DELEGATE_TO_IMPL_7(readPixels, long, long, unsigned long, unsigned long, unsigned long, unsigned long, void*)
+DELEGATE_TO_IMPL_2(pixelStorei, GC3Denum, GC3Dint)
+DELEGATE_TO_IMPL_2(polygonOffset, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_IMPL_7(readPixels, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, void*)
 DELEGATE_TO_IMPL(releaseShaderCompiler)
-DELEGATE_TO_IMPL_4(renderbufferStorage, unsigned long, unsigned long, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_2(sampleCoverage, double, bool)
-DELEGATE_TO_IMPL_4(scissor, long, long, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_4(renderbufferStorage, GC3Denum, GC3Denum, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_IMPL_2(sampleCoverage, GC3Dclampf, GC3Dboolean)
+DELEGATE_TO_IMPL_4(scissor, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
 
 void GraphicsContext3DInternal::shaderSource(Platform3DObject shader, const String& string)
 {
     m_impl->shaderSource(shader, string.utf8().data());
 }
 
-DELEGATE_TO_IMPL_3(stencilFunc, unsigned long, long, unsigned long)
-DELEGATE_TO_IMPL_4(stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
-DELEGATE_TO_IMPL_1(stencilMask, unsigned long)
-DELEGATE_TO_IMPL_2(stencilMaskSeparate, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_3(stencilOp, unsigned long, unsigned long, unsigned long)
-DELEGATE_TO_IMPL_4(stencilOpSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
+DELEGATE_TO_IMPL_3(stencilFunc, GC3Denum, GC3Dint, GC3Duint)
+DELEGATE_TO_IMPL_4(stencilFuncSeparate, GC3Denum, GC3Denum, GC3Dint, GC3Duint)
+DELEGATE_TO_IMPL_1(stencilMask, GC3Duint)
+DELEGATE_TO_IMPL_2(stencilMaskSeparate, GC3Denum, GC3Duint)
+DELEGATE_TO_IMPL_3(stencilOp, GC3Denum, GC3Denum, GC3Denum)
+DELEGATE_TO_IMPL_4(stencilOpSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
 
-int GraphicsContext3DInternal::texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels)
+bool GraphicsContext3DInternal::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
 {
     m_impl->texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-    return 0;
+    return true;
 }
 
-DELEGATE_TO_IMPL_3(texParameterf, unsigned, unsigned, float)
-DELEGATE_TO_IMPL_3(texParameteri, unsigned, unsigned, int)
+DELEGATE_TO_IMPL_3(texParameterf, GC3Denum, GC3Denum, GC3Dfloat)
+DELEGATE_TO_IMPL_3(texParameteri, GC3Denum, GC3Denum, GC3Dint)
 
-int GraphicsContext3DInternal::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels)
+void GraphicsContext3DInternal::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels)
 {
     m_impl->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
-    return 0;
 }
 
-DELEGATE_TO_IMPL_2(uniform1f, long, float)
+DELEGATE_TO_IMPL_2(uniform1f, GC3Dint, GC3Dfloat)
 
-void GraphicsContext3DInternal::uniform1fv(long location, float* v, int size)
+void GraphicsContext3DInternal::uniform1fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
 {
     m_impl->uniform1fv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_2(uniform1i, long, int)
+DELEGATE_TO_IMPL_2(uniform1i, GC3Dint, GC3Dint)
 
-void GraphicsContext3DInternal::uniform1iv(long location, int* v, int size)
+void GraphicsContext3DInternal::uniform1iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
 {
     m_impl->uniform1iv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_3(uniform2f, long, float, float)
+DELEGATE_TO_IMPL_3(uniform2f, GC3Dint, GC3Dfloat, GC3Dfloat)
 
-void GraphicsContext3DInternal::uniform2fv(long location, float* v, int size)
+void GraphicsContext3DInternal::uniform2fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
 {
     m_impl->uniform2fv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_3(uniform2i, long, int, int)
+DELEGATE_TO_IMPL_3(uniform2i, GC3Dint, GC3Dint, GC3Dint)
 
-void GraphicsContext3DInternal::uniform2iv(long location, int* v, int size)
+void GraphicsContext3DInternal::uniform2iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
 {
     m_impl->uniform2iv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_4(uniform3f, long, float, float, float)
+DELEGATE_TO_IMPL_4(uniform3f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
 
-void GraphicsContext3DInternal::uniform3fv(long location, float* v, int size)
+void GraphicsContext3DInternal::uniform3fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
 {
     m_impl->uniform3fv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_4(uniform3i, long, int, int, int)
+DELEGATE_TO_IMPL_4(uniform3i, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
 
-void GraphicsContext3DInternal::uniform3iv(long location, int* v, int size)
+void GraphicsContext3DInternal::uniform3iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
 {
     m_impl->uniform3iv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_5(uniform4f, long, float, float, float, float)
+DELEGATE_TO_IMPL_5(uniform4f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
 
-void GraphicsContext3DInternal::uniform4fv(long location, float* v, int size)
+void GraphicsContext3DInternal::uniform4fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size)
 {
     m_impl->uniform4fv(location, size, v);
 }
 
-DELEGATE_TO_IMPL_5(uniform4i, long, int, int, int, int)
+DELEGATE_TO_IMPL_5(uniform4i, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
 
-void GraphicsContext3DInternal::uniform4iv(long location, int* v, int size)
+void GraphicsContext3DInternal::uniform4iv(GC3Dint location, GC3Dint* v, GC3Dsizei size)
 {
     m_impl->uniform4iv(location, size, v);
 }
 
-void GraphicsContext3DInternal::uniformMatrix2fv(long location, bool transpose, float* value, int size)
+void GraphicsContext3DInternal::uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size)
 {
     m_impl->uniformMatrix2fv(location, size, transpose, value);
 }
 
-void GraphicsContext3DInternal::uniformMatrix3fv(long location, bool transpose, float* value, int size)
+void GraphicsContext3DInternal::uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size)
 {
     m_impl->uniformMatrix3fv(location, size, transpose, value);
 }
 
-void GraphicsContext3DInternal::uniformMatrix4fv(long location, bool transpose, float* value, int size)
+void GraphicsContext3DInternal::uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size)
 {
     m_impl->uniformMatrix4fv(location, size, transpose, value);
 }
@@ -651,33 +650,33 @@ void GraphicsContext3DInternal::uniformMatrix4fv(long location, bool transpose,
 DELEGATE_TO_IMPL_1(useProgram, Platform3DObject)
 DELEGATE_TO_IMPL_1(validateProgram, Platform3DObject)
 
-DELEGATE_TO_IMPL_2(vertexAttrib1f, unsigned long, float)
-DELEGATE_TO_IMPL_2(vertexAttrib1fv, unsigned long, float*)
-DELEGATE_TO_IMPL_3(vertexAttrib2f, unsigned long, float, float)
-DELEGATE_TO_IMPL_2(vertexAttrib2fv, unsigned long, float*)
-DELEGATE_TO_IMPL_4(vertexAttrib3f, unsigned long, float, float, float)
-DELEGATE_TO_IMPL_2(vertexAttrib3fv, unsigned long, float*)
-DELEGATE_TO_IMPL_5(vertexAttrib4f, unsigned long, float, float, float, float)
-DELEGATE_TO_IMPL_2(vertexAttrib4fv, unsigned long, float*)
-DELEGATE_TO_IMPL_6(vertexAttribPointer, unsigned long, int, int, bool, unsigned long, unsigned long)
-
-DELEGATE_TO_IMPL_4(viewport, long, long, unsigned long, unsigned long)
-
-DELEGATE_TO_IMPL_R(createBuffer, unsigned)
-DELEGATE_TO_IMPL_R(createFramebuffer, unsigned)
-DELEGATE_TO_IMPL_R(createProgram, unsigned)
-DELEGATE_TO_IMPL_R(createRenderbuffer, unsigned)
-DELEGATE_TO_IMPL_1R(createShader, unsigned long, unsigned)
-DELEGATE_TO_IMPL_R(createTexture, unsigned)
-
-DELEGATE_TO_IMPL_1(deleteBuffer, unsigned)
-DELEGATE_TO_IMPL_1(deleteFramebuffer, unsigned)
-DELEGATE_TO_IMPL_1(deleteProgram, unsigned)
-DELEGATE_TO_IMPL_1(deleteRenderbuffer, unsigned)
-DELEGATE_TO_IMPL_1(deleteShader, unsigned)
-DELEGATE_TO_IMPL_1(deleteTexture, unsigned)
-
-DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long)
+DELEGATE_TO_IMPL_2(vertexAttrib1f, GC3Duint, GC3Dfloat)
+DELEGATE_TO_IMPL_2(vertexAttrib1fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_IMPL_3(vertexAttrib2f, GC3Duint, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_IMPL_2(vertexAttrib2fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_IMPL_4(vertexAttrib3f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_IMPL_2(vertexAttrib3fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_IMPL_5(vertexAttrib4f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_IMPL_2(vertexAttrib4fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_IMPL_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dsizeiptr)
+
+DELEGATE_TO_IMPL_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
+
+DELEGATE_TO_IMPL_R(createBuffer, Platform3DObject)
+DELEGATE_TO_IMPL_R(createFramebuffer, Platform3DObject)
+DELEGATE_TO_IMPL_R(createProgram, Platform3DObject)
+DELEGATE_TO_IMPL_R(createRenderbuffer, Platform3DObject)
+DELEGATE_TO_IMPL_1R(createShader, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_R(createTexture, Platform3DObject)
+
+DELEGATE_TO_IMPL_1(deleteBuffer, Platform3DObject)
+DELEGATE_TO_IMPL_1(deleteFramebuffer, Platform3DObject)
+DELEGATE_TO_IMPL_1(deleteProgram, Platform3DObject)
+DELEGATE_TO_IMPL_1(deleteRenderbuffer, Platform3DObject)
+DELEGATE_TO_IMPL_1(deleteShader, Platform3DObject)
+DELEGATE_TO_IMPL_1(deleteTexture, Platform3DObject)
+
+DELEGATE_TO_IMPL_1(synthesizeGLError, GC3Denum)
 
 Extensions3D* GraphicsContext3DInternal::getExtensions()
 {
@@ -736,11 +735,11 @@ bool GraphicsContext3DInternal::ensureExtensionEnabled(const String& name)
     return m_enabledExtensions.contains(name);
 }
 
-DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*)
+DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, GC3Denum, GC3Dsizeiptr, GC3Dsizei, GC3Denum, void*)
 DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*)
-DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*)
+DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Denum, void*)
 DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*)
-DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned)
+DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, Platform3DObject, Platform3DObject)
 
 //----------------------------------------------------------------------
 // GraphicsContext3D
@@ -845,6 +844,12 @@ void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8
     m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8);      \
 }
 
+#define DELEGATE_TO_INTERNAL_9(name, t1, t2, t3, t4, t5, t6, t7, t8, t9) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
+{ \
+    m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8, a9);   \
+}
+
 #define DELEGATE_TO_INTERNAL_9R(name, t1, t2, t3, t4, t5, t6, t7, t8, t9, rt) \
 rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
 { \
@@ -895,170 +900,150 @@ PlatformLayer* GraphicsContext3D::platformLayer() const
 #endif
 
 DELEGATE_TO_INTERNAL(makeContextCurrent)
-DELEGATE_TO_INTERNAL_1R(sizeInBytes, int, int)
+DELEGATE_TO_INTERNAL_1R(sizeInBytes, GC3Denum, unsigned int)
 DELEGATE_TO_INTERNAL_2(reshape, int, int)
 DELEGATE_TO_INTERNAL_R(getInternalFramebufferSize, IntSize)
 
-DELEGATE_TO_INTERNAL_1(activeTexture, unsigned long)
+DELEGATE_TO_INTERNAL_1(activeTexture, GC3Denum)
 DELEGATE_TO_INTERNAL_2(attachShader, Platform3DObject, Platform3DObject)
-DELEGATE_TO_INTERNAL_3(bindAttribLocation, Platform3DObject, unsigned long, const String&)
-
-DELEGATE_TO_INTERNAL_2(bindBuffer, unsigned long, Platform3DObject)
-DELEGATE_TO_INTERNAL_2(bindFramebuffer, unsigned long, Platform3DObject)
-DELEGATE_TO_INTERNAL_2(bindRenderbuffer, unsigned long, Platform3DObject)
-DELEGATE_TO_INTERNAL_2(bindTexture, unsigned long, Platform3DObject)
-DELEGATE_TO_INTERNAL_4(blendColor, double, double, double, double)
-DELEGATE_TO_INTERNAL_1(blendEquation, unsigned long)
-DELEGATE_TO_INTERNAL_2(blendEquationSeparate, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_2(blendFunc, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_4(blendFuncSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
-
-DELEGATE_TO_INTERNAL_3(bufferData, unsigned long, int, unsigned long)
-DELEGATE_TO_INTERNAL_4(bufferData, unsigned long, int, const void*, unsigned long)
-DELEGATE_TO_INTERNAL_4(bufferSubData, unsigned long, long, int, const void*)
-
-DELEGATE_TO_INTERNAL_1R(checkFramebufferStatus, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_1(clear, unsigned long)
-DELEGATE_TO_INTERNAL_4(clearColor, double, double, double, double)
-DELEGATE_TO_INTERNAL_1(clearDepth, double)
-DELEGATE_TO_INTERNAL_1(clearStencil, long)
-DELEGATE_TO_INTERNAL_4(colorMask, bool, bool, bool, bool)
+DELEGATE_TO_INTERNAL_3(bindAttribLocation, Platform3DObject, GC3Duint, const String&)
+
+DELEGATE_TO_INTERNAL_2(bindBuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_INTERNAL_2(bindFramebuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_INTERNAL_2(bindRenderbuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_INTERNAL_2(bindTexture, GC3Denum, Platform3DObject)
+DELEGATE_TO_INTERNAL_4(blendColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_INTERNAL_1(blendEquation, GC3Denum)
+DELEGATE_TO_INTERNAL_2(blendEquationSeparate, GC3Denum, GC3Denum)
+DELEGATE_TO_INTERNAL_2(blendFunc, GC3Denum, GC3Denum)
+DELEGATE_TO_INTERNAL_4(blendFuncSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
+
+DELEGATE_TO_INTERNAL_3(bufferData, GC3Denum, GC3Dsizeiptr, GC3Denum)
+DELEGATE_TO_INTERNAL_4(bufferData, GC3Denum, GC3Dsizeiptr, const void*, GC3Denum)
+DELEGATE_TO_INTERNAL_4(bufferSubData, GC3Denum, GC3Dintptr, GC3Dsizeiptr, const void*)
+
+DELEGATE_TO_INTERNAL_1R(checkFramebufferStatus, GC3Denum, GC3Denum)
+DELEGATE_TO_INTERNAL_1(clear, GC3Dbitfield)
+DELEGATE_TO_INTERNAL_4(clearColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_INTERNAL_1(clearDepth, GC3Dclampf)
+DELEGATE_TO_INTERNAL_1(clearStencil, GC3Dint)
+DELEGATE_TO_INTERNAL_4(colorMask, GC3Dboolean, GC3Dboolean, GC3Dboolean, GC3Dboolean)
 DELEGATE_TO_INTERNAL_1(compileShader, Platform3DObject)
 
-DELEGATE_TO_INTERNAL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
-DELEGATE_TO_INTERNAL_8(copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_1(cullFace, unsigned long)
-DELEGATE_TO_INTERNAL_1(depthFunc, unsigned long)
-DELEGATE_TO_INTERNAL_1(depthMask, bool)
-DELEGATE_TO_INTERNAL_2(depthRange, double, double)
+DELEGATE_TO_INTERNAL_8(copyTexImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Dint)
+DELEGATE_TO_INTERNAL_8(copyTexSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_INTERNAL_1(cullFace, GC3Denum)
+DELEGATE_TO_INTERNAL_1(depthFunc, GC3Denum)
+DELEGATE_TO_INTERNAL_1(depthMask, GC3Dboolean)
+DELEGATE_TO_INTERNAL_2(depthRange, GC3Dclampf, GC3Dclampf)
 DELEGATE_TO_INTERNAL_2(detachShader, Platform3DObject, Platform3DObject)
-DELEGATE_TO_INTERNAL_1(disable, unsigned long)
-DELEGATE_TO_INTERNAL_1(disableVertexAttribArray, unsigned long)
-DELEGATE_TO_INTERNAL_3(drawArrays, unsigned long, long, long)
-DELEGATE_TO_INTERNAL_4(drawElements, unsigned long, unsigned long, unsigned long, long)
+DELEGATE_TO_INTERNAL_1(disable, GC3Denum)
+DELEGATE_TO_INTERNAL_1(disableVertexAttribArray, GC3Duint)
+DELEGATE_TO_INTERNAL_3(drawArrays, GC3Denum, GC3Dint, GC3Dsizei)
+DELEGATE_TO_INTERNAL_4(drawElements, GC3Denum, GC3Dsizei, GC3Denum, GC3Dintptr)
 
-DELEGATE_TO_INTERNAL_1(enable, unsigned long)
-DELEGATE_TO_INTERNAL_1(enableVertexAttribArray, unsigned long)
+DELEGATE_TO_INTERNAL_1(enable, GC3Denum)
+DELEGATE_TO_INTERNAL_1(enableVertexAttribArray, GC3Duint)
 DELEGATE_TO_INTERNAL(finish)
 DELEGATE_TO_INTERNAL(flush)
-DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, Platform3DObject)
-DELEGATE_TO_INTERNAL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, Platform3DObject, long)
-DELEGATE_TO_INTERNAL_1(frontFace, unsigned long)
-DELEGATE_TO_INTERNAL_1(generateMipmap, unsigned long)
-
-DELEGATE_TO_INTERNAL_3R(getActiveAttrib, Platform3DObject, unsigned long, ActiveInfo&, bool)
-DELEGATE_TO_INTERNAL_3R(getActiveUniform, Platform3DObject, unsigned long, ActiveInfo&, bool)
-
-DELEGATE_TO_INTERNAL_4(getAttachedShaders, Platform3DObject, int, int*, unsigned int*)
-
-DELEGATE_TO_INTERNAL_2R(getAttribLocation, Platform3DObject, const String&, int)
-
-DELEGATE_TO_INTERNAL_2(getBooleanv, unsigned long, unsigned char*)
-
-DELEGATE_TO_INTERNAL_3(getBufferParameteriv, unsigned long, unsigned long, int*)
-
+DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, GC3Denum, GC3Denum, GC3Denum, Platform3DObject)
+DELEGATE_TO_INTERNAL_5(framebufferTexture2D, GC3Denum, GC3Denum, GC3Denum, Platform3DObject, GC3Dint)
+DELEGATE_TO_INTERNAL_1(frontFace, GC3Denum)
+DELEGATE_TO_INTERNAL_1(generateMipmap, GC3Denum)
+
+DELEGATE_TO_INTERNAL_3R(getActiveAttrib, Platform3DObject, GC3Duint, ActiveInfo&, bool)
+DELEGATE_TO_INTERNAL_3R(getActiveUniform, Platform3DObject, GC3Duint, ActiveInfo&, bool)
+DELEGATE_TO_INTERNAL_4(getAttachedShaders, Platform3DObject, GC3Dsizei, GC3Dsizei*, Platform3DObject*)
+DELEGATE_TO_INTERNAL_2R(getAttribLocation, Platform3DObject, const String&, GC3Dint)
+DELEGATE_TO_INTERNAL_2(getBooleanv, GC3Denum, GC3Dboolean*)
+DELEGATE_TO_INTERNAL_3(getBufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
 DELEGATE_TO_INTERNAL_R(getContextAttributes, GraphicsContext3D::Attributes)
-
-DELEGATE_TO_INTERNAL_R(getError, unsigned long)
-
-DELEGATE_TO_INTERNAL_2(getFloatv, unsigned long, float*)
-
-DELEGATE_TO_INTERNAL_4(getFramebufferAttachmentParameteriv, unsigned long, unsigned long, unsigned long, int*)
-
-DELEGATE_TO_INTERNAL_2(getIntegerv, unsigned long, int*)
-
-DELEGATE_TO_INTERNAL_3(getProgramiv, Platform3DObject, unsigned long, int*)
-
+DELEGATE_TO_INTERNAL_R(getError, GC3Denum)
+DELEGATE_TO_INTERNAL_2(getFloatv, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_4(getFramebufferAttachmentParameteriv, GC3Denum, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_INTERNAL_2(getIntegerv, GC3Denum, GC3Dint*)
+DELEGATE_TO_INTERNAL_3(getProgramiv, Platform3DObject, GC3Denum, GC3Dint*)
 DELEGATE_TO_INTERNAL_1R(getProgramInfoLog, Platform3DObject, String)
-
-DELEGATE_TO_INTERNAL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*)
-
-DELEGATE_TO_INTERNAL_3(getShaderiv, Platform3DObject, unsigned long, int*)
-
+DELEGATE_TO_INTERNAL_3(getRenderbufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_INTERNAL_3(getShaderiv, Platform3DObject, GC3Denum, GC3Dint*)
 DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, Platform3DObject, String)
-
 DELEGATE_TO_INTERNAL_1R(getShaderSource, Platform3DObject, String)
-DELEGATE_TO_INTERNAL_1R(getString, unsigned long, String)
-
-DELEGATE_TO_INTERNAL_3(getTexParameterfv, unsigned long, unsigned long, float*)
-DELEGATE_TO_INTERNAL_3(getTexParameteriv, unsigned long, unsigned long, int*)
-
-DELEGATE_TO_INTERNAL_3(getUniformfv, Platform3DObject, long, float*)
-DELEGATE_TO_INTERNAL_3(getUniformiv, Platform3DObject, long, int*)
-
-DELEGATE_TO_INTERNAL_2R(getUniformLocation, Platform3DObject, const String&, long)
-
-DELEGATE_TO_INTERNAL_3(getVertexAttribfv, unsigned long, unsigned long, float*)
-DELEGATE_TO_INTERNAL_3(getVertexAttribiv, unsigned long, unsigned long, int*)
-
-DELEGATE_TO_INTERNAL_2R(getVertexAttribOffset, unsigned long, unsigned long, long)
-
-DELEGATE_TO_INTERNAL_2(hint, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_1R(isBuffer, Platform3DObject, bool)
-DELEGATE_TO_INTERNAL_1R(isEnabled, unsigned long, bool)
-DELEGATE_TO_INTERNAL_1R(isFramebuffer, Platform3DObject, bool)
-DELEGATE_TO_INTERNAL_1R(isProgram, Platform3DObject, bool)
-DELEGATE_TO_INTERNAL_1R(isRenderbuffer, Platform3DObject, bool)
-DELEGATE_TO_INTERNAL_1R(isShader, Platform3DObject, bool)
-DELEGATE_TO_INTERNAL_1R(isTexture, Platform3DObject, bool)
-DELEGATE_TO_INTERNAL_1(lineWidth, double)
+DELEGATE_TO_INTERNAL_1R(getString, GC3Denum, String)
+DELEGATE_TO_INTERNAL_3(getTexParameterfv, GC3Denum, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_3(getTexParameteriv, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_INTERNAL_3(getUniformfv, Platform3DObject, GC3Dint, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_3(getUniformiv, Platform3DObject, GC3Dint, GC3Dint*)
+DELEGATE_TO_INTERNAL_2R(getUniformLocation, Platform3DObject, const String&, GC3Dint)
+DELEGATE_TO_INTERNAL_3(getVertexAttribfv, GC3Duint, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_3(getVertexAttribiv, GC3Duint, GC3Denum, GC3Dint*)
+DELEGATE_TO_INTERNAL_2R(getVertexAttribOffset, GC3Duint, GC3Denum, GC3Dsizeiptr)
+
+DELEGATE_TO_INTERNAL_2(hint, GC3Denum, GC3Denum)
+DELEGATE_TO_INTERNAL_1R(isBuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1R(isEnabled, GC3Denum, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1R(isFramebuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1R(isProgram, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1R(isRenderbuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1R(isShader, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1R(isTexture, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_INTERNAL_1(lineWidth, GC3Dfloat)
 DELEGATE_TO_INTERNAL_1(linkProgram, Platform3DObject)
-DELEGATE_TO_INTERNAL_2(pixelStorei, unsigned long, long)
-DELEGATE_TO_INTERNAL_2(polygonOffset, double, double)
+DELEGATE_TO_INTERNAL_2(pixelStorei, GC3Denum, GC3Dint)
+DELEGATE_TO_INTERNAL_2(polygonOffset, GC3Dfloat, GC3Dfloat)
 
-DELEGATE_TO_INTERNAL_7(readPixels, long, long, unsigned long, unsigned long, unsigned long, unsigned long, void*)
+DELEGATE_TO_INTERNAL_7(readPixels, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, void*)
 
 DELEGATE_TO_INTERNAL(releaseShaderCompiler)
-DELEGATE_TO_INTERNAL_4(renderbufferStorage, unsigned long, unsigned long, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_2(sampleCoverage, double, bool)
-DELEGATE_TO_INTERNAL_4(scissor, long, long, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_4(renderbufferStorage, GC3Denum, GC3Denum, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_INTERNAL_2(sampleCoverage, GC3Dclampf, GC3Dboolean)
+DELEGATE_TO_INTERNAL_4(scissor, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
 DELEGATE_TO_INTERNAL_2(shaderSource, Platform3DObject, const String&)
-DELEGATE_TO_INTERNAL_3(stencilFunc, unsigned long, long, unsigned long)
-DELEGATE_TO_INTERNAL_4(stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
-DELEGATE_TO_INTERNAL_1(stencilMask, unsigned long)
-DELEGATE_TO_INTERNAL_2(stencilMaskSeparate, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_3(stencilOp, unsigned long, unsigned long, unsigned long)
-DELEGATE_TO_INTERNAL_4(stencilOpSeparate, unsigned long, unsigned long, unsigned long, unsigned long)
-
-DELEGATE_TO_INTERNAL_9R(texImage2D, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, void*, int)
-DELEGATE_TO_INTERNAL_3(texParameterf, unsigned, unsigned, float)
-DELEGATE_TO_INTERNAL_3(texParameteri, unsigned, unsigned, int)
-DELEGATE_TO_INTERNAL_9R(texSubImage2D, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, void*, int)
-
-DELEGATE_TO_INTERNAL_2(uniform1f, long, float)
-DELEGATE_TO_INTERNAL_3(uniform1fv, long, float*, int)
-DELEGATE_TO_INTERNAL_2(uniform1i, long, int)
-DELEGATE_TO_INTERNAL_3(uniform1iv, long, int*, int)
-DELEGATE_TO_INTERNAL_3(uniform2f, long, float, float)
-DELEGATE_TO_INTERNAL_3(uniform2fv, long, float*, int)
-DELEGATE_TO_INTERNAL_3(uniform2i, long, int, int)
-DELEGATE_TO_INTERNAL_3(uniform2iv, long, int*, int)
-DELEGATE_TO_INTERNAL_4(uniform3f, long, float, float, float)
-DELEGATE_TO_INTERNAL_3(uniform3fv, long, float*, int)
-DELEGATE_TO_INTERNAL_4(uniform3i, long, int, int, int)
-DELEGATE_TO_INTERNAL_3(uniform3iv, long, int*, int)
-DELEGATE_TO_INTERNAL_5(uniform4f, long, float, float, float, float)
-DELEGATE_TO_INTERNAL_3(uniform4fv, long, float*, int)
-DELEGATE_TO_INTERNAL_5(uniform4i, long, int, int, int, int)
-DELEGATE_TO_INTERNAL_3(uniform4iv, long, int*, int)
-DELEGATE_TO_INTERNAL_4(uniformMatrix2fv, long, bool, float*, int)
-DELEGATE_TO_INTERNAL_4(uniformMatrix3fv, long, bool, float*, int)
-DELEGATE_TO_INTERNAL_4(uniformMatrix4fv, long, bool, float*, int)
+DELEGATE_TO_INTERNAL_3(stencilFunc, GC3Denum, GC3Dint, GC3Duint)
+DELEGATE_TO_INTERNAL_4(stencilFuncSeparate, GC3Denum, GC3Denum, GC3Dint, GC3Duint)
+DELEGATE_TO_INTERNAL_1(stencilMask, GC3Duint)
+DELEGATE_TO_INTERNAL_2(stencilMaskSeparate, GC3Denum, GC3Duint)
+DELEGATE_TO_INTERNAL_3(stencilOp, GC3Denum, GC3Denum, GC3Denum)
+DELEGATE_TO_INTERNAL_4(stencilOpSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
+
+DELEGATE_TO_INTERNAL_9R(texImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dsizei, GC3Dsizei, GC3Dint, GC3Denum, GC3Denum, const void*, bool)
+DELEGATE_TO_INTERNAL_3(texParameterf, GC3Denum, GC3Denum, GC3Dfloat)
+DELEGATE_TO_INTERNAL_3(texParameteri, GC3Denum, GC3Denum, GC3Dint)
+DELEGATE_TO_INTERNAL_9(texSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, const void*)
+
+DELEGATE_TO_INTERNAL_2(uniform1f, GC3Dint, GC3Dfloat)
+DELEGATE_TO_INTERNAL_3(uniform1fv, GC3Dint, GC3Dfloat*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_2(uniform1i, GC3Dint, GC3Dint)
+DELEGATE_TO_INTERNAL_3(uniform1iv, GC3Dint, GC3Dint*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_3(uniform2f, GC3Dint, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_INTERNAL_3(uniform2fv, GC3Dint, GC3Dfloat*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_3(uniform2i, GC3Dint, GC3Dint, GC3Dint)
+DELEGATE_TO_INTERNAL_3(uniform2iv, GC3Dint, GC3Dint*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_4(uniform3f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_INTERNAL_3(uniform3fv, GC3Dint, GC3Dfloat*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_4(uniform3i, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
+DELEGATE_TO_INTERNAL_3(uniform3iv, GC3Dint, GC3Dint*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_5(uniform4f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_INTERNAL_3(uniform4fv, GC3Dint, GC3Dfloat*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_5(uniform4i, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
+DELEGATE_TO_INTERNAL_3(uniform4iv, GC3Dint, GC3Dint*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_4(uniformMatrix2fv, GC3Dint, GC3Dboolean, GC3Dfloat*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_4(uniformMatrix3fv, GC3Dint, GC3Dboolean, GC3Dfloat*, GC3Dsizei)
+DELEGATE_TO_INTERNAL_4(uniformMatrix4fv, GC3Dint, GC3Dboolean, GC3Dfloat*, GC3Dsizei)
 
 DELEGATE_TO_INTERNAL_1(useProgram, Platform3DObject)
 DELEGATE_TO_INTERNAL_1(validateProgram, Platform3DObject)
 
-DELEGATE_TO_INTERNAL_2(vertexAttrib1f, unsigned long, float)
-DELEGATE_TO_INTERNAL_2(vertexAttrib1fv, unsigned long, float*)
-DELEGATE_TO_INTERNAL_3(vertexAttrib2f, unsigned long, float, float)
-DELEGATE_TO_INTERNAL_2(vertexAttrib2fv, unsigned long, float*)
-DELEGATE_TO_INTERNAL_4(vertexAttrib3f, unsigned long, float, float, float)
-DELEGATE_TO_INTERNAL_2(vertexAttrib3fv, unsigned long, float*)
-DELEGATE_TO_INTERNAL_5(vertexAttrib4f, unsigned long, float, float, float, float)
-DELEGATE_TO_INTERNAL_2(vertexAttrib4fv, unsigned long, float*)
-DELEGATE_TO_INTERNAL_6(vertexAttribPointer, unsigned long, int, int, bool, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_2(vertexAttrib1f, GC3Duint, GC3Dfloat)
+DELEGATE_TO_INTERNAL_2(vertexAttrib1fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_3(vertexAttrib2f, GC3Duint, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_INTERNAL_2(vertexAttrib2fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_4(vertexAttrib3f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_INTERNAL_2(vertexAttrib3fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_5(vertexAttrib4f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_INTERNAL_2(vertexAttrib4fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_INTERNAL_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr)
 
-DELEGATE_TO_INTERNAL_4(viewport, long, long, unsigned long, unsigned long)
+DELEGATE_TO_INTERNAL_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
 
 DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, CanvasRenderingContext*)
 
@@ -1067,21 +1052,21 @@ bool GraphicsContext3D::paintsIntoCanvasBuffer() const
     return m_internal->paintsIntoCanvasBuffer();
 }
 
-DELEGATE_TO_INTERNAL_R(createBuffer, unsigned)
-DELEGATE_TO_INTERNAL_R(createFramebuffer, unsigned)
-DELEGATE_TO_INTERNAL_R(createProgram, unsigned)
-DELEGATE_TO_INTERNAL_R(createRenderbuffer, unsigned)
-DELEGATE_TO_INTERNAL_1R(createShader, unsigned long, unsigned)
-DELEGATE_TO_INTERNAL_R(createTexture, unsigned)
+DELEGATE_TO_INTERNAL_R(createBuffer, Platform3DObject)
+DELEGATE_TO_INTERNAL_R(createFramebuffer, Platform3DObject)
+DELEGATE_TO_INTERNAL_R(createProgram, Platform3DObject)
+DELEGATE_TO_INTERNAL_R(createRenderbuffer, Platform3DObject)
+DELEGATE_TO_INTERNAL_1R(createShader, GC3Denum, Platform3DObject)
+DELEGATE_TO_INTERNAL_R(createTexture, Platform3DObject)
 
-DELEGATE_TO_INTERNAL_1(deleteBuffer, unsigned)
-DELEGATE_TO_INTERNAL_1(deleteFramebuffer, unsigned)
-DELEGATE_TO_INTERNAL_1(deleteProgram, unsigned)
-DELEGATE_TO_INTERNAL_1(deleteRenderbuffer, unsigned)
-DELEGATE_TO_INTERNAL_1(deleteShader, unsigned)
-DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned)
+DELEGATE_TO_INTERNAL_1(deleteBuffer, Platform3DObject)
+DELEGATE_TO_INTERNAL_1(deleteFramebuffer, Platform3DObject)
+DELEGATE_TO_INTERNAL_1(deleteProgram, Platform3DObject)
+DELEGATE_TO_INTERNAL_1(deleteRenderbuffer, Platform3DObject)
+DELEGATE_TO_INTERNAL_1(deleteShader, Platform3DObject)
+DELEGATE_TO_INTERNAL_1(deleteTexture, Platform3DObject)
 
-DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long)
+DELEGATE_TO_INTERNAL_1(synthesizeGLError, GC3Denum)
 DELEGATE_TO_INTERNAL_R(getExtensions, Extensions3D*)
 
 bool GraphicsContext3D::isGLES2Compliant() const
diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h
index 05165a3..30a8e57 100644
--- a/WebKit/chromium/src/GraphicsContext3DInternal.h
+++ b/WebKit/chromium/src/GraphicsContext3DInternal.h
@@ -62,7 +62,7 @@ public:
 
     bool makeContextCurrent();
 
-    int sizeInBytes(int type);
+    unsigned int sizeInBytes(GC3Denum type);
 
     void reshape(int width, int height);
     IntSize getInternalFramebufferSize();
@@ -77,191 +77,169 @@ public:
 #endif
     bool isGLES2Compliant() const;
 
+    void releaseShaderCompiler();
+    bool isContextLost();
+
     //----------------------------------------------------------------------
     // Entry points for WebGL.
     //
-    void activeTexture(unsigned long texture);
+    void activeTexture(GC3Denum texture);
     void attachShader(Platform3DObject program, Platform3DObject shader);
-    void bindAttribLocation(Platform3DObject, unsigned long index, const String& name);
-    void bindBuffer(unsigned long target, Platform3DObject);
-    void bindFramebuffer(unsigned long target, Platform3DObject);
-    void bindRenderbuffer(unsigned long target, Platform3DObject);
-    void bindTexture(unsigned long target, Platform3DObject texture);
-    void blendColor(double red, double green, double blue, double alpha);
-    void blendEquation(unsigned long mode);
-    void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha);
-    void blendFunc(unsigned long sfactor, unsigned long dfactor);
-    void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha);
-
-    void bufferData(unsigned long target, int size, unsigned long usage);
-    void bufferData(unsigned long target, int size, const void* data, unsigned long usage);
-    void bufferSubData(unsigned long target, long offset, int size, const void* data);
-
-    unsigned long checkFramebufferStatus(unsigned long target);
-    void clear(unsigned long mask);
-    void clearColor(double red, double green, double blue, double alpha);
-    void clearDepth(double depth);
-    void clearStencil(long s);
-    void colorMask(bool red, bool green, bool blue, bool alpha);
+    void bindAttribLocation(Platform3DObject, GC3Duint index, const String& name);
+    void bindBuffer(GC3Denum target, Platform3DObject);
+    void bindFramebuffer(GC3Denum target, Platform3DObject);
+    void bindRenderbuffer(GC3Denum target, Platform3DObject);
+    void bindTexture(GC3Denum target, Platform3DObject);
+    void blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
+    void blendEquation(GC3Denum mode);
+    void blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha);
+    void blendFunc(GC3Denum sfactor, GC3Denum dfactor);
+    void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha);
+
+    void bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage);
+    void bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage);
+    void bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data);
+
+    GC3Denum checkFramebufferStatus(GC3Denum target);
+    void clear(GC3Dbitfield mask);
+    void clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
+    void clearDepth(GC3Dclampf depth);
+    void clearStencil(GC3Dint s);
+    void colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha);
     void compileShader(Platform3DObject);
 
-    void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
-    void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height);
-    void cullFace(unsigned long mode);
-    void depthFunc(unsigned long func);
-    void depthMask(bool flag);
-    void depthRange(double zNear, double zFar);
+    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border);
+    void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
+    void cullFace(GC3Denum mode);
+    void depthFunc(GC3Denum func);
+    void depthMask(GC3Dboolean flag);
+    void depthRange(GC3Dclampf zNear, GC3Dclampf zFar);
     void detachShader(Platform3DObject, Platform3DObject);
-    void disable(unsigned long cap);
-    void disableVertexAttribArray(unsigned long index);
-    void drawArrays(unsigned long mode, long first, long count);
-    void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset);
+    void disable(GC3Denum cap);
+    void disableVertexAttribArray(GC3Duint index);
+    void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count);
+    void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset);
 
-    void enable(unsigned long cap);
-    void enableVertexAttribArray(unsigned long index);
+    void enable(GC3Denum cap);
+    void enableVertexAttribArray(GC3Duint index);
     void finish();
     void flush();
-    void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject);
-    void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level);
-    void frontFace(unsigned long mode);
-    void generateMipmap(unsigned long target);
-
-    bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&);
-    bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&);
-
-    void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders);
-
-    int getAttribLocation(Platform3DObject, const String& name);
-
-    void getBooleanv(unsigned long pname, unsigned char* value);
-
-    void getBufferParameteriv(unsigned long target, unsigned long pname, int* value);
-
+    void framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject);
+    void framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject, GC3Dint level);
+    void frontFace(GC3Denum mode);
+    void generateMipmap(GC3Denum target);
+
+    bool getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo&);
+    bool getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo&);
+    void getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders);
+    GC3Dint getAttribLocation(Platform3DObject, const String& name);
+    void getBooleanv(GC3Denum pname, GC3Dboolean* value);
+    void getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
     GraphicsContext3D::Attributes getContextAttributes();
-
-    unsigned long getError();
-
-    bool isContextLost();
-
-    void getFloatv(unsigned long pname, float* value);
-
-    void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value);
-
-    void getIntegerv(unsigned long pname, int* value);
-
-    void getProgramiv(Platform3DObject program, unsigned long pname, int* value);
-
+    GC3Denum getError();
+    void getFloatv(GC3Denum pname, GC3Dfloat* value);
+    void getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value);
+    void getIntegerv(GC3Denum pname, GC3Dint* value);
+    void getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value);
     String getProgramInfoLog(Platform3DObject);
-
-    void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
-
-    void getShaderiv(Platform3DObject, unsigned long pname, int* value);
-
+    void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
     String getShaderInfoLog(Platform3DObject);
 
     String getShaderSource(Platform3DObject);
-    String getString(unsigned long name);
-
-    void getTexParameterfv(unsigned long target, unsigned long pname, float* value);
-    void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
-
-    void getUniformfv(Platform3DObject program, long location, float* value);
-    void getUniformiv(Platform3DObject program, long location, int* value);
-
-    long getUniformLocation(Platform3DObject, const String& name);
-
-    void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
-    void getVertexAttribiv(unsigned long index, unsigned long pname, int* value);
-
-    long getVertexAttribOffset(unsigned long index, unsigned long pname);
-
-    void hint(unsigned long target, unsigned long mode);
-    bool isBuffer(Platform3DObject);
-    bool isEnabled(unsigned long cap);
-    bool isFramebuffer(Platform3DObject);
-    bool isProgram(Platform3DObject);
-    bool isRenderbuffer(Platform3DObject);
-    bool isShader(Platform3DObject);
-    bool isTexture(Platform3DObject);
-    void lineWidth(double);
+    String getString(GC3Denum name);
+    void getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value);
+    void getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    void getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value);
+    void getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value);
+    GC3Dint getUniformLocation(Platform3DObject, const String& name);
+    void getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value);
+    void getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value);
+    GC3Dsizeiptr getVertexAttribOffset(GC3Duint index, GC3Denum pname);
+
+    void hint(GC3Denum target, GC3Denum mode);
+    GC3Dboolean isBuffer(Platform3DObject);
+    GC3Dboolean isEnabled(GC3Denum cap);
+    GC3Dboolean isFramebuffer(Platform3DObject);
+    GC3Dboolean isProgram(Platform3DObject);
+    GC3Dboolean isRenderbuffer(Platform3DObject);
+    GC3Dboolean isShader(Platform3DObject);
+    GC3Dboolean isTexture(Platform3DObject);
+    void lineWidth(GC3Dfloat);
     void linkProgram(Platform3DObject);
-    void pixelStorei(unsigned long pname, long param);
-    void polygonOffset(double factor, double units);
+    void pixelStorei(GC3Denum pname, GC3Dint param);
+    void polygonOffset(GC3Dfloat factor, GC3Dfloat units);
 
-    void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data);
+    void readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
 
-    void releaseShaderCompiler();
-    void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height);
-    void sampleCoverage(double value, bool invert);
-    void scissor(long x, long y, unsigned long width, unsigned long height);
+    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
+    void sampleCoverage(GC3Dclampf value, GC3Dboolean invert);
+    void scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
     void shaderSource(Platform3DObject, const String& string);
-    void stencilFunc(unsigned long func, long ref, unsigned long mask);
-    void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
-    void stencilMask(unsigned long mask);
-    void stencilMaskSeparate(unsigned long face, unsigned long mask);
-    void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass);
-    void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass);
-
-    // These next several functions return an error code (0 if no errors) rather than using an ExceptionCode.
-    // Currently they return -1 on any error.
-    int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels);
-
-    void texParameterf(unsigned target, unsigned pname, float param);
-    void texParameteri(unsigned target, unsigned pname, int param);
-
-    int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels);
-
-    void uniform1f(long location, float x);
-    void uniform1fv(long location, float* v, int size);
-    void uniform1i(long location, int x);
-    void uniform1iv(long location, int* v, int size);
-    void uniform2f(long location, float x, float y);
-    void uniform2fv(long location, float* v, int size);
-    void uniform2i(long location, int x, int y);
-    void uniform2iv(long location, int* v, int size);
-    void uniform3f(long location, float x, float y, float z);
-    void uniform3fv(long location, float* v, int size);
-    void uniform3i(long location, int x, int y, int z);
-    void uniform3iv(long location, int* v, int size);
-    void uniform4f(long location, float x, float y, float z, float w);
-    void uniform4fv(long location, float* v, int size);
-    void uniform4i(long location, int x, int y, int z, int w);
-    void uniform4iv(long location, int* v, int size);
-    void uniformMatrix2fv(long location, bool transpose, float* value, int size);
-    void uniformMatrix3fv(long location, bool transpose, float* value, int size);
-    void uniformMatrix4fv(long location, bool transpose, float* value, int size);
+    void stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask);
+    void stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask);
+    void stencilMask(GC3Duint mask);
+    void stencilMaskSeparate(GC3Denum face, GC3Duint mask);
+    void stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
+    void stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
+
+    // texImage2D return false on any error rather than using an ExceptionCode.
+    bool texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
+    void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
+    void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels);
+
+    void uniform1f(GC3Dint location, GC3Dfloat x);
+    void uniform1fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform1i(GC3Dint location, GC3Dint x);
+    void uniform1iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniform2f(GC3Dint location, GC3Dfloat x, float y);
+    void uniform2fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform2i(GC3Dint location, GC3Dint x, GC3Dint y);
+    void uniform2iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
+    void uniform3fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z);
+    void uniform3iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
+    void uniform4fv(GC3Dint location, GC3Dfloat* v, GC3Dsizei size);
+    void uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w);
+    void uniform4iv(GC3Dint location, GC3Dint* v, GC3Dsizei size);
+    void uniformMatrix2fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
+    void uniformMatrix3fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
+    void uniformMatrix4fv(GC3Dint location, GC3Dboolean transpose, GC3Dfloat* value, GC3Dsizei size);
 
     void useProgram(Platform3DObject);
     void validateProgram(Platform3DObject);
 
-    void vertexAttrib1f(unsigned long indx, float x);
-    void vertexAttrib1fv(unsigned long indx, float* values);
-    void vertexAttrib2f(unsigned long indx, float x, float y);
-    void vertexAttrib2fv(unsigned long indx, float* values);
-    void vertexAttrib3f(unsigned long indx, float x, float y, float z);
-    void vertexAttrib3fv(unsigned long indx, float* values);
-    void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w);
-    void vertexAttrib4fv(unsigned long indx, float* values);
-    void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized,
-                             unsigned long stride, unsigned long offset);
-
-    void viewport(long x, long y, unsigned long width, unsigned long height);
-
-    unsigned createBuffer();
-    unsigned createFramebuffer();
-    unsigned createProgram();
-    unsigned createRenderbuffer();
-    unsigned createShader(unsigned long);
-    unsigned createTexture();
-
-    void deleteBuffer(unsigned);
-    void deleteFramebuffer(unsigned);
-    void deleteProgram(unsigned);
-    void deleteRenderbuffer(unsigned);
-    void deleteShader(unsigned);
-    void deleteTexture(unsigned);
-
-    void synthesizeGLError(unsigned long error);
+    void vertexAttrib1f(GC3Duint index, GC3Dfloat x);
+    void vertexAttrib1fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y);
+    void vertexAttrib2fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
+    void vertexAttrib3fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
+    void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized,
+                             GC3Dsizei stride, GC3Dintptr offset);
+
+    void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
+
+    Platform3DObject createBuffer();
+    Platform3DObject createFramebuffer();
+    Platform3DObject createProgram();
+    Platform3DObject createRenderbuffer();
+    Platform3DObject createShader(GC3Denum);
+    Platform3DObject createTexture();
+
+    void deleteBuffer(Platform3DObject);
+    void deleteFramebuffer(Platform3DObject);
+    void deleteProgram(Platform3DObject);
+    void deleteRenderbuffer(Platform3DObject);
+    void deleteShader(Platform3DObject);
+    void deleteTexture(Platform3DObject);
+
+    void synthesizeGLError(GC3Denum error);
 
     // Extensions3D support.
     Extensions3D* getExtensions();
@@ -273,14 +251,14 @@ public:
 
     // GL_CHROMIUM_map_sub
     bool supportsMapSubCHROMIUM();
-    void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+    void* mapBufferSubDataCHROMIUM(GC3Denum target, GC3Dsizeiptr offset, GC3Dsizei size, GC3Denum access);
     void unmapBufferSubDataCHROMIUM(const void*);
-    void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+    void* mapTexSubImage2DCHROMIUM(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, GC3Denum access);
     void unmapTexSubImage2DCHROMIUM(const void*);
 
     // GL_CHROMIUM_copy_texture_to_parent_texture
     bool supportsCopyTextureToParentTextureCHROMIUM();
-    void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
+    void copyTextureToParentTextureCHROMIUM(Platform3DObject texture, Platform3DObject parentTexture);
 
 private:
     OwnPtr<WebKit::WebGraphicsContext3D> m_impl;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list