Changeset 64582 in webkit


Ignore:
Timestamp:
Aug 3, 2010 12:47:46 PM (14 years ago)
Author:
jamesr@google.com
Message:

2010-08-03 James Robinson <jamesr@chromium.org>

Reviewed by Darin Fisher.

Move WebGL-specific code out of GraphicsContext3D so that G3D can be used as a generic accelerated drawing API
https://bugs.webkit.org/show_bug.cgi?id=43221

Implements functions in term of Platform3DObjects instead of WebGL types.

  • src/GraphicsContext3D.cpp: (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): (WebCore::GraphicsContext3DInternal::beginPaint): (WebCore::GraphicsContext3DInternal::bindAttribLocation): (WebCore::GraphicsContext3DInternal::getActiveAttrib): (WebCore::GraphicsContext3DInternal::getActiveUniform): (WebCore::GraphicsContext3DInternal::getAttribLocation): (WebCore::GraphicsContext3DInternal::getProgramInfoLog): (WebCore::GraphicsContext3DInternal::getShaderInfoLog): (WebCore::GraphicsContext3DInternal::getShaderSource): (WebCore::GraphicsContext3DInternal::getUniformLocation): (WebCore::GraphicsContext3DInternal::shaderSource):

2010-08-03 James Robinson <jamesr@chromium.org>

Reviewed by Darin Fisher.

Move WebGL-specific code out of GraphicsContext3D so that G3D can be used as a generic accelerated drawing API
https://bugs.webkit.org/show_bug.cgi?id=43221

Changes the GraphicsContext3D API to use Platform3DObjects instead of WebGLFoo* types like WebGLTexture.
WebGLRenderingContext still uses WebGLFoo types and converts to Platform3DObjects internally. Other
consumers of the GraphicsContext3D can use the Platform3DObject APIs directly without any ties to WebGL.

The majority of this change is purely mechanical. The less obvious changes are:

  • move all null checking on WebGLFoo types to WebGLRenderingContext, instead of mixing them between WebGLRenderingContext and the various port-specific implementations of GraphicsContext3D
  • add a GraphicsContext3D getter to CanvasRenderingContext. This is needed for the readback path on Chromium/mac. It may be possible to remove this, but I would prefer to do that in a follow-up patch to minimize churn.
  • move some texture cube map logic that existed only in the Chromium port of GC3D to WebGLRenderingContext behind #if PLATFORM(CHROMIUM). I think this logic should either exist for all ports or exist for none, but again I would rather change the behavior in a different patch from this one.
  • html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::graphicsContext3D):
  • html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::cacheActiveAttribLocations):
  • html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::attachShader): (WebCore::WebGLRenderingContext::bindAttribLocation): (WebCore::WebGLRenderingContext::bindBuffer): (WebCore::WebGLRenderingContext::bindFramebuffer): (WebCore::WebGLRenderingContext::bindRenderbuffer): (WebCore::WebGLRenderingContext::bindTexture): (WebCore::WebGLRenderingContext::compileShader): (WebCore::WebGLRenderingContext::detachShader): (WebCore::WebGLRenderingContext::framebufferRenderbuffer): (WebCore::WebGLRenderingContext::framebufferTexture2D): (WebCore::WebGLRenderingContext::getActiveAttrib): (WebCore::WebGLRenderingContext::getActiveUniform): (WebCore::WebGLRenderingContext::getAttachedShaders): (WebCore::WebGLRenderingContext::getAttribLocation): (WebCore::WebGLRenderingContext::getProgramParameter): (WebCore::WebGLRenderingContext::getProgramInfoLog): (WebCore::WebGLRenderingContext::getShaderParameter): (WebCore::WebGLRenderingContext::getShaderInfoLog): (WebCore::WebGLRenderingContext::getShaderSource): (WebCore::WebGLRenderingContext::getUniform): (WebCore::WebGLRenderingContext::getUniformLocation): (WebCore::WebGLRenderingContext::isBuffer): (WebCore::WebGLRenderingContext::isFramebuffer): (WebCore::WebGLRenderingContext::isProgram): (WebCore::WebGLRenderingContext::isRenderbuffer): (WebCore::WebGLRenderingContext::isShader): (WebCore::WebGLRenderingContext::isTexture): (WebCore::WebGLRenderingContext::linkProgram): (WebCore::WebGLRenderingContext::shaderSource): (WebCore::WebGLRenderingContext::useProgram): (WebCore::WebGLRenderingContext::validateProgram): (WebCore::WebGLRenderingContext::handleNPOTTextures): (WebCore::WebGLRenderingContext::createFallbackBlackTextures1x1): (WebCore::WebGLRenderingContext::initVertexAttrib0): (WebCore::WebGLRenderingContext::simulateVertexAttrib0): (WebCore::WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation):
  • html/canvas/WebGLRenderingContext.h: (WebCore::WebGLRenderingContext::graphicsContext3D):
  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): (WebCore::GraphicsContext3D::beginPaint): (WebCore::GraphicsContext3D::attachShader): (WebCore::GraphicsContext3D::bindAttribLocation): (WebCore::GraphicsContext3D::bindBuffer): (WebCore::GraphicsContext3D::bindFramebuffer): (WebCore::GraphicsContext3D::bindRenderbuffer): (WebCore::GraphicsContext3D::bindTexture): (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::detachShader): (WebCore::GraphicsContext3D::framebufferRenderbuffer): (WebCore::GraphicsContext3D::framebufferTexture2D): (WebCore::GraphicsContext3D::getActiveAttrib): (WebCore::GraphicsContext3D::getActiveUniform): (WebCore::GraphicsContext3D::getAttachedShaders): (WebCore::GraphicsContext3D::getAttribLocation): (WebCore::GraphicsContext3D::isBuffer): (WebCore::GraphicsContext3D::isFramebuffer): (WebCore::GraphicsContext3D::isProgram): (WebCore::GraphicsContext3D::isRenderbuffer): (WebCore::GraphicsContext3D::isShader): (WebCore::GraphicsContext3D::isTexture): (WebCore::GraphicsContext3D::linkProgram): (WebCore::GraphicsContext3D::shaderSource): (WebCore::GraphicsContext3D::useProgram): (WebCore::GraphicsContext3D::validateProgram): (WebCore::GraphicsContext3D::getProgramiv): (WebCore::GraphicsContext3D::getProgramInfoLog): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): (WebCore::GraphicsContext3D::getUniformfv): (WebCore::GraphicsContext3D::getUniformiv): (WebCore::GraphicsContext3D::getUniformLocation):
  • platform/graphics/qt/GraphicsContext3DQt.cpp: (WebCore::GraphicsContext3D::beginPaint): (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): (WebCore::GraphicsContext3D::attachShader): (WebCore::GraphicsContext3D::bindAttribLocation): (WebCore::GraphicsContext3D::bindBuffer): (WebCore::GraphicsContext3D::bindFramebuffer): (WebCore::GraphicsContext3D::bindRenderbuffer): (WebCore::GraphicsContext3D::bindTexture): (WebCore::GraphicsContext3D::compileShader): (WebCore::GraphicsContext3D::detachShader): (WebCore::GraphicsContext3D::framebufferRenderbuffer): (WebCore::GraphicsContext3D::framebufferTexture2D): (WebCore::GraphicsContext3D::getActiveAttrib): (WebCore::GraphicsContext3D::getActiveUniform): (WebCore::GraphicsContext3D::getAttribLocation): (WebCore::GraphicsContext3D::isBuffer): (WebCore::GraphicsContext3D::isFramebuffer): (WebCore::GraphicsContext3D::isProgram): (WebCore::GraphicsContext3D::isRenderbuffer): (WebCore::GraphicsContext3D::isShader): (WebCore::GraphicsContext3D::isTexture): (WebCore::GraphicsContext3D::linkProgram): (WebCore::GraphicsContext3D::shaderSource): (WebCore::GraphicsContext3D::useProgram): (WebCore::GraphicsContext3D::validateProgram): (WebCore::GraphicsContext3D::getProgramiv): (WebCore::GraphicsContext3D::getProgramInfoLog): (WebCore::GraphicsContext3D::getShaderiv): (WebCore::GraphicsContext3D::getShaderInfoLog): (WebCore::GraphicsContext3D::getShaderSource): (WebCore::GraphicsContext3D::getUniformfv): (WebCore::GraphicsContext3D::getUniformiv): (WebCore::GraphicsContext3D::getUniformLocation):
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64580 r64582  
     12010-08-03  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Move WebGL-specific code out of GraphicsContext3D so that G3D can be used as a generic accelerated drawing API
     6        https://bugs.webkit.org/show_bug.cgi?id=43221
     7
     8        Changes the GraphicsContext3D API to use Platform3DObjects instead of WebGLFoo* types like WebGLTexture.
     9        WebGLRenderingContext still uses WebGLFoo types and converts to Platform3DObjects internally.  Other
     10        consumers of the GraphicsContext3D can use the Platform3DObject APIs directly without any ties to WebGL.
     11
     12        The majority of this change is purely mechanical.  The less obvious changes are:
     13        - move all null checking on WebGLFoo types to WebGLRenderingContext, instead of mixing them
     14          between WebGLRenderingContext and the various port-specific implementations of GraphicsContext3D
     15        - add a GraphicsContext3D getter to CanvasRenderingContext.  This is needed for the readback
     16          path on Chromium/mac.  It may be possible to remove this, but I would prefer to do that
     17          in a follow-up patch to minimize churn.
     18        - move some texture cube map logic that existed only in the Chromium port of GC3D to
     19          WebGLRenderingContext behind #if PLATFORM(CHROMIUM). I think this logic should either
     20          exist for all ports or exist for none, but again I would rather change the behavior
     21          in a different patch from this one.
     22
     23        * html/canvas/CanvasRenderingContext.h:
     24        (WebCore::CanvasRenderingContext::graphicsContext3D):
     25        * html/canvas/WebGLProgram.cpp:
     26        (WebCore::WebGLProgram::cacheActiveAttribLocations):
     27        * html/canvas/WebGLRenderingContext.cpp:
     28        (WebCore::WebGLRenderingContext::attachShader):
     29        (WebCore::WebGLRenderingContext::bindAttribLocation):
     30        (WebCore::WebGLRenderingContext::bindBuffer):
     31        (WebCore::WebGLRenderingContext::bindFramebuffer):
     32        (WebCore::WebGLRenderingContext::bindRenderbuffer):
     33        (WebCore::WebGLRenderingContext::bindTexture):
     34        (WebCore::WebGLRenderingContext::compileShader):
     35        (WebCore::WebGLRenderingContext::detachShader):
     36        (WebCore::WebGLRenderingContext::framebufferRenderbuffer):
     37        (WebCore::WebGLRenderingContext::framebufferTexture2D):
     38        (WebCore::WebGLRenderingContext::getActiveAttrib):
     39        (WebCore::WebGLRenderingContext::getActiveUniform):
     40        (WebCore::WebGLRenderingContext::getAttachedShaders):
     41        (WebCore::WebGLRenderingContext::getAttribLocation):
     42        (WebCore::WebGLRenderingContext::getProgramParameter):
     43        (WebCore::WebGLRenderingContext::getProgramInfoLog):
     44        (WebCore::WebGLRenderingContext::getShaderParameter):
     45        (WebCore::WebGLRenderingContext::getShaderInfoLog):
     46        (WebCore::WebGLRenderingContext::getShaderSource):
     47        (WebCore::WebGLRenderingContext::getUniform):
     48        (WebCore::WebGLRenderingContext::getUniformLocation):
     49        (WebCore::WebGLRenderingContext::isBuffer):
     50        (WebCore::WebGLRenderingContext::isFramebuffer):
     51        (WebCore::WebGLRenderingContext::isProgram):
     52        (WebCore::WebGLRenderingContext::isRenderbuffer):
     53        (WebCore::WebGLRenderingContext::isShader):
     54        (WebCore::WebGLRenderingContext::isTexture):
     55        (WebCore::WebGLRenderingContext::linkProgram):
     56        (WebCore::WebGLRenderingContext::shaderSource):
     57        (WebCore::WebGLRenderingContext::useProgram):
     58        (WebCore::WebGLRenderingContext::validateProgram):
     59        (WebCore::WebGLRenderingContext::handleNPOTTextures):
     60        (WebCore::WebGLRenderingContext::createFallbackBlackTextures1x1):
     61        (WebCore::WebGLRenderingContext::initVertexAttrib0):
     62        (WebCore::WebGLRenderingContext::simulateVertexAttrib0):
     63        (WebCore::WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation):
     64        * html/canvas/WebGLRenderingContext.h:
     65        (WebCore::WebGLRenderingContext::graphicsContext3D):
     66        * platform/graphics/GraphicsContext3D.h:
     67        * platform/graphics/mac/GraphicsContext3DMac.mm:
     68        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
     69        (WebCore::GraphicsContext3D::beginPaint):
     70        (WebCore::GraphicsContext3D::attachShader):
     71        (WebCore::GraphicsContext3D::bindAttribLocation):
     72        (WebCore::GraphicsContext3D::bindBuffer):
     73        (WebCore::GraphicsContext3D::bindFramebuffer):
     74        (WebCore::GraphicsContext3D::bindRenderbuffer):
     75        (WebCore::GraphicsContext3D::bindTexture):
     76        (WebCore::GraphicsContext3D::compileShader):
     77        (WebCore::GraphicsContext3D::detachShader):
     78        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
     79        (WebCore::GraphicsContext3D::framebufferTexture2D):
     80        (WebCore::GraphicsContext3D::getActiveAttrib):
     81        (WebCore::GraphicsContext3D::getActiveUniform):
     82        (WebCore::GraphicsContext3D::getAttachedShaders):
     83        (WebCore::GraphicsContext3D::getAttribLocation):
     84        (WebCore::GraphicsContext3D::isBuffer):
     85        (WebCore::GraphicsContext3D::isFramebuffer):
     86        (WebCore::GraphicsContext3D::isProgram):
     87        (WebCore::GraphicsContext3D::isRenderbuffer):
     88        (WebCore::GraphicsContext3D::isShader):
     89        (WebCore::GraphicsContext3D::isTexture):
     90        (WebCore::GraphicsContext3D::linkProgram):
     91        (WebCore::GraphicsContext3D::shaderSource):
     92        (WebCore::GraphicsContext3D::useProgram):
     93        (WebCore::GraphicsContext3D::validateProgram):
     94        (WebCore::GraphicsContext3D::getProgramiv):
     95        (WebCore::GraphicsContext3D::getProgramInfoLog):
     96        (WebCore::GraphicsContext3D::getShaderiv):
     97        (WebCore::GraphicsContext3D::getShaderInfoLog):
     98        (WebCore::GraphicsContext3D::getShaderSource):
     99        (WebCore::GraphicsContext3D::getUniformfv):
     100        (WebCore::GraphicsContext3D::getUniformiv):
     101        (WebCore::GraphicsContext3D::getUniformLocation):
     102        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     103        (WebCore::GraphicsContext3D::beginPaint):
     104        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
     105        (WebCore::GraphicsContext3D::attachShader):
     106        (WebCore::GraphicsContext3D::bindAttribLocation):
     107        (WebCore::GraphicsContext3D::bindBuffer):
     108        (WebCore::GraphicsContext3D::bindFramebuffer):
     109        (WebCore::GraphicsContext3D::bindRenderbuffer):
     110        (WebCore::GraphicsContext3D::bindTexture):
     111        (WebCore::GraphicsContext3D::compileShader):
     112        (WebCore::GraphicsContext3D::detachShader):
     113        (WebCore::GraphicsContext3D::framebufferRenderbuffer):
     114        (WebCore::GraphicsContext3D::framebufferTexture2D):
     115        (WebCore::GraphicsContext3D::getActiveAttrib):
     116        (WebCore::GraphicsContext3D::getActiveUniform):
     117        (WebCore::GraphicsContext3D::getAttribLocation):
     118        (WebCore::GraphicsContext3D::isBuffer):
     119        (WebCore::GraphicsContext3D::isFramebuffer):
     120        (WebCore::GraphicsContext3D::isProgram):
     121        (WebCore::GraphicsContext3D::isRenderbuffer):
     122        (WebCore::GraphicsContext3D::isShader):
     123        (WebCore::GraphicsContext3D::isTexture):
     124        (WebCore::GraphicsContext3D::linkProgram):
     125        (WebCore::GraphicsContext3D::shaderSource):
     126        (WebCore::GraphicsContext3D::useProgram):
     127        (WebCore::GraphicsContext3D::validateProgram):
     128        (WebCore::GraphicsContext3D::getProgramiv):
     129        (WebCore::GraphicsContext3D::getProgramInfoLog):
     130        (WebCore::GraphicsContext3D::getShaderiv):
     131        (WebCore::GraphicsContext3D::getShaderInfoLog):
     132        (WebCore::GraphicsContext3D::getShaderSource):
     133        (WebCore::GraphicsContext3D::getUniformfv):
     134        (WebCore::GraphicsContext3D::getUniformiv):
     135        (WebCore::GraphicsContext3D::getUniformLocation):
     136
    11372010-08-03  Xan Lopez  <xlopez@igalia.com>
    2138
  • trunk/WebCore/html/canvas/CanvasRenderingContext.h

    r64308 r64582  
    3232
    3333    class CanvasObject;
     34    class GraphicsContext3D;
    3435    class HTMLCanvasElement;
    3536
     
    4849        virtual bool is3d() const { return false; }
    4950        virtual bool isAccelerated() const { return false; }
     51       
     52        // For accelerated canvases, returns a pointer to the underlying GraphicsContext3D.
     53        // For non accelerated canvases returns 0.
     54        virtual GraphicsContext3D* graphicsContext3D() const { return 0; }
    5055
    5156    private:
  • trunk/WebCore/html/canvas/WebGLProgram.cpp

    r62396 r64582  
    5757    GraphicsContext3D* context3d = context()->graphicsContext3D();
    5858    int linkStatus;
    59     context3d->getProgramiv(this, GraphicsContext3D::LINK_STATUS, &linkStatus);
     59    context3d->getProgramiv(object(), GraphicsContext3D::LINK_STATUS, &linkStatus);
    6060    if (!linkStatus)
    6161        return false;
    6262
    6363    int numAttribs = 0;
    64     context3d->getProgramiv(this, GraphicsContext3D::ACTIVE_ATTRIBUTES, &numAttribs);
     64    context3d->getProgramiv(object(), GraphicsContext3D::ACTIVE_ATTRIBUTES, &numAttribs);
    6565    m_activeAttribLocations.resize(static_cast<size_t>(numAttribs));
    6666    for (int i = 0; i < numAttribs; ++i) {
    6767        ActiveInfo info;
    68         context3d->getActiveAttrib(this, i, info);
    69         m_activeAttribLocations[i] = context3d->getAttribLocation(this, info.name.charactersWithNullTermination());
     68        context3d->getActiveAttrib(object(), i, info);
     69        m_activeAttribLocations[i] = context3d->getAttribLocation(object(), info.name.charactersWithNullTermination());
    7070    }
    7171
  • trunk/WebCore/html/canvas/WebGLRenderingContext.cpp

    r63923 r64582  
    221221    if (!validateWebGLObject(program) || !validateWebGLObject(shader))
    222222        return;
    223     m_context->attachShader(program, shader);
     223    m_context->attachShader(program ? program->object() : 0, shader ? shader->object() : 0);
    224224    cleanupAfterGraphicsCall(false);
    225225}
     
    230230    if (!validateWebGLObject(program))
    231231        return;
    232     m_context->bindAttribLocation(program, index, name);
     232    m_context->bindAttribLocation(program ? program->object() : 0, index, name);
    233233    cleanupAfterGraphicsCall(false);
    234234}
     
    255255    }
    256256
    257     m_context->bindBuffer(target, buffer);
     257    m_context->bindBuffer(target, buffer ? buffer->object() : 0);
    258258    if (buffer)
    259259        buffer->setTarget(target);
     
    274274    }
    275275    m_framebufferBinding = buffer;
    276     m_context->bindFramebuffer(target, buffer);
     276    m_context->bindFramebuffer(target, buffer ? buffer->object() : 0);
    277277    if (m_framebufferBinding)
    278278        m_framebufferBinding->onBind();
     
    292292    }
    293293    m_renderbufferBinding = renderBuffer;
    294     m_context->bindRenderbuffer(target, renderBuffer);
     294    m_context->bindRenderbuffer(target, renderBuffer ? renderBuffer->object() : 0);
    295295    cleanupAfterGraphicsCall(false);
    296296}
     
    315315        return;
    316316    }
    317     m_context->bindTexture(target, texture);
     317    m_context->bindTexture(target, texture ? texture->object() : 0);
    318318    if (!isGLES2Compliant() && texture)
    319319        texture->setTarget(target, maxLevel);
     320
     321    // FIXME: do we want to do this on all platforms?
     322#if PLATFORM(CHROMIUM)
     323    // FIXME: GL_TEXTURE_WRAP_R isn't exposed in the OpenGL ES 2.0
     324    // API. On desktop OpenGL implementations it seems necessary to
     325    // set this wrap mode to GL_CLAMP_TO_EDGE to get correct behavior
     326    // of cube maps.
     327    if (texture) {
     328        if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) {
     329            if (!texture->isCubeMapRWrapModeInitialized()) {
     330                static const int textureWrapR = 0x8072;
     331                texParameteri(GraphicsContext3D::TEXTURE_CUBE_MAP, textureWrapR, GraphicsContext3D::CLAMP_TO_EDGE);
     332                texture->setCubeMapRWrapModeInitialized(true);
     333            }
     334        } else
     335            texture->setCubeMapRWrapModeInitialized(false);
     336    }
     337#endif
     338
    320339    cleanupAfterGraphicsCall(false);
    321340}
     
    498517    if (!validateWebGLObject(shader))
    499518        return;
    500     m_context->compileShader(shader);
     519    m_context->compileShader(shader ? shader->object() : 0);
    501520    cleanupAfterGraphicsCall(false);
    502521}
     
    688707    if (!validateWebGLObject(program) || !validateWebGLObject(shader))
    689708        return;
    690     m_context->detachShader(program, shader);
     709    m_context->detachShader(program ? program->object() : 0, shader ? shader->object() : 0);
    691710    cleanupAfterGraphicsCall(false);
    692711}
     
    10571076        }
    10581077    }
    1059     m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, buffer);
     1078    m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, buffer ? buffer->object() : 0);
    10601079    m_framebufferBinding->setAttachment(attachment, buffer);
    10611080    cleanupAfterGraphicsCall(false);
     
    10821101        return;
    10831102    }
    1084     m_context->framebufferTexture2D(target, attachment, textarget, texture, level);
     1103    m_context->framebufferTexture2D(target, attachment, textarget, texture ? texture->object() : 0, level);
    10851104    m_framebufferBinding->setAttachment(attachment, texture);
    10861105    cleanupAfterGraphicsCall(false);
     
    11201139    if (!validateWebGLObject(program))
    11211140        return 0;
    1122     if (!m_context->getActiveAttrib(program, index, info)) {
     1141    if (!m_context->getActiveAttrib(program ? program->object() : 0, index, info)) {
    11231142        return 0;
    11241143    }
     
    11321151    if (!validateWebGLObject(program))
    11331152        return 0;
    1134     if (!m_context->getActiveUniform(program, index, info)) {
     1153    if (!m_context->getActiveUniform(program ? program->object() : 0, index, info)) {
    11351154        return 0;
    11361155    }
     
    11491168        return false;
    11501169    int numShaders = 0;
    1151     m_context->getProgramiv(program, GraphicsContext3D::ATTACHED_SHADERS, &numShaders);
     1170    m_context->getProgramiv(program ? program->object() : 0, GraphicsContext3D::ATTACHED_SHADERS, &numShaders);
    11521171    if (numShaders) {
    11531172        OwnArrayPtr<unsigned int> shaders(new unsigned int[numShaders]);
    11541173        int count;
    1155         m_context->getAttachedShaders(program, numShaders, &count, shaders.get());
     1174        m_context->getAttachedShaders(program ? program->object() : 0, numShaders, &count, shaders.get());
    11561175        if (count != numShaders)
    11571176            return false;
     
    11711190int WebGLRenderingContext::getAttribLocation(WebGLProgram* program, const String& name)
    11721191{
    1173     return m_context->getAttribLocation(program, name);
     1192    return m_context->getAttribLocation(program ? program->object() : 0, name);
    11741193}
    11751194
     
    14491468    case GraphicsContext3D::DELETE_STATUS:
    14501469    case GraphicsContext3D::VALIDATE_STATUS:
    1451         m_context->getProgramiv(program, pname, &value);
     1470        m_context->getProgramiv(program ? program->object() : 0, pname, &value);
    14521471        return WebGLGetInfo(static_cast<bool>(value));
    14531472    case GraphicsContext3D::LINK_STATUS:
    14541473        if (program->isLinkFailureFlagSet())
    14551474            return WebGLGetInfo(false);
    1456         m_context->getProgramiv(program, pname, &value);
     1475        m_context->getProgramiv(program ? program->object() : 0, pname, &value);
    14571476        return WebGLGetInfo(static_cast<bool>(value));
    14581477    case GraphicsContext3D::INFO_LOG_LENGTH:
     
    14621481    case GraphicsContext3D::ACTIVE_UNIFORMS:
    14631482    case GraphicsContext3D::ACTIVE_UNIFORM_MAX_LENGTH:
    1464         m_context->getProgramiv(program, pname, &value);
     1483        m_context->getProgramiv(program ? program->object() : 0, pname, &value);
    14651484        return WebGLGetInfo(static_cast<long>(value));
    14661485    default:
     
    14761495        return "";
    14771496    WebGLStateRestorer(this, false);
    1478     return m_context->getProgramInfoLog(program);
     1497    return m_context->getProgramInfoLog(program ? program->object() : 0);
    14791498}
    14801499
     
    15221541    case GraphicsContext3D::DELETE_STATUS:
    15231542    case GraphicsContext3D::COMPILE_STATUS:
    1524         m_context->getShaderiv(shader, pname, &value);
     1543        m_context->getShaderiv(shader ? shader->object() : 0, pname, &value);
    15251544        return WebGLGetInfo(static_cast<bool>(value));
    15261545    case GraphicsContext3D::SHADER_TYPE:
    1527         m_context->getShaderiv(shader, pname, &value);
     1546        m_context->getShaderiv(shader ? shader->object() : 0, pname, &value);
    15281547        return WebGLGetInfo(static_cast<unsigned long>(value));
    15291548    case GraphicsContext3D::INFO_LOG_LENGTH:
    15301549    case GraphicsContext3D::SHADER_SOURCE_LENGTH:
    1531         m_context->getShaderiv(shader, pname, &value);
     1550        m_context->getShaderiv(shader ? shader->object() : 0, pname, &value);
    15321551        return WebGLGetInfo(static_cast<long>(value));
    15331552    default:
     
    15431562        return "";
    15441563    WebGLStateRestorer(this, false);
    1545     return m_context->getShaderInfoLog(shader);
     1564    return m_context->getShaderInfoLog(shader ? shader->object() : 0);
    15461565}
    15471566
     
    15521571        return "";
    15531572    WebGLStateRestorer(this, false);
    1554     return m_context->getShaderSource(shader);
     1573    return m_context->getShaderSource(shader ? shader->object() : 0);
    15551574}
    15561575
     
    16021621    // FIXME: make this more efficient using WebGLUniformLocation and caching types in it
    16031622    int activeUniforms = 0;
    1604     m_context->getProgramiv(program, GraphicsContext3D::ACTIVE_UNIFORMS, &activeUniforms);
     1623    m_context->getProgramiv(program ? program->object() : 0, GraphicsContext3D::ACTIVE_UNIFORMS, &activeUniforms);
    16051624    for (int i = 0; i < activeUniforms; i++) {
    16061625        ActiveInfo info;
    1607         if (!m_context->getActiveUniform(program, i, info))
     1626        if (!m_context->getActiveUniform(program ? program->object() : 0, i, info))
    16081627            return WebGLGetInfo();
    16091628        // Strip "[0]" from the name if it's an array.
     
    16191638            }
    16201639            // Now need to look this up by name again to find its location
    1621             long loc = m_context->getUniformLocation(program, name);
     1640            long loc = m_context->getUniformLocation(program ? program->object() : 0, name);
    16221641            if (loc == location) {
    16231642                // Found it. Use the type in the ActiveInfo to determine the return type.
     
    16941713                case GraphicsContext3D::FLOAT: {
    16951714                    float value[16] = {0};
    1696                     m_context->getUniformfv(program, location, value);
     1715                    m_context->getUniformfv(program ? program->object() : 0, location, value);
    16971716                    if (length == 1)
    16981717                        return WebGLGetInfo(value[0]);
     
    17011720                case GraphicsContext3D::INT: {
    17021721                    int value[16] = {0};
    1703                     m_context->getUniformiv(program, location, value);
     1722                    m_context->getUniformiv(program ? program->object() : 0, location, value);
    17041723                    if (length == 1)
    17051724                        return WebGLGetInfo(static_cast<long>(value[0]));
     
    17081727                case GraphicsContext3D::BOOL: {
    17091728                    int value[16] = {0};
    1710                     m_context->getUniformiv(program, location, value);
     1729                    m_context->getUniformiv(program ? program->object() : 0, location, value);
    17111730                    if (length > 1) {
    17121731                        unsigned char boolValue[16] = {0};
     
    17341753        return 0;
    17351754    WebGLStateRestorer(this, false);
    1736     long uniformLocation = m_context->getUniformLocation(program, name);
     1755    long uniformLocation = m_context->getUniformLocation(program ? program->object() : 0, name);
    17371756    if (uniformLocation == -1)
    17381757        return 0;
     
    18121831        return false;
    18131832
    1814     return m_context->isBuffer(buffer);
     1833    return m_context->isBuffer(buffer->object());
    18151834}
    18161835
     
    18291848        return false;
    18301849
    1831     return m_context->isFramebuffer(framebuffer);
     1850    return m_context->isFramebuffer(framebuffer->object());
    18321851}
    18331852
     
    18371856        return false;
    18381857
    1839     return m_context->isProgram(program);
     1858    return m_context->isProgram(program->object());
    18401859}
    18411860
     
    18451864        return false;
    18461865
    1847     return m_context->isRenderbuffer(renderbuffer);
     1866    return m_context->isRenderbuffer(renderbuffer->object());
    18481867}
    18491868
     
    18531872        return false;
    18541873
    1855     return m_context->isShader(shader);
     1874    return m_context->isShader(shader->object());
    18561875}
    18571876
     
    18611880        return false;
    18621881
    1863     return m_context->isTexture(texture);
     1882    return m_context->isTexture(texture->object());
    18641883}
    18651884
     
    18971916    }
    18981917
    1899     m_context->linkProgram(program);
     1918    m_context->linkProgram(program ? program->object() : 0);
    19001919    program->cacheActiveAttribLocations();
    19011920    cleanupAfterGraphicsCall(false);
     
    20422061    if (!validateWebGLObject(shader))
    20432062        return;
    2044     m_context->shaderSource(shader, string);
     2063    m_context->shaderSource(shader ? shader->object() : 0, string);
    20452064    cleanupAfterGraphicsCall(false);
    20462065}
     
    29312950    }
    29322951    m_currentProgram = program;
    2933     m_context->useProgram(program);
     2952    m_context->useProgram(program ? program->object() : 0);
    29342953    cleanupAfterGraphicsCall(false);
    29352954}
     
    29402959    if (!validateWebGLObject(program))
    29412960        return;
    2942     m_context->validateProgram(program);
     2961    m_context->validateProgram(program ? program->object() : 0);
    29432962    cleanupAfterGraphicsCall(false);
    29442963}
     
    32433262            }
    32443263            if (m_textureUnits[ii].m_texture2DBinding && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture())
    3245                 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, tex2D);
     3264                m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, tex2D->object());
    32463265            if (m_textureUnits[ii].m_textureCubeMapBinding && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture())
    3247                 m_context->bindTexture(GraphicsContext3D::TEXTURE_CUBE_MAP, texCubeMap);
     3266                m_context->bindTexture(GraphicsContext3D::TEXTURE_CUBE_MAP, texCubeMap->object());
    32483267        }
    32493268    }
     
    32563275    unsigned char black[] = {0, 0, 0, 255};
    32573276    m_blackTexture2D = createTexture();
    3258     m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_blackTexture2D.get());
     3277    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_blackTexture2D->object());
    32593278    m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, 1, 1,
    32603279                          0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, black);
    32613280    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
    32623281    m_blackTextureCubeMap = createTexture();
    3263     m_context->bindTexture(GraphicsContext3D::TEXTURE_CUBE_MAP, m_blackTextureCubeMap.get());
     3282    m_context->bindTexture(GraphicsContext3D::TEXTURE_CUBE_MAP, m_blackTextureCubeMap->object());
    32643283    m_context->texImage2D(GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X, 0, GraphicsContext3D::RGBA, 1, 1,
    32653284                          0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, black);
     
    37173736    m_vertexAttribState.resize(1);
    37183737    m_vertexAttrib0Buffer = createBuffer();
    3719     m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer.get());
     3738    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer->object());
    37203739    m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, 0, GraphicsContext3D::DYNAMIC_DRAW);
    37213740    m_context->vertexAttribPointer(0, 4, GraphicsContext3D::FLOAT, false, 0, 0);
     
    37363755        || !m_currentProgram->isUsingVertexAttrib0())
    37373756        return false;
    3738     m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer.get());
     3757    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer->object());
    37393758    long bufferDataSize = (numVertex + 1) * 4 * sizeof(float);
    37403759    if (bufferDataSize > m_vertexAttrib0BufferSize
     
    37653784    const VertexAttribState& state = m_vertexAttribState[0];
    37663785    if (state.bufferBinding != m_vertexAttrib0Buffer) {
    3767         m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, state.bufferBinding.get());
     3786        m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, state.bufferBinding->object());
    37683787        m_context->vertexAttribPointer(0, state.size, state.type, state.normalized, state.originalStride, state.offset);
    37693788    }
    3770     m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_boundArrayBuffer.get());
     3789    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_boundArrayBuffer->object());
    37713790}
    37723791
  • trunk/WebCore/html/canvas/WebGLRenderingContext.h

    r64308 r64582  
    304304        void viewport(long x, long y, unsigned long width, unsigned long height);
    305305
    306         GraphicsContext3D* graphicsContext3D() const { return m_context.get(); }
     306        virtual GraphicsContext3D* graphicsContext3D() const { return m_context.get(); }
    307307   
    308308        void reshape(int width, int height);
  • trunk/WebCore/platform/graphics/GraphicsContext3D.h

    r63502 r64582  
    7474
    7575namespace WebCore {
    76     class WebGLActiveInfo;
    7776    class ArrayBuffer;
    7877    class ArrayBufferView;
    79     class WebGLBuffer;
    80     class Uint8Array;
     78    class CanvasRenderingContext;
    8179    class Float32Array;
    82     class WebGLFramebuffer;
    83     class Int32Array;
    84     class WebGLProgram;
    85     class WebGLRenderbuffer;
    86     class WebGLRenderingContext;
    87     class WebGLShader;
    88     class WebGLTexture;
     80    class HostWindow;
    8981    class Image;
    9082    class ImageData;
    91     class HostWindow;
     83    class Int32Array;
     84    class Uint8Array;
     85    class WebGLActiveInfo;
    9286
    9387    struct ActiveInfo {
     
    544538
    545539        void activeTexture(unsigned long texture);
    546         void attachShader(WebGLProgram* program, WebGLShader* shader);
    547         void bindAttribLocation(WebGLProgram*, unsigned long index, const String& name);
    548         void bindBuffer(unsigned long target, WebGLBuffer*);
    549         void bindFramebuffer(unsigned long target, WebGLFramebuffer*);
    550         void bindRenderbuffer(unsigned long target, WebGLRenderbuffer*);
    551         void bindTexture(unsigned long target, WebGLTexture* texture);
     540        void attachShader(Platform3DObject program, Platform3DObject shader);
     541        void bindAttribLocation(Platform3DObject, unsigned long index, const String& name);
     542        void bindBuffer(unsigned long target, Platform3DObject);
     543        void bindFramebuffer(unsigned long target, Platform3DObject);
     544        void bindRenderbuffer(unsigned long target, Platform3DObject);
     545        void bindTexture(unsigned long target, Platform3DObject texture);
    552546        void blendColor(double red, double green, double blue, double alpha);
    553547        void blendEquation(unsigned long mode);
     
    568562        void clearStencil(long s);
    569563        void colorMask(bool red, bool green, bool blue, bool alpha);
    570         void compileShader(WebGLShader*);
     564        void compileShader(Platform3DObject);
    571565       
    572566        //void compressedTexImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long width, unsigned long height, long border, unsigned long imageSize, const void* data);
     
    579573        void depthMask(bool flag);
    580574        void depthRange(double zNear, double zFar);
    581         void detachShader(WebGLProgram*, WebGLShader*);
     575        void detachShader(Platform3DObject, Platform3DObject);
    582576        void disable(unsigned long cap);
    583577        void disableVertexAttribArray(unsigned long index);
     
    589583        void finish();
    590584        void flush();
    591         void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer*);
    592         void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture*, long level);
     585        void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject);
     586        void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level);
    593587        void frontFace(unsigned long mode);
    594588        void generateMipmap(unsigned long target);
    595589
    596         bool getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo&);
    597         bool getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo&);
    598 
    599         void getAttachedShaders(WebGLProgram* program, int maxCount, int* count, unsigned int* shaders);
    600 
    601         int  getAttribLocation(WebGLProgram*, const String& name);
     590        bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&);
     591        bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&);
     592
     593        void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders);
     594
     595        int getAttribLocation(Platform3DObject, const String& name);
    602596
    603597        void getBooleanv(unsigned long pname, unsigned char* value);
     
    615609        void getIntegerv(unsigned long pname, int* value);
    616610
    617         void getProgramiv(WebGLProgram* program, unsigned long pname, int* value);
    618 
    619         String getProgramInfoLog(WebGLProgram*);
     611        void getProgramiv(Platform3DObject program, unsigned long pname, int* value);
     612
     613        String getProgramInfoLog(Platform3DObject);
    620614
    621615        void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
    622616
    623         void getShaderiv(WebGLShader*, unsigned long pname, int* value);
    624 
    625         String getShaderInfoLog(WebGLShader*);
     617        void getShaderiv(Platform3DObject, unsigned long pname, int* value);
     618
     619        String getShaderInfoLog(Platform3DObject);
    626620
    627621        // TBD
    628622        // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
    629623
    630         String getShaderSource(WebGLShader*);
     624        String getShaderSource(Platform3DObject);
    631625        String getString(unsigned long name);
    632626
     
    634628        void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
    635629
    636         void getUniformfv(WebGLProgram* program, long location, float* value);
    637         void getUniformiv(WebGLProgram* program, long location, int* value);
    638 
    639         long getUniformLocation(WebGLProgram*, const String& name);
     630        void getUniformfv(Platform3DObject program, long location, float* value);
     631        void getUniformiv(Platform3DObject program, long location, int* value);
     632
     633        long getUniformLocation(Platform3DObject, const String& name);
    640634
    641635        void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
     
    645639
    646640        void hint(unsigned long target, unsigned long mode);
    647         bool isBuffer(WebGLBuffer*);
     641        bool isBuffer(Platform3DObject);
    648642        bool isEnabled(unsigned long cap);
    649         bool isFramebuffer(WebGLFramebuffer*);
    650         bool isProgram(WebGLProgram*);
    651         bool isRenderbuffer(WebGLRenderbuffer*);
    652         bool isShader(WebGLShader*);
    653         bool isTexture(WebGLTexture*);
     643        bool isFramebuffer(Platform3DObject);
     644        bool isProgram(Platform3DObject);
     645        bool isRenderbuffer(Platform3DObject);
     646        bool isShader(Platform3DObject);
     647        bool isTexture(Platform3DObject);
    654648        void lineWidth(double);
    655         void linkProgram(WebGLProgram*);
     649        void linkProgram(Platform3DObject);
    656650        void pixelStorei(unsigned long pname, long param);
    657651        void polygonOffset(double factor, double units);
     
    663657        void sampleCoverage(double value, bool invert);
    664658        void scissor(long x, long y, unsigned long width, unsigned long height);
    665         void shaderSource(WebGLShader*, const String& string);
     659        void shaderSource(Platform3DObject, const String& string);
    666660        void stencilFunc(unsigned long func, long ref, unsigned long mask);
    667661        void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
     
    698692        void uniformMatrix4fv(long location, bool transpose, float* value, int size);
    699693
    700         void useProgram(WebGLProgram*);
    701         void validateProgram(WebGLProgram*);
     694        void useProgram(Platform3DObject);
     695        void validateProgram(Platform3DObject);
    702696
    703697        void vertexAttrib1f(unsigned long indx, float x);
     
    721715#endif
    722716
    723         void paintRenderingResultsToCanvas(WebGLRenderingContext* context);
     717        void paintRenderingResultsToCanvas(CanvasRenderingContext* context);
    724718
    725719        // Helpers for notification about paint events
    726         void beginPaint(WebGLRenderingContext* context);
     720        void beginPaint(CanvasRenderingContext* context);
    727721        void endPaint();
    728722#if PLATFORM(QT)
  • trunk/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm

    r63705 r64582  
    3131
    3232#import "BlockExceptions.h"
    33 #include "CanvasObject.h"
    34 #include "ImageBuffer.h"
    35 #include "NotImplemented.h"
    36 #include "WebGLActiveInfo.h"
     33
    3734#include "ArrayBuffer.h"
    3835#include "ArrayBufferView.h"
    39 #include "WebGLBuffer.h"
     36#include "CanvasObject.h"
     37#include "CanvasRenderingContext.h"
    4038#include "Float32Array.h"
    41 #include "WebGLFramebuffer.h"
    4239#include "GraphicsContext.h"
    4340#include "HTMLCanvasElement.h"
     41#include "ImageBuffer.h"
    4442#include "Int32Array.h"
     43#include "NotImplemented.h"
     44#include "Uint8Array.h"
    4545#include "WebGLLayer.h"
    46 #include "WebGLProgram.h"
    47 #include "WebGLRenderbuffer.h"
    48 #include "WebGLRenderingContext.h"
    49 #include "WebGLShader.h"
    50 #include "WebGLTexture.h"
    51 #include "Uint8Array.h"
    5246#include <CoreGraphics/CGBitmapContext.h>
    5347#include <OpenGL/CGLRenderers.h>
     
    241235}
    242236
    243 void GraphicsContext3D::paintRenderingResultsToCanvas(WebGLRenderingContext* context)
     237void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context)
    244238{
    245239    HTMLCanvasElement* canvas = context->canvas();
     
    289283}
    290284
    291 void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
     285void GraphicsContext3D::beginPaint(CanvasRenderingContext* context)
    292286{
    293287    UNUSED_PARAM(context);
     
    462456}
    463457
    464 void GraphicsContext3D::attachShader(WebGLProgram* program, WebGLShader* shader)
     458void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
    465459{
    466460    ASSERT(program);
    467461    ASSERT(shader);
    468462    ensureContext(m_contextObj);
    469     ::glAttachShader((GLuint) program->object(), (GLuint) shader->object());
    470 }
    471 
    472 void GraphicsContext3D::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name)
     463    ::glAttachShader((GLuint) program, (GLuint) shader);
     464}
     465
     466void GraphicsContext3D::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
    473467{
    474468    ASSERT(program);
    475469    ensureContext(m_contextObj);
    476     ::glBindAttribLocation((GLuint) program->object(), index, name.utf8().data());
    477 }
    478 
    479 void GraphicsContext3D::bindBuffer(unsigned long target, WebGLBuffer* buffer)
    480 {
    481     ensureContext(m_contextObj);
    482     ::glBindBuffer(target, buffer ? (GLuint) buffer->object() : 0);
    483 }
    484 
    485 
    486 void GraphicsContext3D::bindFramebuffer(unsigned long target, WebGLFramebuffer* buffer)
     470    ::glBindAttribLocation((GLuint) program, index, name.utf8().data());
     471}
     472
     473void GraphicsContext3D::bindBuffer(unsigned long target, Platform3DObject buffer)
     474{
     475    ensureContext(m_contextObj);
     476    ::glBindBuffer(target, (GLuint) buffer);
     477}
     478
     479
     480void GraphicsContext3D::bindFramebuffer(unsigned long target, Platform3DObject buffer)
    487481{
    488482    ensureContext(m_contextObj);
    489483    GLuint fbo;
    490     if (buffer && buffer->object())
    491         fbo = (GLuint)buffer->object();
     484    if (buffer)
     485        fbo = (GLuint)buffer;
    492486    else
    493487        fbo = (m_attrs.antialias ? m_multisampleFBO : m_fbo);
     
    498492}
    499493
    500 void GraphicsContext3D::bindRenderbuffer(unsigned long target, WebGLRenderbuffer* renderbuffer)
    501 {
    502     ensureContext(m_contextObj);
    503     ::glBindRenderbufferEXT(target, renderbuffer ? (GLuint) renderbuffer->object() : 0);
    504 }
    505 
    506 
    507 void GraphicsContext3D::bindTexture(unsigned long target, WebGLTexture* texture)
    508 {
    509     ensureContext(m_contextObj);
    510     ::glBindTexture(target, texture ? (GLuint) texture->object() : 0);
     494void GraphicsContext3D::bindRenderbuffer(unsigned long target, Platform3DObject renderbuffer)
     495{
     496    ensureContext(m_contextObj);
     497    ::glBindRenderbufferEXT(target, (GLuint) renderbuffer);
     498}
     499
     500
     501void GraphicsContext3D::bindTexture(unsigned long target, Platform3DObject texture)
     502{
     503    ensureContext(m_contextObj);
     504    ::glBindTexture(target, (GLuint) texture);
    511505}
    512506
     
    620614}
    621615
    622 void GraphicsContext3D::compileShader(WebGLShader* shader)
     616void GraphicsContext3D::compileShader(Platform3DObject shader)
    623617{
    624618    ASSERT(shader);
    625619    ensureContext(m_contextObj);
    626     ::glCompileShader((GLuint) shader->object());
     620    ::glCompileShader((GLuint) shader);
    627621}
    628622
     
    679673}
    680674
    681 void GraphicsContext3D::detachShader(WebGLProgram* program, WebGLShader* shader)
     675void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader)
    682676{
    683677    ASSERT(program);
    684678    ASSERT(shader);
    685679    ensureContext(m_contextObj);
    686     ::glDetachShader((GLuint) program->object(), (GLuint) shader->object());
     680    ::glDetachShader((GLuint) program, (GLuint) shader);
    687681}
    688682
     
    735729}
    736730
    737 void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer* buffer)
    738 {
    739     ensureContext(m_contextObj);
    740     GLuint renderbuffer = (buffer ? (GLuint) buffer->object() : 0);
     731void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
     732{
     733    ensureContext(m_contextObj);
     734    GLuint renderbuffer = (GLuint) buffer;
    741735    if (attachment == DEPTH_STENCIL_ATTACHMENT) {
    742736        ::glFramebufferRenderbufferEXT(target, DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer);
     
    746740}
    747741
    748 void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture* texture, long level)
    749 {
    750     ensureContext(m_contextObj);
    751     ::glFramebufferTexture2DEXT(target, attachment, textarget, texture ? (GLuint) texture->object() : 0, level);
     742void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
     743{
     744    ensureContext(m_contextObj);
     745    ::glFramebufferTexture2DEXT(target, attachment, textarget, (GLuint) texture, level);
    752746}
    753747
     
    764758}
    765759
    766 bool GraphicsContext3D::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info)
    767 {
    768     if (!program->object()) {
     760bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
     761{
     762    if (!program) {
    769763        synthesizeGLError(INVALID_VALUE);
    770764        return false;
     
    772766    ensureContext(m_contextObj);
    773767    GLint maxAttributeSize = 0;
    774     ::glGetProgramiv(static_cast<GLuint>(program->object()), GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
     768    ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
    775769    GLchar name[maxAttributeSize]; // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination
    776770    GLsizei nameLength = 0;
    777771    GLint size = 0;
    778772    GLenum type = 0;
    779     ::glGetActiveAttrib(static_cast<GLuint>(program->object()), index, maxAttributeSize, &nameLength, &size, &type, name);
     773    ::glGetActiveAttrib(static_cast<GLuint>(program), index, maxAttributeSize, &nameLength, &size, &type, name);
    780774    if (!nameLength)
    781775        return false;
     
    786780}
    787781   
    788 bool GraphicsContext3D::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info)
    789 {
    790     if (!program->object()) {
     782bool GraphicsContext3D::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
     783{
     784    if (!program) {
    791785        synthesizeGLError(INVALID_VALUE);
    792786        return false;
     
    794788    ensureContext(m_contextObj);
    795789    GLint maxUniformSize = 0;
    796     ::glGetProgramiv(static_cast<GLuint>(program->object()), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
     790    ::glGetProgramiv(static_cast<GLuint>(program), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
    797791    GLchar name[maxUniformSize]; // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination
    798792    GLsizei nameLength = 0;
    799793    GLint size = 0;
    800794    GLenum type = 0;
    801     ::glGetActiveUniform(static_cast<GLuint>(program->object()), index, maxUniformSize, &nameLength, &size, &type, name);
     795    ::glGetActiveUniform(static_cast<GLuint>(program), index, maxUniformSize, &nameLength, &size, &type, name);
    802796    if (!nameLength)
    803797        return false;
     
    808802}
    809803
    810 void GraphicsContext3D::getAttachedShaders(WebGLProgram* program, int maxCount, int* count, unsigned int* shaders)
    811 {
    812     if (!program || !program->object()) {
     804void GraphicsContext3D::getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders)
     805{
     806    if (!program) {
    813807        synthesizeGLError(INVALID_VALUE);
    814808        return;
    815809    }
    816810    ensureContext(m_contextObj);
    817     ::glGetAttachedShaders(static_cast<GLuint>(program->object()), maxCount, count, shaders);
    818 }
    819 
    820 int GraphicsContext3D::getAttribLocation(WebGLProgram* program, const String& name)
     811    ::glGetAttachedShaders(static_cast<GLuint>(program), maxCount, count, shaders);
     812}
     813
     814int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
    821815{
    822816    if (!program)
     
    824818   
    825819    ensureContext(m_contextObj);
    826     return ::glGetAttribLocation((GLuint) program->object(), name.utf8().data());
     820    return ::glGetAttribLocation((GLuint) program, name.utf8().data());
    827821}
    828822
     
    857851}
    858852
    859 bool GraphicsContext3D::isBuffer(WebGLBuffer* buffer)
     853bool GraphicsContext3D::isBuffer(Platform3DObject buffer)
    860854{
    861855    if (!buffer)
     
    863857   
    864858    ensureContext(m_contextObj);
    865     return ::glIsBuffer((GLuint) buffer->object());
     859    return ::glIsBuffer((GLuint) buffer);
    866860}
    867861
     
    872866}
    873867
    874 bool GraphicsContext3D::isFramebuffer(WebGLFramebuffer* framebuffer)
     868bool GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
    875869{
    876870    if (!framebuffer)
     
    878872   
    879873    ensureContext(m_contextObj);
    880     return ::glIsFramebufferEXT((GLuint) framebuffer->object());
    881 }
    882 
    883 bool GraphicsContext3D::isProgram(WebGLProgram* program)
     874    return ::glIsFramebufferEXT((GLuint) framebuffer);
     875}
     876
     877bool GraphicsContext3D::isProgram(Platform3DObject program)
    884878{
    885879    if (!program)
     
    887881   
    888882    ensureContext(m_contextObj);
    889     return ::glIsProgram((GLuint) program->object());
    890 }
    891 
    892 bool GraphicsContext3D::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
     883    return ::glIsProgram((GLuint) program);
     884}
     885
     886bool GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
    893887{
    894888    if (!renderbuffer)
     
    896890   
    897891    ensureContext(m_contextObj);
    898     return ::glIsRenderbufferEXT((GLuint) renderbuffer->object());
    899 }
    900 
    901 bool GraphicsContext3D::isShader(WebGLShader* shader)
     892    return ::glIsRenderbufferEXT((GLuint) renderbuffer);
     893}
     894
     895bool GraphicsContext3D::isShader(Platform3DObject shader)
    902896{
    903897    if (!shader)
     
    905899   
    906900    ensureContext(m_contextObj);
    907     return ::glIsShader((GLuint) shader->object());
    908 }
    909 
    910 bool GraphicsContext3D::isTexture(WebGLTexture* texture)
     901    return ::glIsShader((GLuint) shader);
     902}
     903
     904bool GraphicsContext3D::isTexture(Platform3DObject texture)
    911905{
    912906    if (!texture)
     
    914908   
    915909    ensureContext(m_contextObj);
    916     return ::glIsTexture((GLuint) texture->object());
     910    return ::glIsTexture((GLuint) texture);
    917911}
    918912
     
    923917}
    924918
    925 void GraphicsContext3D::linkProgram(WebGLProgram* program)
     919void GraphicsContext3D::linkProgram(Platform3DObject program)
    926920{
    927921    ASSERT(program);
    928922    ensureContext(m_contextObj);
    929     ::glLinkProgram((GLuint) program->object());
     923    ::glLinkProgram((GLuint) program);
    930924}
    931925
     
    1000994}
    1001995
    1002 void GraphicsContext3D::shaderSource(WebGLShader* shader, const String& string)
     996void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& string)
    1003997{
    1004998    ASSERT(shader);
     
    10091003   
    10101004    int length = string.length();
    1011     ::glShaderSource((GLuint) shader->object(), 1, &s, &length);
     1005    ::glShaderSource((GLuint) shader, 1, &s, &length);
    10121006}
    10131007
     
    11831177}
    11841178
    1185 void GraphicsContext3D::useProgram(WebGLProgram* program)
    1186 {
    1187     ensureContext(m_contextObj);
    1188     ::glUseProgram(program ? ((GLuint) program->object()) : 0);
    1189 }
    1190 
    1191 void GraphicsContext3D::validateProgram(WebGLProgram* program)
     1179void GraphicsContext3D::useProgram(Platform3DObject program)
     1180{
     1181    ensureContext(m_contextObj);
     1182    ::glUseProgram((GLuint) program);
     1183}
     1184
     1185void GraphicsContext3D::validateProgram(Platform3DObject program)
    11921186{
    11931187    ASSERT(program);
    11941188   
    11951189    ensureContext(m_contextObj);
    1196     ::glValidateProgram((GLuint) program->object());
     1190    ::glValidateProgram((GLuint) program);
    11971191}
    11981192
     
    13171311}
    13181312
    1319 void GraphicsContext3D::getProgramiv(WebGLProgram* program, unsigned long pname, int* value)
    1320 {
    1321     ensureContext(m_contextObj);
    1322     ::glGetProgramiv((GLuint) program->object(), pname, value);
    1323 }
    1324 
    1325 String GraphicsContext3D::getProgramInfoLog(WebGLProgram* program)
     1313void GraphicsContext3D::getProgramiv(Platform3DObject program, unsigned long pname, int* value)
     1314{
     1315    ensureContext(m_contextObj);
     1316    ::glGetProgramiv((GLuint) program, pname, value);
     1317}
     1318
     1319String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
    13261320{
    13271321    ASSERT(program);
     
    13291323    ensureContext(m_contextObj);
    13301324    GLint length;
    1331     ::glGetProgramiv((GLuint) program->object(), GL_INFO_LOG_LENGTH, &length);
     1325    ::glGetProgramiv((GLuint) program, GL_INFO_LOG_LENGTH, &length);
    13321326   
    13331327    GLsizei size;
     
    13361330        return "";
    13371331
    1338     ::glGetProgramInfoLog((GLuint) program->object(), length, &size, info);
     1332    ::glGetProgramInfoLog((GLuint) program, length, &size, info);
    13391333    String s(info);
    13401334    fastFree(info);
     
    13481342}
    13491343
    1350 void GraphicsContext3D::getShaderiv(WebGLShader* shader, unsigned long pname, int* value)
     1344void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long pname, int* value)
    13511345{
    13521346    ASSERT(shader);
    13531347   
    13541348    ensureContext(m_contextObj);
    1355     ::glGetShaderiv((GLuint) shader->object(), pname, value);
    1356 }
    1357 
    1358 String GraphicsContext3D::getShaderInfoLog(WebGLShader* shader)
     1349    ::glGetShaderiv((GLuint) shader, pname, value);
     1350}
     1351
     1352String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
    13591353{
    13601354    ASSERT(shader);
     
    13621356    ensureContext(m_contextObj);
    13631357    GLint length;
    1364     ::glGetShaderiv((GLuint) shader->object(), GL_INFO_LOG_LENGTH, &length);
     1358    ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
    13651359   
    13661360    GLsizei size;
     
    13691363        return "";
    13701364       
    1371     ::glGetShaderInfoLog((GLuint) shader->object(), length, &size, info);
     1365    ::glGetShaderInfoLog((GLuint) shader, length, &size, info);
    13721366    String s(info);
    13731367    fastFree(info);
     
    13751369}
    13761370
    1377 String GraphicsContext3D::getShaderSource(WebGLShader* shader)
     1371String GraphicsContext3D::getShaderSource(Platform3DObject shader)
    13781372{
    13791373    ASSERT(shader);
     
    13811375    ensureContext(m_contextObj);
    13821376    GLint length;
    1383     ::glGetShaderiv((GLuint) shader->object(), GL_SHADER_SOURCE_LENGTH, &length);
     1377    ::glGetShaderiv((GLuint) shader, GL_SHADER_SOURCE_LENGTH, &length);
    13841378   
    13851379    GLsizei size;
     
    13881382        return "";
    13891383       
    1390     ::glGetShaderSource((GLuint) shader->object(), length, &size, info);
     1384    ::glGetShaderSource((GLuint) shader, length, &size, info);
    13911385    String s(info);
    13921386    fastFree(info);
     
    14071401}
    14081402
    1409 void GraphicsContext3D::getUniformfv(WebGLProgram* program, long location, float* value)
    1410 {
    1411     ensureContext(m_contextObj);
    1412     ::glGetUniformfv((GLuint) program->object(), location, value);
    1413 }
    1414 
    1415 void GraphicsContext3D::getUniformiv(WebGLProgram* program, long location, int* value)
    1416 {
    1417     ensureContext(m_contextObj);
    1418     ::glGetUniformiv((GLuint) program->object(), location, value);
    1419 }
    1420 
    1421 long GraphicsContext3D::getUniformLocation(WebGLProgram* program, const String& name)
     1403void GraphicsContext3D::getUniformfv(Platform3DObject program, long location, float* value)
     1404{
     1405    ensureContext(m_contextObj);
     1406    ::glGetUniformfv((GLuint) program, location, value);
     1407}
     1408
     1409void GraphicsContext3D::getUniformiv(Platform3DObject program, long location, int* value)
     1410{
     1411    ensureContext(m_contextObj);
     1412    ::glGetUniformiv((GLuint) program, location, value);
     1413}
     1414
     1415long GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
    14221416{
    14231417    ASSERT(program);
    14241418   
    14251419    ensureContext(m_contextObj);
    1426     return ::glGetUniformLocation((GLuint) program->object(), name.utf8().data());
     1420    return ::glGetUniformLocation((GLuint) program, name.utf8().data());
    14271421}
    14281422
  • trunk/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r63502 r64582  
    2121#include "GraphicsContext3D.h"
    2222
     23#include "ArrayBufferView.h"
    2324#include "CanvasObject.h"
     25#include "CanvasRenderingContext.h"
     26#include "Float32Array.h"
    2427#include "GraphicsContext.h"
    2528#include "HTMLCanvasElement.h"
    2629#include "HostWindow.h"
    2730#include "ImageBuffer.h"
     31#include "Int32Array.h"
    2832#include "NotImplemented.h"
    2933#include "QWebPageClient.h"
    30 #include "WebGLActiveInfo.h"
    31 #include "ArrayBufferView.h"
    32 #include "WebGLBuffer.h"
    33 #include "Float32Array.h"
    34 #include "WebGLFramebuffer.h"
    35 #include "Int32Array.h"
    36 #include "WebGLProgram.h"
    37 #include "WebGLRenderbuffer.h"
    38 #include "WebGLRenderingContext.h"
    39 #include "WebGLShader.h"
    40 #include "WebGLTexture.h"
    4134#include "Uint8Array.h"
    4235#include <QAbstractScrollArea>
     
    520513}
    521514
    522 void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
     515void GraphicsContext3D::beginPaint(CanvasRenderingContext* context)
    523516{
    524517    paintRenderingResultsToCanvas();
     
    529522}
    530523
    531 void GraphicsContext3D::paintRenderingResultsToCanvas(WebGLRenderingContext* context)
     524void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context)
    532525{
    533526    m_internal->m_glWidget->makeCurrent();
     
    599592}
    600593
    601 void GraphicsContext3D::attachShader(WebGLProgram* program, WebGLShader* shader)
     594void GraphicsContext3D::attachShader(PlatformGLObject program, PlatformGLObject shader)
    602595{
    603596    ASSERT(program);
    604597    ASSERT(shader);
    605598    m_internal->m_glWidget->makeCurrent();
    606     m_internal->attachShader((GLuint) program->object(), (GLuint) shader->object());
    607 }
    608 
    609 void GraphicsContext3D::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name)
     599    m_internal->attachShader((GLuint) program, (GLuint) shader);
     600}
     601
     602void GraphicsContext3D::bindAttribLocation(PlatformGLObject program, unsigned long index, const String& name)
    610603{
    611604    ASSERT(program);
    612605    m_internal->m_glWidget->makeCurrent();
    613     m_internal->bindAttribLocation((GLuint) program->object(), index, name.utf8().data());
    614 }
    615 
    616 void GraphicsContext3D::bindBuffer(unsigned long target, WebGLBuffer* buffer)
    617 {
    618     m_internal->m_glWidget->makeCurrent();
    619     m_internal->bindBuffer(target, buffer ? (GLuint) buffer->object() : 0);
    620 }
    621 
    622 void GraphicsContext3D::bindFramebuffer(unsigned long target, WebGLFramebuffer* buffer)
    623 {
    624     m_internal->m_glWidget->makeCurrent();
    625     m_internal->m_currentFbo = (buffer && buffer->object()) ? (GLuint) buffer->object() : m_internal->m_mainFbo;
     606    m_internal->bindAttribLocation((GLuint) program, index, name.utf8().data());
     607}
     608
     609void GraphicsContext3D::bindBuffer(unsigned long target, PlatformGLObject buffer)
     610{
     611    m_internal->m_glWidget->makeCurrent();
     612    m_internal->bindBuffer(target, (GLuint) buffer->object());
     613}
     614
     615void GraphicsContext3D::bindFramebuffer(unsigned long target, PlatformGLObject buffer)
     616{
     617    m_internal->m_glWidget->makeCurrent();
     618    m_internal->m_currentFbo = buffer ? (GLuint) buffer : m_internal->m_mainFbo;
    626619    m_internal->bindFramebuffer(target, m_internal->m_currentFbo);
    627620}
    628621
    629 void GraphicsContext3D::bindRenderbuffer(unsigned long target, WebGLRenderbuffer* renderbuffer)
    630 {
    631     m_internal->m_glWidget->makeCurrent();
    632     m_internal->bindRenderbuffer(target, renderbuffer ? (GLuint) renderbuffer->object() : 0);
    633 }
    634 
    635 void GraphicsContext3D::bindTexture(unsigned long target, WebGLTexture* texture)
    636 {
    637     m_internal->m_glWidget->makeCurrent();
    638     glBindTexture(target, texture ? (GLuint) texture->object() : 0);
     622void GraphicsContext3D::bindRenderbuffer(unsigned long target, PlatformGLObject renderbuffer)
     623{
     624    m_internal->m_glWidget->makeCurrent();
     625    m_internal->bindRenderbuffer(target, (GLuint) renderbuffer);
     626}
     627
     628void GraphicsContext3D::bindTexture(unsigned long target, PlatformGLObject texture)
     629{
     630    m_internal->m_glWidget->makeCurrent();
     631    glBindTexture(target, (GLuint) texture);
    639632}
    640633
     
    733726}
    734727
    735 void GraphicsContext3D::compileShader(WebGLShader* shader)
     728void GraphicsContext3D::compileShader(PlatformGLObject shader)
    736729{
    737730    ASSERT(shader);
    738731    m_internal->m_glWidget->makeCurrent();
    739     m_internal->compileShader((GLuint) shader->object());
     732    m_internal->compileShader((GLuint) shader);
    740733}
    741734
     
    780773}
    781774
    782 void GraphicsContext3D::detachShader(WebGLProgram* program, WebGLShader* shader)
     775void GraphicsContext3D::detachShader(PlatformGLObject program, PlatformGLObject shader)
    783776{
    784777    ASSERT(program);
    785778    ASSERT(shader);
    786779    m_internal->m_glWidget->makeCurrent();
    787     m_internal->detachShader((GLuint) program->object(), (GLuint) shader->object());
     780    m_internal->detachShader((GLuint) program, (GLuint) shader);
    788781}
    789782
     
    836829}
    837830
    838 void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer* buffer)
    839 {
    840     m_internal->m_glWidget->makeCurrent();
    841     m_internal->framebufferRenderbuffer(target, attachment, renderbuffertarget, buffer ? (GLuint) buffer->object() : 0);
    842 }
    843 
    844 void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture* texture, long level)
    845 {
    846     m_internal->m_glWidget->makeCurrent();
    847     m_internal->framebufferTexture2D(target, attachment, textarget, texture ? (GLuint) texture->object() : 0, level);
     831void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, PlatformGLObject buffer)
     832{
     833    m_internal->m_glWidget->makeCurrent();
     834    m_internal->framebufferRenderbuffer(target, attachment, renderbuffertarget, (GLuint) buffer);
     835}
     836
     837void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, PlatformGLObject texture, long level)
     838{
     839    m_internal->m_glWidget->makeCurrent();
     840    m_internal->framebufferTexture2D(target, attachment, textarget, (GLuint) texture, level);
    848841}
    849842
     
    860853}
    861854
    862 bool GraphicsContext3D::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info)
    863 {
    864     if (!program->object()) {
     855bool GraphicsContext3D::getActiveAttrib(PlatformGLObject program, unsigned long index, ActiveInfo& info)
     856{
     857    if (!program) {
    865858        synthesizeGLError(INVALID_VALUE);
    866859        return false;
     
    870863
    871864    GLint maxLength;
    872     m_internal->getProgramiv(static_cast<GLuint>(program->object()), GraphicsContext3D::ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength);
     865    m_internal->getProgramiv(static_cast<GLuint>(program), GraphicsContext3D::ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxLength);
    873866
    874867    GLchar* name = (GLchar*) fastMalloc(maxLength);
     
    877870    GLenum type;
    878871
    879     m_internal->getActiveAttrib(static_cast<GLuint>(program->object()), index, maxLength, &nameLength, &size, &type, name);
     872    m_internal->getActiveAttrib(static_cast<GLuint>(program), index, maxLength, &nameLength, &size, &type, name);
    880873
    881874    if (!nameLength) {
     
    892885}
    893886   
    894 bool GraphicsContext3D::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info)
    895 {
    896     if (!program->object()) {
     887bool GraphicsContext3D::getActiveUniform(PlatformGLObject program, unsigned long index, ActiveInfo& info)
     888{
     889    if (!program) {
    897890        synthesizeGLError(INVALID_VALUE);
    898891        return false;
     
    902895
    903896    GLint maxLength;
    904     m_internal->getProgramiv(static_cast<GLuint>(program->object()), GraphicsContext3D::ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
     897    m_internal->getProgramiv(static_cast<GLuint>(program), GraphicsContext3D::ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
    905898
    906899    GLchar* name = (GLchar*) fastMalloc(maxLength);
     
    909902    GLenum type;
    910903
    911     m_internal->getActiveUniform(static_cast<GLuint>(program->object()), index, maxLength, &nameLength, &size, &type, name);
     904    m_internal->getActiveUniform(static_cast<GLuint>(program), index, maxLength, &nameLength, &size, &type, name);
    912905
    913906    if (!nameLength) {
     
    924917}
    925918
    926 int GraphicsContext3D::getAttribLocation(WebGLProgram* program, const String& name)
     919int GraphicsContext3D::getAttribLocation(PlatformGLObject program, const String& name)
    927920{
    928921    if (!program)
     
    930923   
    931924    m_internal->m_glWidget->makeCurrent();
    932     return m_internal->getAttribLocation((GLuint) program->object(), name.utf8().data());
     925    return m_internal->getAttribLocation((GLuint) program, name.utf8().data());
    933926}
    934927
     
    963956}
    964957
    965 bool GraphicsContext3D::isBuffer(WebGLBuffer* buffer)
     958bool GraphicsContext3D::isBuffer(PlatformGLObject buffer)
    966959{
    967960    if (!buffer)
     
    969962   
    970963    m_internal->m_glWidget->makeCurrent();
    971     return m_internal->isBuffer((GLuint) buffer->object());
     964    return m_internal->isBuffer((GLuint) buffer);
    972965}
    973966
     
    978971}
    979972
    980 bool GraphicsContext3D::isFramebuffer(WebGLFramebuffer* framebuffer)
     973bool GraphicsContext3D::isFramebuffer(PlatformGLObject framebuffer)
    981974{
    982975    if (!framebuffer)
     
    984977   
    985978    m_internal->m_glWidget->makeCurrent();
    986     return m_internal->isFramebuffer((GLuint) framebuffer->object());
    987 }
    988 
    989 bool GraphicsContext3D::isProgram(WebGLProgram* program)
     979    return m_internal->isFramebuffer((GLuint) framebuffer);
     980}
     981
     982bool GraphicsContext3D::isProgram(PlatformGLObject program)
    990983{
    991984    if (!program)
     
    993986   
    994987    m_internal->m_glWidget->makeCurrent();
    995     return m_internal->isProgram((GLuint) program->object());
    996 }
    997 
    998 bool GraphicsContext3D::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
     988    return m_internal->isProgram((GLuint) program);
     989}
     990
     991bool GraphicsContext3D::isRenderbuffer(PlatformGLObject renderbuffer)
    999992{
    1000993    if (!renderbuffer)
     
    1002995   
    1003996    m_internal->m_glWidget->makeCurrent();
    1004     return m_internal->isRenderbuffer((GLuint) renderbuffer->object());
    1005 }
    1006 
    1007 bool GraphicsContext3D::isShader(WebGLShader* shader)
     997    return m_internal->isRenderbuffer((GLuint) renderbuffer);
     998}
     999
     1000bool GraphicsContext3D::isShader(PlatformGLObject shader)
    10081001{
    10091002    if (!shader)
     
    10111004   
    10121005    m_internal->m_glWidget->makeCurrent();
    1013     return m_internal->isShader((GLuint) shader->object());
    1014 }
    1015 
    1016 bool GraphicsContext3D::isTexture(WebGLTexture* texture)
     1006    return m_internal->isShader((GLuint) shader);
     1007}
     1008
     1009bool GraphicsContext3D::isTexture(PlatformGLObject texture)
    10171010{
    10181011    if (!texture)
     
    10201013   
    10211014    m_internal->m_glWidget->makeCurrent();
    1022     return glIsTexture((GLuint) texture->object());
     1015    return glIsTexture((GLuint) texture);
    10231016}
    10241017
     
    10291022}
    10301023
    1031 void GraphicsContext3D::linkProgram(WebGLProgram* program)
     1024void GraphicsContext3D::linkProgram(PlatformGLObject program)
    10321025{
    10331026    ASSERT(program);
    10341027    m_internal->m_glWidget->makeCurrent();
    1035     m_internal->linkProgram((GLuint) program->object());
     1028    m_internal->linkProgram((GLuint) program);
    10361029}
    10371030
     
    10821075}
    10831076
    1084 void GraphicsContext3D::shaderSource(WebGLShader* shader, const String& source)
     1077void GraphicsContext3D::shaderSource(PlatformGLObject shader, const String& source)
    10851078{
    10861079    ASSERT(shader);
     
    10991092    const char* data = sourceCS.data();
    11001093    int length = prefixedSource.length();
    1101     m_internal->shaderSource((GLuint) shader->object(), /* count */ 1, &data, &length);
     1094    m_internal->shaderSource((GLuint) shader, /* count */ 1, &data, &length);
    11021095}
    11031096
     
    12641257}
    12651258
    1266 void GraphicsContext3D::useProgram(WebGLProgram* program)
     1259void GraphicsContext3D::useProgram(PlatformGLObject program)
    12671260{
    12681261    ASSERT(program);
    12691262   
    12701263    m_internal->m_glWidget->makeCurrent();
    1271     m_internal->useProgram((GLuint) program->object());
    1272 }
    1273 
    1274 void GraphicsContext3D::validateProgram(WebGLProgram* program)
     1264    m_internal->useProgram((GLuint) program);
     1265}
     1266
     1267void GraphicsContext3D::validateProgram(PlatformGLObject program)
    12751268{
    12761269    ASSERT(program);
    12771270   
    12781271    m_internal->m_glWidget->makeCurrent();
    1279     m_internal->validateProgram((GLuint) program->object());
     1272    m_internal->validateProgram((GLuint) program);
    12801273}
    12811274
     
    13701363}
    13711364
    1372 void GraphicsContext3D::getProgramiv(WebGLProgram* program, unsigned long paramName, int* value)
    1373 {
    1374     m_internal->m_glWidget->makeCurrent();
    1375     m_internal->getProgramiv((GLuint) program->object(), paramName, value);
    1376 }
    1377 
    1378 String GraphicsContext3D::getProgramInfoLog(WebGLProgram* program)
     1365void GraphicsContext3D::getProgramiv(PlatformGLObject program, unsigned long paramName, int* value)
     1366{
     1367    m_internal->m_glWidget->makeCurrent();
     1368    m_internal->getProgramiv((GLuint) program, paramName, value);
     1369}
     1370
     1371String GraphicsContext3D::getProgramInfoLog(PlatformGLObject program)
    13791372{
    13801373    m_internal->m_glWidget->makeCurrent();
    13811374
    13821375    GLint length;
    1383     m_internal->getProgramiv((GLuint) program->object(), GraphicsContext3D::INFO_LOG_LENGTH, &length);
     1376    m_internal->getProgramiv((GLuint) program, GraphicsContext3D::INFO_LOG_LENGTH, &length);
    13841377
    13851378    GLsizei size;
     
    13891382        return "";
    13901383
    1391     m_internal->getProgramInfoLog((GLuint) program->object(), length, &size, info);
     1384    m_internal->getProgramInfoLog((GLuint) program, length, &size, info);
    13921385
    13931386    String result(info);
     
    14031396}
    14041397
    1405 void GraphicsContext3D::getShaderiv(WebGLShader* shader, unsigned long paramName, int* value)
     1398void GraphicsContext3D::getShaderiv(PlatformGLObject shader, unsigned long paramName, int* value)
    14061399{
    14071400    ASSERT(shader);
    14081401    m_internal->m_glWidget->makeCurrent();
    1409     m_internal->getShaderiv((GLuint) shader->object(), paramName, value);
    1410 }
    1411 
    1412 String GraphicsContext3D::getShaderInfoLog(WebGLShader* shader)
     1402    m_internal->getShaderiv((GLuint) shader, paramName, value);
     1403}
     1404
     1405String GraphicsContext3D::getShaderInfoLog(PlatformGLObject shader)
    14131406{
    14141407    m_internal->m_glWidget->makeCurrent();
    14151408
    14161409    GLint length;
    1417     m_internal->getShaderiv((GLuint) shader->object(), GraphicsContext3D::INFO_LOG_LENGTH, &length);
     1410    m_internal->getShaderiv((GLuint) shader, GraphicsContext3D::INFO_LOG_LENGTH, &length);
    14181411
    14191412    GLsizei size;
     
    14221415        return "";
    14231416
    1424     m_internal->getShaderInfoLog((GLuint) shader->object(), length, &size, info);
     1417    m_internal->getShaderInfoLog((GLuint) shader, length, &size, info);
    14251418
    14261419    String result(info);
     
    14301423}
    14311424
    1432 String GraphicsContext3D::getShaderSource(WebGLShader* shader)
     1425String GraphicsContext3D::getShaderSource(PlatformGLObject shader)
    14331426{
    14341427    m_internal->m_glWidget->makeCurrent();
    14351428
    14361429    GLint length;
    1437     m_internal->getShaderiv((GLuint) shader->object(), GraphicsContext3D::SHADER_SOURCE_LENGTH, &length);
     1430    m_internal->getShaderiv((GLuint) shader, GraphicsContext3D::SHADER_SOURCE_LENGTH, &length);
    14381431
    14391432    GLsizei size;
     
    14421435        return "";
    14431436
    1444     m_internal->getShaderSource((GLuint) shader->object(), length, &size, info);
     1437    m_internal->getShaderSource((GLuint) shader, length, &size, info);
    14451438
    14461439    String result(info);
     
    14621455}
    14631456
    1464 void GraphicsContext3D::getUniformfv(WebGLProgram* program, long location, float* value)
    1465 {
    1466     m_internal->m_glWidget->makeCurrent();
    1467     m_internal->getUniformfv((GLuint) program->object(), location, value);
    1468 }
    1469 
    1470 void GraphicsContext3D::getUniformiv(WebGLProgram* program, long location, int* value)
    1471 {
    1472     m_internal->m_glWidget->makeCurrent();
    1473     m_internal->getUniformiv((GLuint) program->object(), location, value);
    1474 }
    1475 
    1476 long GraphicsContext3D::getUniformLocation(WebGLProgram* program, const String& name)
     1457void GraphicsContext3D::getUniformfv(PlatformGLObject program, long location, float* value)
     1458{
     1459    m_internal->m_glWidget->makeCurrent();
     1460    m_internal->getUniformfv((GLuint) program, location, value);
     1461}
     1462
     1463void GraphicsContext3D::getUniformiv(PlatformGLObject program, long location, int* value)
     1464{
     1465    m_internal->m_glWidget->makeCurrent();
     1466    m_internal->getUniformiv((GLuint) program, location, value);
     1467}
     1468
     1469long GraphicsContext3D::getUniformLocation(PlatformGLObject program, const String& name)
    14771470{
    14781471    ASSERT(program);
    14791472   
    14801473    m_internal->m_glWidget->makeCurrent();
    1481     return m_internal->getUniformLocation((GLuint) program->object(), name.utf8().data());
     1474    return m_internal->getUniformLocation((GLuint) program, name.utf8().data());
    14821475}
    14831476
  • trunk/WebKit/chromium/ChangeLog

    r64578 r64582  
     12010-08-03  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Move WebGL-specific code out of GraphicsContext3D so that G3D can be used as a generic accelerated drawing API
     6        https://bugs.webkit.org/show_bug.cgi?id=43221
     7
     8        Implements functions in term of Platform3DObjects instead of WebGL types.
     9
     10        * src/GraphicsContext3D.cpp:
     11        (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas):
     12        (WebCore::GraphicsContext3DInternal::beginPaint):
     13        (WebCore::GraphicsContext3DInternal::bindAttribLocation):
     14        (WebCore::GraphicsContext3DInternal::getActiveAttrib):
     15        (WebCore::GraphicsContext3DInternal::getActiveUniform):
     16        (WebCore::GraphicsContext3DInternal::getAttribLocation):
     17        (WebCore::GraphicsContext3DInternal::getProgramInfoLog):
     18        (WebCore::GraphicsContext3DInternal::getShaderInfoLog):
     19        (WebCore::GraphicsContext3DInternal::getShaderSource):
     20        (WebCore::GraphicsContext3DInternal::getUniformLocation):
     21        (WebCore::GraphicsContext3DInternal::shaderSource):
     22
    1232010-08-03  Dimitri Glazkov  <dglazkov@chromium.org>
    224
  • trunk/WebKit/chromium/src/GraphicsContext3D.cpp

    r63502 r64582  
    3636
    3737#include "CachedImage.h"
     38#include "CanvasRenderingContext.h"
    3839#include "Chrome.h"
    3940#include "ChromeClientImpl.h"
     
    4243#include "ImageBuffer.h"
    4344#include "ImageData.h"
    44 #include "WebGLBuffer.h"
    4545#include "Int8Array.h"
    4646#include "Float32Array.h"
    47 #include "WebGLFramebuffer.h"
    4847#include "Int32Array.h"
    49 #include "WebGLProgram.h"
    50 #include "WebGLRenderbuffer.h"
    51 #include "WebGLRenderingContext.h"
    52 #include "WebGLShader.h"
    53 #include "WebGLTexture.h"
    5448#include "Uint8Array.h"
    5549#include "WebGLLayerChromium.h"
     
    9589// #define RENDER_TO_DEBUGGING_WINDOW
    9690
    97 #define EXTRACT(val) (!val ? 0 : val->object())
    98 
    9991class GraphicsContext3DInternal {
    10092public:
     
    113105    void reshape(int width, int height);
    114106
    115     void paintRenderingResultsToCanvas(WebGLRenderingContext* context);
    116     void beginPaint(WebGLRenderingContext* context);
     107    void paintRenderingResultsToCanvas(CanvasRenderingContext* context);
     108    void beginPaint(CanvasRenderingContext* context);
    117109    void endPaint();
    118110
     
    128120    //
    129121    void activeTexture(unsigned long texture);
    130     void attachShader(WebGLProgram* program, WebGLShader* shader);
    131     void bindAttribLocation(WebGLProgram*, unsigned long index, const String& name);
    132     void bindBuffer(unsigned long target, WebGLBuffer*);
    133     void bindFramebuffer(unsigned long target, WebGLFramebuffer*);
    134     void bindRenderbuffer(unsigned long target, WebGLRenderbuffer*);
    135     void bindTexture(unsigned long target, WebGLTexture* texture);
     122    void attachShader(Platform3DObject program, Platform3DObject shader);
     123    void bindAttribLocation(Platform3DObject, unsigned long index, const String& name);
     124    void bindBuffer(unsigned long target, Platform3DObject);
     125    void bindFramebuffer(unsigned long target, Platform3DObject);
     126    void bindRenderbuffer(unsigned long target, Platform3DObject);
     127    void bindTexture(unsigned long target, Platform3DObject texture);
    136128    void blendColor(double red, double green, double blue, double alpha);
    137129    void blendEquation(unsigned long mode);
     
    152144    void clearStencil(long s);
    153145    void colorMask(bool red, bool green, bool blue, bool alpha);
    154     void compileShader(WebGLShader*);
     146    void compileShader(Platform3DObject);
    155147
    156148    void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border);
     
    160152    void depthMask(bool flag);
    161153    void depthRange(double zNear, double zFar);
    162     void detachShader(WebGLProgram*, WebGLShader*);
     154    void detachShader(Platform3DObject, Platform3DObject);
    163155    void disable(unsigned long cap);
    164156    void disableVertexAttribArray(unsigned long index);
     
    170162    void finish();
    171163    void flush();
    172     void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer*);
    173     void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture*, long level);
     164    void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject);
     165    void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level);
    174166    void frontFace(unsigned long mode);
    175167    void generateMipmap(unsigned long target);
    176168
    177     bool getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo&);
    178     bool getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo&);
    179 
    180     void getAttachedShaders(WebGLProgram* program, int maxCount, int* count, unsigned int* shaders);
    181 
    182     int  getAttribLocation(WebGLProgram*, const String& name);
     169    bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&);
     170    bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&);
     171
     172    void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders);
     173
     174    int getAttribLocation(Platform3DObject, const String& name);
    183175
    184176    void getBooleanv(unsigned long pname, unsigned char* value);
     
    196188    void getIntegerv(unsigned long pname, int* value);
    197189
    198     void getProgramiv(WebGLProgram* program, unsigned long pname, int* value);
    199 
    200     String getProgramInfoLog(WebGLProgram*);
     190    void getProgramiv(Platform3DObject program, unsigned long pname, int* value);
     191
     192    String getProgramInfoLog(Platform3DObject);
    201193
    202194    void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value);
    203195
    204     void getShaderiv(WebGLShader*, unsigned long pname, int* value);
    205 
    206     String getShaderInfoLog(WebGLShader*);
    207 
    208     String getShaderSource(WebGLShader*);
     196    void getShaderiv(Platform3DObject, unsigned long pname, int* value);
     197
     198    String getShaderInfoLog(Platform3DObject);
     199
     200    String getShaderSource(Platform3DObject);
    209201    String getString(unsigned long name);
    210202
     
    212204    void getTexParameteriv(unsigned long target, unsigned long pname, int* value);
    213205
    214     void getUniformfv(WebGLProgram* program, long location, float* value);
    215     void getUniformiv(WebGLProgram* program, long location, int* value);
    216 
    217     long getUniformLocation(WebGLProgram*, const String& name);
     206    void getUniformfv(Platform3DObject program, long location, float* value);
     207    void getUniformiv(Platform3DObject program, long location, int* value);
     208
     209    long getUniformLocation(Platform3DObject, const String& name);
    218210
    219211    void getVertexAttribfv(unsigned long index, unsigned long pname, float* value);
     
    223215
    224216    void hint(unsigned long target, unsigned long mode);
    225     bool isBuffer(WebGLBuffer*);
     217    bool isBuffer(Platform3DObject);
    226218    bool isEnabled(unsigned long cap);
    227     bool isFramebuffer(WebGLFramebuffer*);
    228     bool isProgram(WebGLProgram*);
    229     bool isRenderbuffer(WebGLRenderbuffer*);
    230     bool isShader(WebGLShader*);
    231     bool isTexture(WebGLTexture*);
     219    bool isFramebuffer(Platform3DObject);
     220    bool isProgram(Platform3DObject);
     221    bool isRenderbuffer(Platform3DObject);
     222    bool isShader(Platform3DObject);
     223    bool isTexture(Platform3DObject);
    232224    void lineWidth(double);
    233     void linkProgram(WebGLProgram*);
     225    void linkProgram(Platform3DObject);
    234226    void pixelStorei(unsigned long pname, long param);
    235227    void polygonOffset(double factor, double units);
     
    241233    void sampleCoverage(double value, bool invert);
    242234    void scissor(long x, long y, unsigned long width, unsigned long height);
    243     void shaderSource(WebGLShader*, const String& string);
     235    void shaderSource(Platform3DObject, const String& string);
    244236    void stencilFunc(unsigned long func, long ref, unsigned long mask);
    245237    void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask);
     
    278270    void uniformMatrix4fv(long location, bool transpose, float* value, int size);
    279271
    280     void useProgram(WebGLProgram*);
    281     void validateProgram(WebGLProgram*);
     272    void useProgram(Platform3DObject);
     273    void validateProgram(Platform3DObject);
    282274
    283275    void vertexAttrib1f(unsigned long indx, float x);
     
    401393#endif
    402394
    403 void GraphicsContext3DInternal::paintRenderingResultsToCanvas(WebGLRenderingContext* context)
     395void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingContext* context)
    404396{
    405397    HTMLCanvasElement* canvas = context->canvas();
     
    460452}
    461453
    462 void GraphicsContext3DInternal::beginPaint(WebGLRenderingContext* context)
     454void GraphicsContext3DInternal::beginPaint(CanvasRenderingContext* context)
    463455{
    464456    paintRenderingResultsToCanvas(context);
     
    509501}
    510502
    511 #define DELEGATE_TO_IMPL_1_X(name, t1) \
    512 void GraphicsContext3DInternal::name(t1 a1) \
    513 { \
    514     m_impl->name(EXTRACT(a1));                  \
    515 }
    516 
    517503#define DELEGATE_TO_IMPL_1R(name, t1, rt)    \
    518504rt GraphicsContext3DInternal::name(t1 a1) \
     
    521507}
    522508
    523 #define DELEGATE_TO_IMPL_1R_X(name, t1, rt)    \
    524 rt GraphicsContext3DInternal::name(t1 a1) \
    525 { \
    526     return m_impl->name(EXTRACT(a1));           \
    527 }
    528 
    529509#define DELEGATE_TO_IMPL_2(name, t1, t2) \
    530510void GraphicsContext3DInternal::name(t1 a1, t2 a2) \
     
    533513}
    534514
    535 #define DELEGATE_TO_IMPL_2_X12(name, t1, t2) \
    536 void GraphicsContext3DInternal::name(t1 a1, t2 a2) \
    537 { \
    538     m_impl->name(EXTRACT(a1), EXTRACT(a2));     \
    539 }
    540 
    541 #define DELEGATE_TO_IMPL_2_X2(name, t1, t2) \
    542 void GraphicsContext3DInternal::name(t1 a1, t2 a2) \
    543 { \
    544     m_impl->name(a1, EXTRACT(a2));     \
    545 }
    546 
    547515#define DELEGATE_TO_IMPL_2R(name, t1, t2, rt)  \
    548516rt GraphicsContext3DInternal::name(t1 a1, t2 a2) \
     
    557525}
    558526
    559 #define DELEGATE_TO_IMPL_3_X1(name, t1, t2, t3)   \
    560 void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3)    \
    561 { \
    562     m_impl->name(EXTRACT(a1), a2, a3);          \
    563 }
    564 
    565527#define DELEGATE_TO_IMPL_3R(name, t1, t2, t3, rt)   \
    566528rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3)    \
     
    575537}
    576538
    577 #define DELEGATE_TO_IMPL_4_X1(name, t1, t2, t3, t4)    \
    578 void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4)  \
    579 { \
    580     m_impl->name(EXTRACT(a1), a2, a3, a4);     \
    581 }
    582 
    583 #define DELEGATE_TO_IMPL_4_X4(name, t1, t2, t3, t4)    \
    584 void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4)  \
    585 { \
    586     m_impl->name(a1, a2, a3, EXTRACT(a4));      \
    587 }
    588 
    589539#define DELEGATE_TO_IMPL_5(name, t1, t2, t3, t4, t5)      \
    590540void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
     
    593543}
    594544
    595 #define DELEGATE_TO_IMPL_5_X4(name, t1, t2, t3, t4, t5)                \
    596 void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
    597 { \
    598     m_impl->name(a1, a2, a3, EXTRACT(a4), a5);  \
    599 }
    600 
    601545#define DELEGATE_TO_IMPL_5R(name, t1, t2, t3, t4, t5, rt)      \
    602546rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)        \
     
    650594
    651595DELEGATE_TO_IMPL_1(activeTexture, unsigned long)
    652 DELEGATE_TO_IMPL_2_X12(attachShader, WebGLProgram*, WebGLShader*)
    653 
    654 void GraphicsContext3DInternal::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name)
    655 {
    656     m_impl->bindAttribLocation(EXTRACT(program), index, name.utf8().data());
    657 }
    658 
    659 DELEGATE_TO_IMPL_2_X2(bindBuffer, unsigned long, WebGLBuffer*)
    660 DELEGATE_TO_IMPL_2_X2(bindFramebuffer, unsigned long, WebGLFramebuffer*)
    661 DELEGATE_TO_IMPL_2_X2(bindRenderbuffer, unsigned long, WebGLRenderbuffer*)
    662 
    663 static const int kTextureWrapR = 0x8072;
    664 
    665 // If we didn't have to hack GL_TEXTURE_WRAP_R for cube maps,
    666 // we could just use:
    667 // DELEGATE_TO_IMPL_2_X2(bindTexture, unsigned long, WebGLTexture*)
    668 void GraphicsContext3DInternal::bindTexture(unsigned long target,
    669                                             WebGLTexture* texture)
    670 {
    671     unsigned int textureObject = EXTRACT(texture);
    672 
    673     m_impl->bindTexture(target, textureObject);
    674 
    675     // FIXME: GL_TEXTURE_WRAP_R isn't exposed in the OpenGL ES 2.0
    676     // API. On desktop OpenGL implementations it seems necessary to
    677     // set this wrap mode to GL_CLAMP_TO_EDGE to get correct behavior
    678     // of cube maps.
    679     if (texture)
    680         if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) {
    681             if (!texture->isCubeMapRWrapModeInitialized()) {
    682                 m_impl->texParameteri(GraphicsContext3D::TEXTURE_CUBE_MAP, kTextureWrapR, GraphicsContext3D::CLAMP_TO_EDGE);
    683                 texture->setCubeMapRWrapModeInitialized(true);
    684             }
    685         } else
    686             texture->setCubeMapRWrapModeInitialized(false);
    687 }
    688 
     596DELEGATE_TO_IMPL_2(attachShader, Platform3DObject, Platform3DObject)
     597
     598void GraphicsContext3DInternal::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name)
     599{
     600    m_impl->bindAttribLocation(program, index, name.utf8().data());
     601}
     602
     603DELEGATE_TO_IMPL_2(bindBuffer, unsigned long, Platform3DObject)
     604DELEGATE_TO_IMPL_2(bindFramebuffer, unsigned long, Platform3DObject)
     605DELEGATE_TO_IMPL_2(bindRenderbuffer, unsigned long, Platform3DObject)
     606DELEGATE_TO_IMPL_2(bindTexture, unsigned long, Platform3DObject)
    689607DELEGATE_TO_IMPL_4(blendColor, double, double, double, double)
    690608DELEGATE_TO_IMPL_1(blendEquation, unsigned long)
     
    724642DELEGATE_TO_IMPL_1(clearStencil, long)
    725643DELEGATE_TO_IMPL_4(colorMask, bool, bool, bool, bool)
    726 DELEGATE_TO_IMPL_1_X(compileShader, WebGLShader*)
     644DELEGATE_TO_IMPL_1(compileShader, Platform3DObject)
    727645
    728646DELEGATE_TO_IMPL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
     
    732650DELEGATE_TO_IMPL_1(depthMask, bool)
    733651DELEGATE_TO_IMPL_2(depthRange, double, double)
    734 DELEGATE_TO_IMPL_2_X12(detachShader, WebGLProgram*, WebGLShader*)
     652DELEGATE_TO_IMPL_2(detachShader, Platform3DObject, Platform3DObject)
    735653DELEGATE_TO_IMPL_1(disable, unsigned long)
    736654DELEGATE_TO_IMPL_1(disableVertexAttribArray, unsigned long)
     
    742660DELEGATE_TO_IMPL(finish)
    743661DELEGATE_TO_IMPL(flush)
    744 DELEGATE_TO_IMPL_4_X4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*)
    745 DELEGATE_TO_IMPL_5_X4(framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long)
     662DELEGATE_TO_IMPL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, Platform3DObject)
     663DELEGATE_TO_IMPL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, Platform3DObject, long)
    746664DELEGATE_TO_IMPL_1(frontFace, unsigned long)
    747665DELEGATE_TO_IMPL_1(generateMipmap, unsigned long)
    748666
    749 bool GraphicsContext3DInternal::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info)
     667bool GraphicsContext3DInternal::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info)
    750668{
    751669    WebKit::WebGraphicsContext3D::ActiveInfo webInfo;
    752     if (!m_impl->getActiveAttrib(EXTRACT(program), index, webInfo))
     670    if (!m_impl->getActiveAttrib(program, index, webInfo))
    753671        return false;
    754672    info.name = webInfo.name;
     
    758676}
    759677
    760 bool GraphicsContext3DInternal::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info)
     678bool GraphicsContext3DInternal::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info)
    761679{
    762680    WebKit::WebGraphicsContext3D::ActiveInfo webInfo;
    763     if (!m_impl->getActiveUniform(EXTRACT(program), index, webInfo))
     681    if (!m_impl->getActiveUniform(program, index, webInfo))
    764682        return false;
    765683    info.name = webInfo.name;
     
    769687}
    770688
    771 DELEGATE_TO_IMPL_4_X1(getAttachedShaders, WebGLProgram*, int, int*, unsigned int*)
    772 
    773 int GraphicsContext3DInternal::getAttribLocation(WebGLProgram* program, const String& name)
    774 {
    775     return m_impl->getAttribLocation(EXTRACT(program), name.utf8().data());
     689DELEGATE_TO_IMPL_4(getAttachedShaders, Platform3DObject, int, int*, unsigned int*)
     690
     691int GraphicsContext3DInternal::getAttribLocation(Platform3DObject program, const String& name)
     692{
     693    return m_impl->getAttribLocation(program, name.utf8().data());
    776694}
    777695
     
    800718DELEGATE_TO_IMPL_2(getIntegerv, unsigned long, int*)
    801719
    802 DELEGATE_TO_IMPL_3_X1(getProgramiv, WebGLProgram*, unsigned long, int*)
    803 
    804 String GraphicsContext3DInternal::getProgramInfoLog(WebGLProgram* program)
    805 {
    806     return m_impl->getProgramInfoLog(EXTRACT(program));
     720DELEGATE_TO_IMPL_3(getProgramiv, Platform3DObject, unsigned long, int*)
     721
     722String GraphicsContext3DInternal::getProgramInfoLog(Platform3DObject program)
     723{
     724    return m_impl->getProgramInfoLog(program);
    807725}
    808726
    809727DELEGATE_TO_IMPL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*)
    810728
    811 DELEGATE_TO_IMPL_3_X1(getShaderiv, WebGLShader*, unsigned long, int*)
    812 
    813 String GraphicsContext3DInternal::getShaderInfoLog(WebGLShader* shader)
    814 {
    815     return m_impl->getShaderInfoLog(EXTRACT(shader));
    816 }
    817 
    818 String GraphicsContext3DInternal::getShaderSource(WebGLShader* shader)
    819 {
    820     return m_impl->getShaderSource(EXTRACT(shader));
     729DELEGATE_TO_IMPL_3(getShaderiv, Platform3DObject, unsigned long, int*)
     730
     731String GraphicsContext3DInternal::getShaderInfoLog(Platform3DObject shader)
     732{
     733    return m_impl->getShaderInfoLog(shader);
     734}
     735
     736String GraphicsContext3DInternal::getShaderSource(Platform3DObject shader)
     737{
     738    return m_impl->getShaderSource(shader);
    821739}
    822740
     
    829747DELEGATE_TO_IMPL_3(getTexParameteriv, unsigned long, unsigned long, int*)
    830748
    831 DELEGATE_TO_IMPL_3_X1(getUniformfv, WebGLProgram*, long, float*)
    832 DELEGATE_TO_IMPL_3_X1(getUniformiv, WebGLProgram*, long, int*)
    833 
    834 long GraphicsContext3DInternal::getUniformLocation(WebGLProgram* program, const String& name)
    835 {
    836     return m_impl->getUniformLocation(EXTRACT(program), name.utf8().data());
     749DELEGATE_TO_IMPL_3(getUniformfv, Platform3DObject, long, float*)
     750DELEGATE_TO_IMPL_3(getUniformiv, Platform3DObject, long, int*)
     751
     752long GraphicsContext3DInternal::getUniformLocation(Platform3DObject program, const String& name)
     753{
     754    return m_impl->getUniformLocation(program, name.utf8().data());
    837755}
    838756
     
    843761
    844762DELEGATE_TO_IMPL_2(hint, unsigned long, unsigned long)
    845 DELEGATE_TO_IMPL_1R_X(isBuffer, WebGLBuffer*, bool)
     763DELEGATE_TO_IMPL_1R(isBuffer, Platform3DObject, bool)
    846764DELEGATE_TO_IMPL_1R(isEnabled, unsigned long, bool)
    847 DELEGATE_TO_IMPL_1R_X(isFramebuffer, WebGLFramebuffer*, bool)
    848 DELEGATE_TO_IMPL_1R_X(isProgram, WebGLProgram*, bool)
    849 DELEGATE_TO_IMPL_1R_X(isRenderbuffer, WebGLRenderbuffer*, bool)
    850 DELEGATE_TO_IMPL_1R_X(isShader, WebGLShader*, bool)
    851 DELEGATE_TO_IMPL_1R_X(isTexture, WebGLTexture*, bool)
     765DELEGATE_TO_IMPL_1R(isFramebuffer, Platform3DObject, bool)
     766DELEGATE_TO_IMPL_1R(isProgram, Platform3DObject, bool)
     767DELEGATE_TO_IMPL_1R(isRenderbuffer, Platform3DObject, bool)
     768DELEGATE_TO_IMPL_1R(isShader, Platform3DObject, bool)
     769DELEGATE_TO_IMPL_1R(isTexture, Platform3DObject, bool)
    852770DELEGATE_TO_IMPL_1(lineWidth, double)
    853 DELEGATE_TO_IMPL_1_X(linkProgram, WebGLProgram*)
     771DELEGATE_TO_IMPL_1(linkProgram, Platform3DObject)
    854772DELEGATE_TO_IMPL_2(pixelStorei, unsigned long, long)
    855773DELEGATE_TO_IMPL_2(polygonOffset, double, double)
     
    860778DELEGATE_TO_IMPL_4(scissor, long, long, unsigned long, unsigned long)
    861779
    862 void GraphicsContext3DInternal::shaderSource(WebGLShader* shader, const String& string)
    863 {
    864     m_impl->shaderSource(EXTRACT(shader), string.utf8().data());
     780void GraphicsContext3DInternal::shaderSource(Platform3DObject shader, const String& string)
     781{
     782    m_impl->shaderSource(shader, string.utf8().data());
    865783}
    866784
     
    958876}
    959877
    960 DELEGATE_TO_IMPL_1_X(useProgram, WebGLProgram*)
    961 DELEGATE_TO_IMPL_1_X(validateProgram, WebGLProgram*)
     878DELEGATE_TO_IMPL_1(useProgram, Platform3DObject)
     879DELEGATE_TO_IMPL_1(validateProgram, Platform3DObject)
    962880
    963881DELEGATE_TO_IMPL_2(vertexAttrib1f, unsigned long, float)
     
    11411059
    11421060DELEGATE_TO_INTERNAL_1(activeTexture, unsigned long)
    1143 DELEGATE_TO_INTERNAL_2(attachShader, WebGLProgram*, WebGLShader*)
    1144 DELEGATE_TO_INTERNAL_3(bindAttribLocation, WebGLProgram*, unsigned long, const String&)
    1145 
    1146 DELEGATE_TO_INTERNAL_2(bindBuffer, unsigned long, WebGLBuffer*)
    1147 DELEGATE_TO_INTERNAL_2(bindFramebuffer, unsigned long, WebGLFramebuffer*)
    1148 DELEGATE_TO_INTERNAL_2(bindRenderbuffer, unsigned long, WebGLRenderbuffer*)
    1149 DELEGATE_TO_INTERNAL_2(bindTexture, unsigned long, WebGLTexture*)
     1061DELEGATE_TO_INTERNAL_2(attachShader, Platform3DObject, Platform3DObject)
     1062DELEGATE_TO_INTERNAL_3(bindAttribLocation, Platform3DObject, unsigned long, const String&)
     1063
     1064DELEGATE_TO_INTERNAL_2(bindBuffer, unsigned long, Platform3DObject)
     1065DELEGATE_TO_INTERNAL_2(bindFramebuffer, unsigned long, Platform3DObject)
     1066DELEGATE_TO_INTERNAL_2(bindRenderbuffer, unsigned long, Platform3DObject)
     1067DELEGATE_TO_INTERNAL_2(bindTexture, unsigned long, Platform3DObject)
    11501068DELEGATE_TO_INTERNAL_4(blendColor, double, double, double, double)
    11511069DELEGATE_TO_INTERNAL_1(blendEquation, unsigned long)
     
    11661084DELEGATE_TO_INTERNAL_1(clearStencil, long)
    11671085DELEGATE_TO_INTERNAL_4(colorMask, bool, bool, bool, bool)
    1168 DELEGATE_TO_INTERNAL_1(compileShader, WebGLShader*)
     1086DELEGATE_TO_INTERNAL_1(compileShader, Platform3DObject)
    11691087
    11701088DELEGATE_TO_INTERNAL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long)
     
    11741092DELEGATE_TO_INTERNAL_1(depthMask, bool)
    11751093DELEGATE_TO_INTERNAL_2(depthRange, double, double)
    1176 DELEGATE_TO_INTERNAL_2(detachShader, WebGLProgram*, WebGLShader*)
     1094DELEGATE_TO_INTERNAL_2(detachShader, Platform3DObject, Platform3DObject)
    11771095DELEGATE_TO_INTERNAL_1(disable, unsigned long)
    11781096DELEGATE_TO_INTERNAL_1(disableVertexAttribArray, unsigned long)
     
    11841102DELEGATE_TO_INTERNAL(finish)
    11851103DELEGATE_TO_INTERNAL(flush)
    1186 DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*)
    1187 DELEGATE_TO_INTERNAL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long)
     1104DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, Platform3DObject)
     1105DELEGATE_TO_INTERNAL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, Platform3DObject, long)
    11881106DELEGATE_TO_INTERNAL_1(frontFace, unsigned long)
    11891107DELEGATE_TO_INTERNAL_1(generateMipmap, unsigned long)
    11901108
    1191 DELEGATE_TO_INTERNAL_3R(getActiveAttrib, WebGLProgram*, unsigned long, ActiveInfo&, bool)
    1192 DELEGATE_TO_INTERNAL_3R(getActiveUniform, WebGLProgram*, unsigned long, ActiveInfo&, bool)
    1193 
    1194 DELEGATE_TO_INTERNAL_4(getAttachedShaders, WebGLProgram*, int, int*, unsigned int*)
    1195 
    1196 DELEGATE_TO_INTERNAL_2R(getAttribLocation, WebGLProgram*, const String&, int)
     1109DELEGATE_TO_INTERNAL_3R(getActiveAttrib, Platform3DObject, unsigned long, ActiveInfo&, bool)
     1110DELEGATE_TO_INTERNAL_3R(getActiveUniform, Platform3DObject, unsigned long, ActiveInfo&, bool)
     1111
     1112DELEGATE_TO_INTERNAL_4(getAttachedShaders, Platform3DObject, int, int*, unsigned int*)
     1113
     1114DELEGATE_TO_INTERNAL_2R(getAttribLocation, Platform3DObject, const String&, int)
    11971115
    11981116DELEGATE_TO_INTERNAL_2(getBooleanv, unsigned long, unsigned char*)
     
    12101128DELEGATE_TO_INTERNAL_2(getIntegerv, unsigned long, int*)
    12111129
    1212 DELEGATE_TO_INTERNAL_3(getProgramiv, WebGLProgram*, unsigned long, int*)
    1213 
    1214 DELEGATE_TO_INTERNAL_1R(getProgramInfoLog, WebGLProgram*, String)
     1130DELEGATE_TO_INTERNAL_3(getProgramiv, Platform3DObject, unsigned long, int*)
     1131
     1132DELEGATE_TO_INTERNAL_1R(getProgramInfoLog, Platform3DObject, String)
    12151133
    12161134DELEGATE_TO_INTERNAL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*)
    12171135
    1218 DELEGATE_TO_INTERNAL_3(getShaderiv, WebGLShader*, unsigned long, int*)
    1219 
    1220 DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, WebGLShader*, String)
    1221 
    1222 DELEGATE_TO_INTERNAL_1R(getShaderSource, WebGLShader*, String)
     1136DELEGATE_TO_INTERNAL_3(getShaderiv, Platform3DObject, unsigned long, int*)
     1137
     1138DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, Platform3DObject, String)
     1139
     1140DELEGATE_TO_INTERNAL_1R(getShaderSource, Platform3DObject, String)
    12231141DELEGATE_TO_INTERNAL_1R(getString, unsigned long, String)
    12241142
     
    12261144DELEGATE_TO_INTERNAL_3(getTexParameteriv, unsigned long, unsigned long, int*)
    12271145
    1228 DELEGATE_TO_INTERNAL_3(getUniformfv, WebGLProgram*, long, float*)
    1229 DELEGATE_TO_INTERNAL_3(getUniformiv, WebGLProgram*, long, int*)
    1230 
    1231 DELEGATE_TO_INTERNAL_2R(getUniformLocation, WebGLProgram*, const String&, long)
     1146DELEGATE_TO_INTERNAL_3(getUniformfv, Platform3DObject, long, float*)
     1147DELEGATE_TO_INTERNAL_3(getUniformiv, Platform3DObject, long, int*)
     1148
     1149DELEGATE_TO_INTERNAL_2R(getUniformLocation, Platform3DObject, const String&, long)
    12321150
    12331151DELEGATE_TO_INTERNAL_3(getVertexAttribfv, unsigned long, unsigned long, float*)
     
    12371155
    12381156DELEGATE_TO_INTERNAL_2(hint, unsigned long, unsigned long)
    1239 DELEGATE_TO_INTERNAL_1R(isBuffer, WebGLBuffer*, bool)
     1157DELEGATE_TO_INTERNAL_1R(isBuffer, Platform3DObject, bool)
    12401158DELEGATE_TO_INTERNAL_1R(isEnabled, unsigned long, bool)
    1241 DELEGATE_TO_INTERNAL_1R(isFramebuffer, WebGLFramebuffer*, bool)
    1242 DELEGATE_TO_INTERNAL_1R(isProgram, WebGLProgram*, bool)
    1243 DELEGATE_TO_INTERNAL_1R(isRenderbuffer, WebGLRenderbuffer*, bool)
    1244 DELEGATE_TO_INTERNAL_1R(isShader, WebGLShader*, bool)
    1245 DELEGATE_TO_INTERNAL_1R(isTexture, WebGLTexture*, bool)
     1159DELEGATE_TO_INTERNAL_1R(isFramebuffer, Platform3DObject, bool)
     1160DELEGATE_TO_INTERNAL_1R(isProgram, Platform3DObject, bool)
     1161DELEGATE_TO_INTERNAL_1R(isRenderbuffer, Platform3DObject, bool)
     1162DELEGATE_TO_INTERNAL_1R(isShader, Platform3DObject, bool)
     1163DELEGATE_TO_INTERNAL_1R(isTexture, Platform3DObject, bool)
    12461164DELEGATE_TO_INTERNAL_1(lineWidth, double)
    1247 DELEGATE_TO_INTERNAL_1(linkProgram, WebGLProgram*)
     1165DELEGATE_TO_INTERNAL_1(linkProgram, Platform3DObject)
    12481166DELEGATE_TO_INTERNAL_2(pixelStorei, unsigned long, long)
    12491167DELEGATE_TO_INTERNAL_2(polygonOffset, double, double)
     
    12551173DELEGATE_TO_INTERNAL_2(sampleCoverage, double, bool)
    12561174DELEGATE_TO_INTERNAL_4(scissor, long, long, unsigned long, unsigned long)
    1257 DELEGATE_TO_INTERNAL_2(shaderSource, WebGLShader*, const String&)
     1175DELEGATE_TO_INTERNAL_2(shaderSource, Platform3DObject, const String&)
    12581176DELEGATE_TO_INTERNAL_3(stencilFunc, unsigned long, long, unsigned long)
    12591177DELEGATE_TO_INTERNAL_4(stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long)
     
    12881206DELEGATE_TO_INTERNAL_4(uniformMatrix4fv, long, bool, float*, int)
    12891207
    1290 DELEGATE_TO_INTERNAL_1(useProgram, WebGLProgram*)
    1291 DELEGATE_TO_INTERNAL_1(validateProgram, WebGLProgram*)
     1208DELEGATE_TO_INTERNAL_1(useProgram, Platform3DObject)
     1209DELEGATE_TO_INTERNAL_1(validateProgram, Platform3DObject)
    12921210
    12931211DELEGATE_TO_INTERNAL_2(vertexAttrib1f, unsigned long, float)
     
    13031221DELEGATE_TO_INTERNAL_4(viewport, long, long, unsigned long, unsigned long)
    13041222
    1305 DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, WebGLRenderingContext*)
    1306 DELEGATE_TO_INTERNAL_1(beginPaint, WebGLRenderingContext*)
     1223DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, CanvasRenderingContext*)
     1224DELEGATE_TO_INTERNAL_1(beginPaint, CanvasRenderingContext*)
    13071225DELEGATE_TO_INTERNAL(endPaint)
    13081226
Note: See TracChangeset for help on using the changeset viewer.