Changeset 79011 in webkit


Ignore:
Timestamp:
Feb 18, 2011 10:42:59 AM (13 years ago)
Author:
kbr@google.com
Message:

2011-02-18 Ben Vanik <benvanik@google.com>

Reviewed by Kenneth Russell.

Bug 53940: Implement the OES_vertex_array_object WebGL extension
https://bugs.webkit.org/show_bug.cgi?id=53940

Stubbed out methods for the new OES_vertex_array_object methods.

  • src/Extensions3DChromium.cpp: (WebCore::Extensions3DChromium::createVertexArrayOES): (WebCore::Extensions3DChromium::deleteVertexArrayOES): (WebCore::Extensions3DChromium::isVertexArrayOES): (WebCore::Extensions3DChromium::bindVertexArrayOES):

2011-02-18 Ben Vanik <benvanik@google.com>

Reviewed by Kenneth Russell.

Bug 53940: Implement the OES_vertex_array_object WebGL extension
https://bugs.webkit.org/show_bug.cgi?id=53940

Initial implementation of the OES_vertex_array_object extension adding the OESVertexArrayObject
extension container and WebGLVertexArrayObjectOES VAO object. The extension is plumbed through
the Extensions3D interface and implemented in the Extensions3DOpenGL (WebKit/OSX) version when
it is available.
Two big changes touching code outside of the extension files:

  • Moved the typedefs at the top of GraphicsContext3D.h to GraphicsTypes3D.h (modeled after GraphicsTypes.h). They are not namespaced as they weren't before.
  • To make the code cleaner/clearer all vertex attribute state has been moved to the WebGLVertexArrayObjectOES type (struct VertexAttribState) except for values which are still on the WebGLRenderingContext. A default VAO is now used to store the existing attribute states for when no other VAO is used. Code in WebGLRenderingContext dealing with buffers and vertex attributes now defers to or stores values in the bound array object.

Tested against the WebGL conformance suite and the new
oes-vertex-array-object test:
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/oes-vertex-array-object.html

  • CMakeLists.txt:
  • CodeGenerators.pri:
  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.gyp: Modified property svn:ignore.
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::toJS):
  • bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: (WebCore::toV8Object):
  • html/canvas/OESVertexArrayObject.cpp: Added. (WebCore::OESVertexArrayObject::OESVertexArrayObject): (WebCore::OESVertexArrayObject::~OESVertexArrayObject): (WebCore::OESVertexArrayObject::getName): (WebCore::OESVertexArrayObject::create): (WebCore::OESVertexArrayObject::createVertexArrayOES): (WebCore::OESVertexArrayObject::deleteVertexArrayOES): (WebCore::OESVertexArrayObject::isVertexArrayOES): (WebCore::OESVertexArrayObject::bindVertexArrayOES):
  • html/canvas/OESVertexArrayObject.h: Added.
  • html/canvas/OESVertexArrayObject.idl: Added.
  • html/canvas/WebGLExtension.h:
  • html/canvas/WebGLGetInfo.cpp: (WebCore::WebGLGetInfo::WebGLGetInfo): (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
  • html/canvas/WebGLGetInfo.h:
  • html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::initializeNewContext): (WebCore::WebGLRenderingContext::bindBuffer): (WebCore::WebGLRenderingContext::deleteBuffer): (WebCore::WebGLRenderingContext::disableVertexAttribArray): (WebCore::WebGLRenderingContext::validateElementArraySize): (WebCore::WebGLRenderingContext::validateIndexArrayConservative): (WebCore::WebGLRenderingContext::validateIndexArrayPrecise): (WebCore::WebGLRenderingContext::validateRenderingState): (WebCore::WebGLRenderingContext::drawElements): (WebCore::WebGLRenderingContext::enableVertexAttribArray): (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getParameter): (WebCore::WebGLRenderingContext::getSupportedExtensions): (WebCore::WebGLRenderingContext::getVertexAttrib): (WebCore::WebGLRenderingContext::vertexAttribPointer): (WebCore::WebGLRenderingContext::validateBufferDataParameters): (WebCore::WebGLRenderingContext::vertexAttribfImpl): (WebCore::WebGLRenderingContext::vertexAttribfvImpl): (WebCore::WebGLRenderingContext::initVertexAttrib0): (WebCore::WebGLRenderingContext::simulateVertexAttrib0): (WebCore::WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation): (WebCore::WebGLRenderingContext::getNumberOfExtensions): (WebCore::WebGLRenderingContext::getExtensionNumber):
  • html/canvas/WebGLRenderingContext.h: (WebCore::WebGLRenderingContext::getMaxVertexAttribs): (WebCore::WebGLRenderingContext::setBoundVertexArrayObject): (WebCore::WebGLRenderingContext::VertexAttribValue::VertexAttribValue):
  • html/canvas/WebGLVertexArrayObjectOES.cpp: Added. (WebCore::WebGLVertexArrayObjectOES::create): (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES): (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
  • html/canvas/WebGLVertexArrayObjectOES.h: Added. (WebCore::WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES): (WebCore::WebGLVertexArrayObjectOES::VertexAttribState::VertexAttribState): (WebCore::WebGLVertexArrayObjectOES::isDefaultObject): (WebCore::WebGLVertexArrayObjectOES::hasEverBeenBound): (WebCore::WebGLVertexArrayObjectOES::setHasEverBeenBound): (WebCore::WebGLVertexArrayObjectOES::getElementArrayBuffer): (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): (WebCore::WebGLVertexArrayObjectOES::getVertexAttribState): (WebCore::WebGLVertexArrayObjectOES::isVertexArray):
  • html/canvas/WebGLVertexArrayObjectOES.idl: Added.
  • platform/graphics/Extensions3D.h:
  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/GraphicsTypes3D.h: Added.
  • platform/graphics/chromium/Extensions3DChromium.h:
  • platform/graphics/opengl/Extensions3DOpenGL.cpp: (WebCore::Extensions3DOpenGL::supports): (WebCore::Extensions3DOpenGL::createVertexArrayOES): (WebCore::Extensions3DOpenGL::deleteVertexArrayOES): (WebCore::Extensions3DOpenGL::isVertexArrayOES): (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
  • platform/graphics/opengl/Extensions3DOpenGL.h:
  • platform/graphics/qt/Extensions3DQt.cpp: (WebCore::Extensions3DQt::createVertexArrayOES): (WebCore::Extensions3DQt::deleteVertexArrayOES): (WebCore::Extensions3DQt::isVertexArrayOES): (WebCore::Extensions3DQt::bindVertexArrayOES):
  • platform/graphics/qt/Extensions3DQt.h:
Location:
trunk/Source
Files:
7 added
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r78914 r79011  
    295295    html/canvas/OESStandardDerivatives.idl
    296296    html/canvas/OESTextureFloat.idl
     297    html/canvas/OESVertexArrayObject.idl
    297298    html/canvas/Uint16Array.idl
    298299    html/canvas/Uint32Array.idl
     
    308309    html/canvas/WebGLTexture.idl
    309310    html/canvas/WebGLUniformLocation.idl
     311    html/canvas/WebGLVertexArrayObjectOES.idl
    310312    html/canvas/WebKitLoseContext.idl
    311313
  • trunk/Source/WebCore/ChangeLog

    r79009 r79011  
     12011-02-18  Ben Vanik  <benvanik@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Bug 53940: Implement the OES_vertex_array_object WebGL extension
     6        https://bugs.webkit.org/show_bug.cgi?id=53940
     7
     8        Initial implementation of the OES_vertex_array_object extension adding the OESVertexArrayObject
     9        extension container and WebGLVertexArrayObjectOES VAO object. The extension is plumbed through
     10        the Extensions3D interface and implemented in the Extensions3DOpenGL (WebKit/OSX) version when
     11        it is available.
     12        Two big changes touching code outside of the extension files:
     13        * Moved the typedefs at the top of GraphicsContext3D.h to GraphicsTypes3D.h (modeled after
     14          GraphicsTypes.h). They are not namespaced as they weren't before.
     15        * To make the code cleaner/clearer all vertex attribute state has been moved to the
     16          WebGLVertexArrayObjectOES type (struct VertexAttribState) except for values which are still
     17          on the WebGLRenderingContext. A default VAO is now used to store the existing attribute
     18          states for when no other VAO is used. Code in WebGLRenderingContext dealing with buffers and
     19          vertex attributes now defers to or stores values in the bound array object.
     20
     21        Tested against the WebGL conformance suite and the new
     22        oes-vertex-array-object test:
     23        https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/oes-vertex-array-object.html
     24
     25        * CMakeLists.txt:
     26        * CodeGenerators.pri:
     27        * DerivedSources.make:
     28        * GNUmakefile.am:
     29        * WebCore.gyp: Modified property svn:ignore.
     30        * WebCore.gypi:
     31        * WebCore.pro:
     32        * WebCore.xcodeproj/project.pbxproj:
     33        * bindings/js/JSWebGLRenderingContextCustom.cpp:
     34        (WebCore::toJS):
     35        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
     36        (WebCore::toV8Object):
     37        * html/canvas/OESVertexArrayObject.cpp: Added.
     38        (WebCore::OESVertexArrayObject::OESVertexArrayObject):
     39        (WebCore::OESVertexArrayObject::~OESVertexArrayObject):
     40        (WebCore::OESVertexArrayObject::getName):
     41        (WebCore::OESVertexArrayObject::create):
     42        (WebCore::OESVertexArrayObject::createVertexArrayOES):
     43        (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
     44        (WebCore::OESVertexArrayObject::isVertexArrayOES):
     45        (WebCore::OESVertexArrayObject::bindVertexArrayOES):
     46        * html/canvas/OESVertexArrayObject.h: Added.
     47        * html/canvas/OESVertexArrayObject.idl: Added.
     48        * html/canvas/WebGLExtension.h:
     49        * html/canvas/WebGLGetInfo.cpp:
     50        (WebCore::WebGLGetInfo::WebGLGetInfo):
     51        (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
     52        * html/canvas/WebGLGetInfo.h:
     53        * html/canvas/WebGLRenderingContext.cpp:
     54        (WebCore::WebGLRenderingContext::initializeNewContext):
     55        (WebCore::WebGLRenderingContext::bindBuffer):
     56        (WebCore::WebGLRenderingContext::deleteBuffer):
     57        (WebCore::WebGLRenderingContext::disableVertexAttribArray):
     58        (WebCore::WebGLRenderingContext::validateElementArraySize):
     59        (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
     60        (WebCore::WebGLRenderingContext::validateIndexArrayPrecise):
     61        (WebCore::WebGLRenderingContext::validateRenderingState):
     62        (WebCore::WebGLRenderingContext::drawElements):
     63        (WebCore::WebGLRenderingContext::enableVertexAttribArray):
     64        (WebCore::WebGLRenderingContext::getExtension):
     65        (WebCore::WebGLRenderingContext::getParameter):
     66        (WebCore::WebGLRenderingContext::getSupportedExtensions):
     67        (WebCore::WebGLRenderingContext::getVertexAttrib):
     68        (WebCore::WebGLRenderingContext::vertexAttribPointer):
     69        (WebCore::WebGLRenderingContext::validateBufferDataParameters):
     70        (WebCore::WebGLRenderingContext::vertexAttribfImpl):
     71        (WebCore::WebGLRenderingContext::vertexAttribfvImpl):
     72        (WebCore::WebGLRenderingContext::initVertexAttrib0):
     73        (WebCore::WebGLRenderingContext::simulateVertexAttrib0):
     74        (WebCore::WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation):
     75        (WebCore::WebGLRenderingContext::getNumberOfExtensions):
     76        (WebCore::WebGLRenderingContext::getExtensionNumber):
     77        * html/canvas/WebGLRenderingContext.h:
     78        (WebCore::WebGLRenderingContext::getMaxVertexAttribs):
     79        (WebCore::WebGLRenderingContext::setBoundVertexArrayObject):
     80        (WebCore::WebGLRenderingContext::VertexAttribValue::VertexAttribValue):
     81        * html/canvas/WebGLVertexArrayObjectOES.cpp: Added.
     82        (WebCore::WebGLVertexArrayObjectOES::create):
     83        (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
     84        (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
     85        * html/canvas/WebGLVertexArrayObjectOES.h: Added.
     86        (WebCore::WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES):
     87        (WebCore::WebGLVertexArrayObjectOES::VertexAttribState::VertexAttribState):
     88        (WebCore::WebGLVertexArrayObjectOES::isDefaultObject):
     89        (WebCore::WebGLVertexArrayObjectOES::hasEverBeenBound):
     90        (WebCore::WebGLVertexArrayObjectOES::setHasEverBeenBound):
     91        (WebCore::WebGLVertexArrayObjectOES::getElementArrayBuffer):
     92        (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer):
     93        (WebCore::WebGLVertexArrayObjectOES::getVertexAttribState):
     94        (WebCore::WebGLVertexArrayObjectOES::isVertexArray):
     95        * html/canvas/WebGLVertexArrayObjectOES.idl: Added.
     96        * platform/graphics/Extensions3D.h:
     97        * platform/graphics/GraphicsContext3D.h:
     98        * platform/graphics/GraphicsTypes3D.h: Added.
     99        * platform/graphics/chromium/Extensions3DChromium.h:
     100        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
     101        (WebCore::Extensions3DOpenGL::supports):
     102        (WebCore::Extensions3DOpenGL::createVertexArrayOES):
     103        (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
     104        (WebCore::Extensions3DOpenGL::isVertexArrayOES):
     105        (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
     106        * platform/graphics/opengl/Extensions3DOpenGL.h:
     107        * platform/graphics/qt/Extensions3DQt.cpp:
     108        (WebCore::Extensions3DQt::createVertexArrayOES):
     109        (WebCore::Extensions3DQt::deleteVertexArrayOES):
     110        (WebCore::Extensions3DQt::isVertexArrayOES):
     111        (WebCore::Extensions3DQt::bindVertexArrayOES):
     112        * platform/graphics/qt/Extensions3DQt.h:
     113
    11142011-02-17  Alexander Pavlov  <apavlov@chromium.org>
    2115
  • trunk/Source/WebCore/CodeGenerators.pri

    r78803 r79011  
    199199    html/canvas/OESStandardDerivatives.idl \
    200200    html/canvas/OESTextureFloat.idl \
     201    html/canvas/OESVertexArrayObject.idl \
    201202    html/canvas/WebGLActiveInfo.idl \
    202203    html/canvas/WebGLBuffer.idl \
     
    210211    html/canvas/WebGLTexture.idl \
    211212    html/canvas/WebGLUniformLocation.idl \
     213    html/canvas/WebGLVertexArrayObjectOES.idl \
    212214    html/canvas/WebKitLoseContext.idl \
    213215    html/canvas/Uint8Array.idl \
  • trunk/Source/WebCore/DerivedSources.make

    r78525 r79011  
    313313    OESStandardDerivatives \
    314314    OESTextureFloat \
     315     OESVertexArrayObject \
     316     WebGLVertexArrayObjectOES \
    315317    OverflowEvent \
    316318    PageTransitionEvent \
  • trunk/Source/WebCore/GNUmakefile.am

    r78981 r79011  
    487487        DerivedSources/WebCore/JSOESTextureFloat.cpp \
    488488        DerivedSources/WebCore/JSOESTextureFloat.h \
     489        DerivedSources/WebCore/JSOESVertexArrayObject.cpp \
     490        DerivedSources/WebCore/JSOESVertexArrayObject.h \
    489491        DerivedSources/WebCore/JSOverflowEvent.cpp \
    490492        DerivedSources/WebCore/JSOverflowEvent.h \
     
    593595        DerivedSources/WebCore/JSWebGLUniformLocation.cpp \
    594596        DerivedSources/WebCore/JSWebGLUniformLocation.h \
     597        DerivedSources/WebCore/JSWebGLVertexArrayObjectOES.cpp \
     598        DerivedSources/WebCore/JSWebGLVertexArrayObjectOES.h \
    595599        DerivedSources/WebCore/JSWebKitAnimationEvent.cpp \
    596600        DerivedSources/WebCore/JSWebKitAnimationEvent.h \
     
    15881592        Source/WebCore/html/canvas/Int8Array.h \
    15891593        Source/WebCore/html/canvas/IntegralTypedArrayBase.h \
    1590         Source/WebCore/html/canvas/OESStandardDerivatives.cpp \
    1591         Source/WebCore/html/canvas/OESStandardDerivatives.h \
    1592         Source/WebCore/html/canvas/OESTextureFloat.cpp \
    1593         Source/WebCore/html/canvas/OESTextureFloat.h \
    15941594        Source/WebCore/html/canvas/TypedArrayBase.h \
    1595         Source/WebCore/html/canvas/WebKitLoseContext.cpp \
    1596         Source/WebCore/html/canvas/WebKitLoseContext.h \
    15971595        Source/WebCore/html/canvas/Uint16Array.cpp \
    15981596        Source/WebCore/html/canvas/Uint16Array.h \
     
    24402438        Source/WebCore/platform/graphics/GraphicsTypes.cpp \
    24412439        Source/WebCore/platform/graphics/GraphicsTypes.h \
     2440        Source/WebCore/platform/graphics/GraphicsTypes3D.h \
    24422441        Source/WebCore/platform/graphics/Icon.h \
    24432442        Source/WebCore/platform/graphics/ImageBuffer.cpp \
     
    48244823        Source/WebCore/html/canvas/WebGLTexture.h \
    48254824        Source/WebCore/html/canvas/WebGLUniformLocation.cpp \
    4826         Source/WebCore/html/canvas/WebGLUniformLocation.h
     4825        Source/WebCore/html/canvas/WebGLUniformLocation.h \
     4826        Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp \
     4827        Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h \
     4828        Source/WebCore/html/canvas/OESStandardDerivatives.cpp \
     4829        Source/WebCore/html/canvas/OESStandardDerivatives.h \
     4830        Source/WebCore/html/canvas/OESTextureFloat.cpp \
     4831        Source/WebCore/html/canvas/OESTextureFloat.h \
     4832        Source/WebCore/html/canvas/OESVertexArrayObject.cpp \
     4833        Source/WebCore/html/canvas/OESVertexArrayObject.h \
     4834        Source/WebCore/html/canvas/OESVertexArray.cpp \
     4835        Source/WebCore/html/canvas/OESVertexArray.h \
     4836        Source/WebCore/html/canvas/WebKitLoseContext.cpp \
     4837        Source/WebCore/html/canvas/WebKitLoseContext.h
    48274838endif  # END ENABLE_WEBGL
    48284839
  • trunk/Source/WebCore/WebCore.gypi

    r78923 r79011  
    219219            'html/canvas/OESStandardDerivatives.idl',
    220220            'html/canvas/OESTextureFloat.idl',
     221            'html/canvas/OESVertexArrayObject.idl',
    221222            'html/canvas/Uint16Array.idl',
    222223            'html/canvas/Uint32Array.idl',
     
    233234            'html/canvas/WebGLTexture.idl',
    234235            'html/canvas/WebGLUniformLocation.idl',
     236            'html/canvas/WebGLVertexArrayObjectOES.idl',
    235237            'html/canvas/WebKitLoseContext.idl',
    236238            'inspector/InjectedScriptHost.idl',
     
    19341936            'html/canvas/OESTextureFloat.cpp',
    19351937            'html/canvas/OESTextureFloat.h',
     1938            'html/canvas/OESVertexArrayObject.cpp',
     1939            'html/canvas/OESVertexArrayObject.h',
    19361940            'html/canvas/TypedArrayBase.h',
    19371941            'html/canvas/Uint16Array.cpp',
     
    19671971            'html/canvas/WebGLUniformLocation.cpp',
    19681972            'html/canvas/WebGLUniformLocation.h',
     1973            'html/canvas/WebGLVertexArrayObjectOES.cpp',
     1974            'html/canvas/WebGLVertexArrayObjectOES.h',
    19691975            'html/canvas/WebKitLoseContext.cpp',
    19701976            'html/canvas/WebKitLoseContext.h',
     
    29672973            'platform/graphics/GraphicsTypes.cpp',
    29682974            'platform/graphics/GraphicsTypes.h',
     2975            'platform/graphics/GraphicsTypes3D.h',
    29692976            'platform/graphics/Icon.h',
    29702977            'platform/graphics/Image.cpp',
  • trunk/Source/WebCore/WebCore.pro

    r78914 r79011  
    20342034    platform/graphics/GraphicsLayerClient.h \
    20352035    platform/graphics/GraphicsTypes.h \
     2036    platform/graphics/GraphicsTypes3D.h \
    20362037    platform/graphics/Image.h \
    20372038    platform/graphics/ImageSource.h \
     
    36913692        html/canvas/OESStandardDerivatives.h \
    36923693        html/canvas/OESTextureFloat.h \
     3694        html/canvas/OESVertexArrayObject.h \
     3695        html/canvas/OESVertexArray.h \
    36933696        html/canvas/WebGLTexture.h \
    36943697        html/canvas/WebGLUniformLocation.h \
     
    37183721        html/canvas/OESStandardDerivatives.cpp \
    37193722        html/canvas/OESTextureFloat.cpp \
     3723        html/canvas/OESVertexArrayObject.cpp \
     3724        html/canvas/OESVertexArray.cpp \
    37203725        html/canvas/WebGLTexture.cpp \
    37213726        html/canvas/WebGLUniformLocation.cpp \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r78914 r79011  
    16321632                76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 76FC2B0912370DA0006A991A /* DOMTokenList.h */; };
    16331633                76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76FF17E211235673001D61B5 /* PluginViewNone.cpp */; };
     1634                77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17A6E12F28182004E02F6 /* OESVertexArrayObject.cpp */; };
     1635                77A17A7212F28182004E02F6 /* OESVertexArrayObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A17A6F12F28182004E02F6 /* OESVertexArrayObject.h */; };
     1636                77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17A7412F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp */; };
     1637                77A17A7812F28642004E02F6 /* WebGLVertexArrayObjectOES.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A17A7512F28642004E02F6 /* WebGLVertexArrayObjectOES.h */; };
     1638                77A17A7B12F2890B004E02F6 /* GraphicsTypes3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A17A7A12F2890B004E02F6 /* GraphicsTypes3D.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1639                77A17AA612F28B2A004E02F6 /* JSOESVertexArrayObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17AA212F28B2A004E02F6 /* JSOESVertexArrayObject.cpp */; };
     1640                77A17AA712F28B2A004E02F6 /* JSOESVertexArrayObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A17AA312F28B2A004E02F6 /* JSOESVertexArrayObject.h */; };
     1641                77EF62F312F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77EF62F112F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.cpp */; };
     1642                77EF62F412F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h in Headers */ = {isa = PBXBuildFile; fileRef = 77EF62F212F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h */; };
    16341643                79AC9218109945C80021266E /* JSCompositionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 79AC9216109945C80021266E /* JSCompositionEvent.cpp */; };
    16351644                79AC9219109945C80021266E /* JSCompositionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 79AC9217109945C80021266E /* JSCompositionEvent.h */; };
     
    80698078                76FC2B0A12370DA0006A991A /* DOMTokenList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMTokenList.idl; sourceTree = "<group>"; };
    80708079                76FF17E211235673001D61B5 /* PluginViewNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginViewNone.cpp; sourceTree = "<group>"; };
     8080                77A17A6E12F28182004E02F6 /* OESVertexArrayObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESVertexArrayObject.cpp; path = canvas/OESVertexArrayObject.cpp; sourceTree = "<group>"; };
     8081                77A17A6F12F28182004E02F6 /* OESVertexArrayObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESVertexArrayObject.h; path = canvas/OESVertexArrayObject.h; sourceTree = "<group>"; };
     8082                77A17A7012F28182004E02F6 /* OESVertexArrayObject.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OESVertexArrayObject.idl; path = canvas/OESVertexArrayObject.idl; sourceTree = "<group>"; };
     8083                77A17A7412F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLVertexArrayObjectOES.cpp; path = canvas/WebGLVertexArrayObjectOES.cpp; sourceTree = "<group>"; };
     8084                77A17A7512F28642004E02F6 /* WebGLVertexArrayObjectOES.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLVertexArrayObjectOES.h; path = canvas/WebGLVertexArrayObjectOES.h; sourceTree = "<group>"; };
     8085                77A17A7612F28642004E02F6 /* WebGLVertexArrayObjectOES.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLVertexArrayObjectOES.idl; path = canvas/WebGLVertexArrayObjectOES.idl; sourceTree = "<group>"; };
     8086                77A17A7A12F2890B004E02F6 /* GraphicsTypes3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsTypes3D.h; sourceTree = "<group>"; };
     8087                77A17AA212F28B2A004E02F6 /* JSOESVertexArrayObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESVertexArrayObject.cpp; sourceTree = "<group>"; };
     8088                77A17AA312F28B2A004E02F6 /* JSOESVertexArrayObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESVertexArrayObject.h; sourceTree = "<group>"; };
     8089                77EF62F112F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLVertexArrayObjectOES.cpp; sourceTree = "<group>"; };
     8090                77EF62F212F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLVertexArrayObjectOES.h; sourceTree = "<group>"; };
    80718091                79AC9216109945C80021266E /* JSCompositionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCompositionEvent.cpp; sourceTree = "<group>"; };
    80728092                79AC9217109945C80021266E /* JSCompositionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCompositionEvent.h; sourceTree = "<group>"; };
     
    1329213312                                6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */,
    1329313313                                6EBF0E4712A8926100DB1709 /* OESTextureFloat.idl */,
     13314                                77A17A6E12F28182004E02F6 /* OESVertexArrayObject.cpp */,
     13315                                77A17A6F12F28182004E02F6 /* OESVertexArrayObject.h */,
     13316                                77A17A7012F28182004E02F6 /* OESVertexArrayObject.idl */,
    1329413317                                6E96BB1B11986EE1007D94CD /* TypedArrayBase.h */,
    1329513318                                49EECDDC10503C2300099FAB /* Uint16Array.cpp */,
     
    1334013363                                0C3F1F5810C8871200D72CE1 /* WebGLUniformLocation.h */,
    1334113364                                0C3F1F5910C8871200D72CE1 /* WebGLUniformLocation.idl */,
     13365                                77A17A7412F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp */,
     13366                                77A17A7512F28642004E02F6 /* WebGLVertexArrayObjectOES.h */,
     13367                                77A17A7612F28642004E02F6 /* WebGLVertexArrayObjectOES.idl */,
    1334213368                                93F1D5B712D532C400832BEC /* WebKitLoseContext.cpp */,
    1334313369                                93F1D5B812D532C400832BEC /* WebKitLoseContext.h */,
     
    1621216238                                6EBF0E7412A9868800DB1709 /* JSOESTextureFloat.cpp */,
    1621316239                                6EBF0E7512A9868800DB1709 /* JSOESTextureFloat.h */,
     16240                                77A17AA212F28B2A004E02F6 /* JSOESVertexArrayObject.cpp */,
     16241                                77A17AA312F28B2A004E02F6 /* JSOESVertexArrayObject.h */,
    1621416242                                BCEF45F30E687B5C001C1287 /* JSTextMetrics.cpp */,
    1621516243                                BCEF45F40E687B5C001C1287 /* JSTextMetrics.h */,
     
    1624416272                                0C45342510CDBBFA00869157 /* JSWebGLUniformLocation.cpp */,
    1624516273                                0C45342610CDBBFA00869157 /* JSWebGLUniformLocation.h */,
     16274                                77EF62F112F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.cpp */,
     16275                                77EF62F212F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h */,
    1624616276                                93F1D5BE12D5335600832BEC /* JSWebKitLoseContext.cpp */,
    1624716277                                93F1D5BF12D5335600832BEC /* JSWebKitLoseContext.h */,
     
    1748117511                                B2A015940AF6CD53006BCE0E /* GraphicsTypes.cpp */,
    1748217512                                B2A015950AF6CD53006BCE0E /* GraphicsTypes.h */,
     17513                                77A17A7A12F2890B004E02F6 /* GraphicsTypes3D.h */,
    1748317514                                B27535400B053814002CE64F /* Icon.h */,
    1748417515                                B27535410B053814002CE64F /* Image.cpp */,
     
    2243622467                                9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */,
    2243722468                                977E2E0F12F0FC9C00C13379 /* XSSFilter.h in Headers */,
     22469                                77A17A7212F28182004E02F6 /* OESVertexArrayObject.h in Headers */,
     22470                                77A17A7812F28642004E02F6 /* WebGLVertexArrayObjectOES.h in Headers */,
     22471                                77A17A7B12F2890B004E02F6 /* GraphicsTypes3D.h in Headers */,
     22472                                77A17AA712F28B2A004E02F6 /* JSOESVertexArrayObject.h in Headers */,
     22473                                77EF62F412F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h in Headers */,
    2243822474                                975CA28B130365F800E99AD9 /* Crypto.h in Headers */,
    2243922475                                975CA2A21303679D00E99AD9 /* JSCrypto.h in Headers */,
     
    2511825154                                9343CB8112F25E510033C5EE /* TextCodecUTF8.cpp in Sources */,
    2511925155                                977E2E0E12F0FC9C00C13379 /* XSSFilter.cpp in Sources */,
     25156                                77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */,
     25157                                77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */,
     25158                                77A17AA612F28B2A004E02F6 /* JSOESVertexArrayObject.cpp in Sources */,
     25159                                77EF62F312F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.cpp in Sources */,
    2512025160                                0F29C16E1300C2E2002D794E /* AccessibilityAllInOne.cpp in Sources */,
    2512125161                                975CA28A130365F800E99AD9 /* Crypto.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp

    r76601 r79011  
    4040#include "JSOESStandardDerivatives.h"
    4141#include "JSOESTextureFloat.h"
     42#include "JSOESVertexArrayObject.h"
     43#include "JSWebGLVertexArrayObjectOES.h"
    4244#include "JSWebGLBuffer.h"
    4345#include "JSFloat32Array.h"
     
    5456#include "OESStandardDerivatives.h"
    5557#include "OESTextureFloat.h"
     58#include "OESVertexArrayObject.h"
     59#include "WebGLVertexArrayObjectOES.h"
    5660#include "WebGLBuffer.h"
    5761#include "Float32Array.h"
     
    116120    case WebGLGetInfo::kTypeWebGLUnsignedByteArray:
    117121        return toJS(exec, globalObject, info.getWebGLUnsignedByteArray());
     122    case WebGLGetInfo::kTypeWebGLVertexArrayObjectOES:
     123        return toJS(exec, globalObject, info.getWebGLVertexArrayObjectOES());
    118124    default:
    119125        notImplemented();
     
    180186    case WebGLExtension::OESTextureFloatName:
    181187        return toJS(exec, globalObject, static_cast<OESTextureFloat*>(extension));
     188    case WebGLExtension::OESVertexArrayObjectName:
     189        return toJS(exec, globalObject, static_cast<OESVertexArrayObject*>(extension));
    182190    }
    183191    ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp

    r76601 r79011  
    5151#include "V8OESStandardDerivatives.h"
    5252#include "V8OESTextureFloat.h"
     53#include "V8OESVertexArrayObject.h"
    5354#include "V8Proxy.h"
    5455#include "V8Uint16Array.h"
     
    6263#include "V8WebGLTexture.h"
    6364#include "V8WebGLUniformLocation.h"
     65#include "V8WebGLVertexArrayObjectOES.h"
    6466#include "WebGLRenderingContext.h"
    6567#include <wtf/FastMalloc.h>
     
    147149    case WebGLGetInfo::kTypeWebGLUnsignedByteArray:
    148150        return toV8(info.getWebGLUnsignedByteArray());
     151    case WebGLGetInfo::kTypeWebGLVertexArrayObjectOES:
     152        return toV8(info.getWebGLVertexArrayObjectOES());
    149153    default:
    150154        notImplemented();
     
    167171    case WebGLExtension::OESTextureFloatName:
    168172        extensionObject = toV8(static_cast<OESTextureFloat*>(extension));
     173        break;
     174    case WebGLExtension::OESVertexArrayObjectName:
     175        extensionObject = toV8(static_cast<OESVertexArrayObject*>(extension));
    169176        break;
    170177    }
  • trunk/Source/WebCore/html/canvas/WebGLExtension.h

    r76324 r79011  
    3838        OESTextureFloatName,
    3939        OESStandardDerivativesName,
     40        OESVertexArrayObjectName,
    4041    };
    4142
  • trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp

    r76601 r79011  
    3939#include "WebGLRenderbuffer.h"
    4040#include "WebGLTexture.h"
     41#include "WebGLVertexArrayObjectOES.h"
    4142
    4243namespace WebCore {
     
    135136}
    136137
     138WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES> value)
     139    : m_type(kTypeWebGLVertexArrayObjectOES)
     140    , m_webglVertexArrayObject(value)
     141{
     142}
     143
    137144WebGLGetInfo::~WebGLGetInfo()
    138145{
     
    228235}
    229236
     237PassRefPtr<WebGLVertexArrayObjectOES> WebGLGetInfo::getWebGLVertexArrayObjectOES() const
     238{
     239    ASSERT(getType() == kTypeWebGLVertexArrayObjectOES);
     240    return m_webglVertexArrayObject;
     241}
     242
    230243} // namespace WebCore
    231244
  • trunk/Source/WebCore/html/canvas/WebGLGetInfo.h

    r76601 r79011  
    3737#include "WebGLRenderbuffer.h"
    3838#include "WebGLTexture.h"
     39#include "WebGLVertexArrayObjectOES.h"
    3940
    4041#include <wtf/PassRefPtr.h>
     
    6667        kTypeWebGLRenderbuffer,
    6768        kTypeWebGLTexture,
    68         kTypeWebGLUnsignedByteArray
     69        kTypeWebGLUnsignedByteArray,
     70        kTypeWebGLVertexArrayObjectOES,
    6971    };
    7072
     
    8789    WebGLGetInfo(PassRefPtr<WebGLTexture> value);
    8890    WebGLGetInfo(PassRefPtr<Uint8Array> value);
     91    WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES> value);
    8992
    9093    virtual ~WebGLGetInfo();
     
    108111    PassRefPtr<WebGLTexture> getWebGLTexture() const;
    109112    PassRefPtr<Uint8Array> getWebGLUnsignedByteArray() const;
     113    PassRefPtr<WebGLVertexArrayObjectOES> getWebGLVertexArrayObjectOES() const;
    110114
    111115private:
     
    127131    RefPtr<WebGLTexture> m_webglTexture;
    128132    RefPtr<Uint8Array> m_webglUnsignedByteArray;
     133    RefPtr<WebGLVertexArrayObjectOES> m_webglVertexArrayObject;
    129134};
    130135
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r78921 r79011  
    4747#include "OESStandardDerivatives.h"
    4848#include "OESTextureFloat.h"
     49#include "OESVertexArrayObject.h"
    4950#include "RenderBox.h"
    5051#include "RenderLayer.h"
     
    403404    m_unpackColorspaceConversion = GraphicsContext3D::BROWSER_DEFAULT_WEBGL;
    404405    m_boundArrayBuffer = 0;
    405     m_boundElementArrayBuffer = 0;
    406406    m_currentProgram = 0;
    407407    m_framebufferBinding = 0;
     
    413413    m_stencilFuncMask = 0xFFFFFFFF;
    414414    m_stencilFuncMaskBack = 0xFFFFFFFF;
    415     m_vertexAttribState.clear();
    416415
    417416    GC3Dint numCombinedTextureImageUnits = 0;
     
    423422    m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &numVertexAttribs);
    424423    m_maxVertexAttribs = numVertexAttribs;
    425 
     424   
    426425    m_maxTextureSize = 0;
    427426    m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize);
     
    430429    m_context->getIntegerv(GraphicsContext3D::MAX_CUBE_MAP_TEXTURE_SIZE, &m_maxCubeMapTextureSize);
    431430    m_maxCubeMapTextureLevel = WebGLTexture::computeLevelCount(m_maxCubeMapTextureSize, m_maxCubeMapTextureSize);
     431   
     432    m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectOES::VaoTypeDefault);
     433    addObject(m_defaultVertexArrayObject.get());
     434    m_boundVertexArrayObject = m_defaultVertexArrayObject;
     435   
     436    m_vertexAttribValue.resize(m_maxVertexAttribs);
    432437
    433438    if (!isGLES2NPOTStrict())
     
    603608        m_boundArrayBuffer = buffer;
    604609    else if (target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER)
    605         m_boundElementArrayBuffer = buffer;
     610        m_boundVertexArrayObject->setElementArrayBuffer(buffer);
    606611    else {
    607612        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
     
    11191124    if (m_boundArrayBuffer == buffer)
    11201125        m_boundArrayBuffer = 0;
    1121     if (m_boundElementArrayBuffer == buffer)
    1122         m_boundElementArrayBuffer = 0;
     1126    RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
     1127    if (elementArrayBuffer == buffer)
     1128        m_boundVertexArrayObject->setElementArrayBuffer(0);
    11231129    if (!isGLES2Compliant()) {
    1124         VertexAttribState& state = m_vertexAttribState[0];
     1130        WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
    11251131        if (buffer == state.bufferBinding) {
    11261132            state.bufferBinding = m_vertexAttrib0Buffer;
     
    12431249    }
    12441250
    1245     if (index < m_vertexAttribState.size())
    1246         m_vertexAttribState[index].enabled = false;
     1251    WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
     1252    state.enabled = false;
    12471253
    12481254    if (index > 0 || isGLES2Compliant()) {
     
    12541260bool WebGLRenderingContext::validateElementArraySize(GC3Dsizei count, GC3Denum type, GC3Dintptr offset)
    12551261{
    1256     if (!m_boundElementArrayBuffer)
     1262    RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
     1263   
     1264    if (!elementArrayBuffer)
    12571265        return false;
    12581266
     
    12681276        offset /= 2;
    12691277
    1270         GC3Dsizeiptr n = m_boundElementArrayBuffer->byteLength() / 2;
     1278        GC3Dsizeiptr n = elementArrayBuffer->byteLength() / 2;
    12711279        if (offset > n || count > n - offset)
    12721280            return false;
    12731281    } else if (type == GraphicsContext3D::UNSIGNED_BYTE) {
    1274         GC3Dsizeiptr n = m_boundElementArrayBuffer->byteLength();
     1282        GC3Dsizeiptr n = elementArrayBuffer->byteLength();
    12751283        if (offset > n || count > n - offset)
    12761284            return false;
     
    12861294    // index, skips the expensive per-draw-call iteration in
    12871295    // validateIndexArrayPrecise.
    1288 
    1289     if (!m_boundElementArrayBuffer)
     1296   
     1297    RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
     1298
     1299    if (!elementArrayBuffer)
    12901300        return false;
    12911301
    1292     GC3Dsizeiptr numElements = m_boundElementArrayBuffer->byteLength();
     1302    GC3Dsizeiptr numElements = elementArrayBuffer->byteLength();
    12931303    // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
    12941304    if (!numElements)
    12951305        return false;
    1296     const ArrayBuffer* buffer = m_boundElementArrayBuffer->elementArrayBuffer();
     1306    const ArrayBuffer* buffer = elementArrayBuffer->elementArrayBuffer();
    12971307    ASSERT(buffer);
    12981308
    1299     int maxIndex = m_boundElementArrayBuffer->getCachedMaxIndex(type);
     1309    int maxIndex = elementArrayBuffer->getCachedMaxIndex(type);
    13001310    if (maxIndex < 0) {
    13011311        // Compute the maximum index in the entire buffer for the given type of index.
     
    13171327            return false;
    13181328        }
    1319         m_boundElementArrayBuffer->setCachedMaxIndex(type, maxIndex);
     1329        elementArrayBuffer->setCachedMaxIndex(type, maxIndex);
    13201330    }
    13211331
     
    13341344    ASSERT(count >= 0 && offset >= 0);
    13351345    int lastIndex = -1;
    1336 
    1337     if (!m_boundElementArrayBuffer)
     1346   
     1347    RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
     1348
     1349    if (!elementArrayBuffer)
    13381350        return false;
    13391351
     
    13431355    }
    13441356
    1345     if (!m_boundElementArrayBuffer->elementArrayBuffer())
     1357    if (!elementArrayBuffer->elementArrayBuffer())
    13461358        return false;
    13471359
     
    13521364        // Make uoffset an element offset.
    13531365        uoffset /= sizeof(GC3Dushort);
    1354         const GC3Dushort* p = static_cast<const GC3Dushort*>(m_boundElementArrayBuffer->elementArrayBuffer()->data()) + uoffset;
     1366        const GC3Dushort* p = static_cast<const GC3Dushort*>(elementArrayBuffer->elementArrayBuffer()->data()) + uoffset;
    13551367        while (n-- > 0) {
    13561368            if (*p > lastIndex)
     
    13591371        }
    13601372    } else if (type == GraphicsContext3D::UNSIGNED_BYTE) {
    1361         const GC3Dubyte* p = static_cast<const GC3Dubyte*>(m_boundElementArrayBuffer->elementArrayBuffer()->data()) + uoffset;
     1373        const GC3Dubyte* p = static_cast<const GC3Dubyte*>(elementArrayBuffer->elementArrayBuffer()->data()) + uoffset;
    13621374        while (n-- > 0) {
    13631375            if (*p > lastIndex)
     
    13771389        return false;
    13781390
    1379     int numAttribStates = static_cast<int>(m_vertexAttribState.size());
    1380 
    13811391    // Look in each enabled vertex attrib and check if they've been bound to a buffer.
    1382     for (int i = 0; i < numAttribStates; ++i) {
    1383         if (m_vertexAttribState[i].enabled
    1384             && (!m_vertexAttribState[i].bufferBinding || !m_vertexAttribState[i].bufferBinding->object()))
     1392    for (unsigned i = 0; i < m_maxVertexAttribs; ++i) {
     1393        const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(i);
     1394        if (state.enabled
     1395            && (!state.bufferBinding || !state.bufferBinding->object()))
    13851396            return false;
    13861397    }
     
    13941405    for (int i = 0; i < numActiveAttribLocations; ++i) {
    13951406        int loc = m_currentProgram->getActiveAttribLocation(i);
    1396         if (loc >=0 && loc < numAttribStates) {
    1397             const VertexAttribState& state = m_vertexAttribState[loc];
     1407        if (loc >= 0 && loc < static_cast<int>(m_maxVertexAttribs)) {
     1408            const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(loc);
    13981409            if (state.enabled) {
    13991410                // Avoid off-by-one errors in numElements computation.
     
    15091520        return;
    15101521
    1511     if (!m_boundElementArrayBuffer) {
     1522    if (!m_boundVertexArrayObject->getElementArrayBuffer()) {
    15121523        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
    15131524        return;
     
    15751586    }
    15761587
    1577     if (index >= m_vertexAttribState.size())
    1578         m_vertexAttribState.resize(index + 1);
    1579 
    1580     m_vertexAttribState[index].enabled = true;
     1588    WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
     1589    state.enabled = true;
    15811590
    15821591    m_context->enableVertexAttribArray(index);
     
    18511860        }
    18521861        return m_oesTextureFloat.get();
     1862    }
     1863    if (equalIgnoringCase(name, "OES_vertex_array_object")
     1864        && m_context->getExtensions()->supports("GL_OES_vertex_array_object")) {
     1865        if (!m_oesVertexArrayObject) {
     1866            m_context->getExtensions()->ensureEnabled("GL_OES_vertex_array_object");
     1867            m_oesVertexArrayObject = OESVertexArrayObject::create(this);
     1868        }
     1869        return m_oesVertexArrayObject.get();
    18531870    }
    18541871    if (equalIgnoringCase(name, "WEBKIT_lose_context")) {
     
    19721989        return getBooleanParameter(pname);
    19731990    case GraphicsContext3D::ELEMENT_ARRAY_BUFFER_BINDING:
    1974         return WebGLGetInfo(PassRefPtr<WebGLBuffer>(m_boundElementArrayBuffer));
     1991        return WebGLGetInfo(PassRefPtr<WebGLBuffer>(m_boundVertexArrayObject->getElementArrayBuffer()));
    19751992    case GraphicsContext3D::FRAMEBUFFER_BINDING:
    19761993        return WebGLGetInfo(PassRefPtr<WebGLFramebuffer>(m_framebufferBinding));
     
    20982115        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
    20992116        return WebGLGetInfo();
     2117    case Extensions3D::VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object
     2118        if (m_oesVertexArrayObject) {
     2119            if (!m_boundVertexArrayObject->isDefaultObject())
     2120                return WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES>(m_boundVertexArrayObject));
     2121            return WebGLGetInfo();
     2122        }
     2123        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
     2124        return WebGLGetInfo();
    21002125    default:
    21012126        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
     
    22592284    if (m_context->getExtensions()->supports("GL_OES_standard_derivatives"))
    22602285        result.append("OES_standard_derivatives");
     2286    if (m_context->getExtensions()->supports("GL_OES_vertex_array_object"))
     2287        result.append("OES_vertex_array_object");
    22612288    result.append("WEBKIT_lose_context");
    22622289    return result;
     
    24542481        return WebGLGetInfo();
    24552482    }
     2483    const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
    24562484    switch (pname) {
    24572485    case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
    2458         if ((!isGLES2Compliant() && !index && m_vertexAttribState[0].bufferBinding == m_vertexAttrib0Buffer)
    2459             || index >= m_vertexAttribState.size()
    2460             || !m_vertexAttribState[index].bufferBinding
    2461             || !m_vertexAttribState[index].bufferBinding->object())
     2486        if ((!isGLES2Compliant() && !index && m_boundVertexArrayObject->getVertexAttribState(0).bufferBinding == m_vertexAttrib0Buffer)
     2487            || !state.bufferBinding
     2488            || !state.bufferBinding->object())
    24622489            return WebGLGetInfo();
    2463         return WebGLGetInfo(PassRefPtr<WebGLBuffer>(m_vertexAttribState[index].bufferBinding));
     2490        return WebGLGetInfo(PassRefPtr<WebGLBuffer>(state.bufferBinding));
    24642491    case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_ENABLED:
    2465         if (index >= m_vertexAttribState.size())
    2466             return WebGLGetInfo(false);
    2467         return WebGLGetInfo(m_vertexAttribState[index].enabled);
     2492        return WebGLGetInfo(state.enabled);
    24682493    case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_NORMALIZED:
    2469         if (index >= m_vertexAttribState.size())
    2470             return WebGLGetInfo(false);
    2471         return WebGLGetInfo(m_vertexAttribState[index].normalized);
     2494        return WebGLGetInfo(state.normalized);
    24722495    case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_SIZE:
    2473         if (index >= m_vertexAttribState.size())
    2474             return WebGLGetInfo(static_cast<int>(4));
    2475         return WebGLGetInfo(m_vertexAttribState[index].size);
     2496        return WebGLGetInfo(state.size);
    24762497    case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_STRIDE:
    2477         if (index >= m_vertexAttribState.size())
    2478             return WebGLGetInfo(static_cast<int>(0));
    2479         return WebGLGetInfo(m_vertexAttribState[index].originalStride);
     2498        return WebGLGetInfo(state.originalStride);
    24802499    case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_TYPE:
    2481         if (index >= m_vertexAttribState.size())
    2482             return WebGLGetInfo(static_cast<unsigned int>(GraphicsContext3D::FLOAT));
    2483         return WebGLGetInfo(m_vertexAttribState[index].type);
     2500        return WebGLGetInfo(state.type);
    24842501    case GraphicsContext3D::CURRENT_VERTEX_ATTRIB:
    2485         if (index >= m_vertexAttribState.size()) {
    2486             float value[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
    2487             return WebGLGetInfo(Float32Array::create(value, 4));
    2488         }
    2489         return WebGLGetInfo(Float32Array::create(m_vertexAttribState[index].value, 4));
     2502        return WebGLGetInfo(Float32Array::create(m_vertexAttribValue[index].value, 4));
    24902503    default:
    24912504        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
     
    37253738    GC3Dsizei bytesPerElement = size * typeSize;
    37263739
    3727     if (index >= m_vertexAttribState.size())
    3728         m_vertexAttribState.resize(index + 1);
    3729 
    37303740    GC3Dsizei validatedStride = stride ? stride : bytesPerElement;
    37313741
    3732     m_vertexAttribState[index].bufferBinding = m_boundArrayBuffer;
    3733     m_vertexAttribState[index].bytesPerElement = bytesPerElement;
    3734     m_vertexAttribState[index].size = size;
    3735     m_vertexAttribState[index].type = type;
    3736     m_vertexAttribState[index].normalized = normalized;
    3737     m_vertexAttribState[index].stride = validatedStride;
    3738     m_vertexAttribState[index].originalStride = stride;
    3739     m_vertexAttribState[index].offset = offset;
     3742    WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
     3743    state.bufferBinding = m_boundArrayBuffer;
     3744    state.bytesPerElement = bytesPerElement;
     3745    state.size = size;
     3746    state.type = type;
     3747    state.normalized = normalized;
     3748    state.stride = validatedStride;
     3749    state.originalStride = stride;
     3750    state.offset = offset;
    37403751    m_context->vertexAttribPointer(index, size, type, normalized, stride, offset);
    37413752    cleanupAfterGraphicsCall(false);
     
    44744485    switch (target) {
    44754486    case GraphicsContext3D::ELEMENT_ARRAY_BUFFER:
    4476         buffer = m_boundElementArrayBuffer.get();
     4487        buffer = m_boundVertexArrayObject->getElementArrayBuffer().get();
    44774488        break;
    44784489    case GraphicsContext3D::ARRAY_BUFFER:
     
    45234534        cleanupAfterGraphicsCall(false);
    45244535    }
    4525     if (index >= m_vertexAttribState.size())
    4526         m_vertexAttribState.resize(index + 1);
    4527     m_vertexAttribState[index].value[0] = v0;
    4528     m_vertexAttribState[index].value[1] = v1;
    4529     m_vertexAttribState[index].value[2] = v2;
    4530     m_vertexAttribState[index].value[3] = v3;
     4536    VertexAttribValue& attribValue = m_vertexAttribValue[index];
     4537    attribValue.value[0] = v0;
     4538    attribValue.value[1] = v1;
     4539    attribValue.value[2] = v2;
     4540    attribValue.value[3] = v3;
    45314541}
    45324542
     
    45764586        cleanupAfterGraphicsCall(false);
    45774587    }
    4578     if (index >= m_vertexAttribState.size())
    4579         m_vertexAttribState.resize(index + 1);
    4580     m_vertexAttribState[index].initValue();
     4588    VertexAttribValue& attribValue = m_vertexAttribValue[index];
     4589    attribValue.initValue();
    45814590    for (int ii = 0; ii < expectedSize; ++ii)
    4582         m_vertexAttribState[index].value[ii] = v[ii];
     4591        attribValue.value[ii] = v[ii];
    45834592}
    45844593
    45854594void WebGLRenderingContext::initVertexAttrib0()
    45864595{
    4587     m_vertexAttribState.resize(1);
     4596    WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
     4597   
    45884598    m_vertexAttrib0Buffer = createBuffer();
    45894599    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_vertexAttrib0Buffer->object());
    45904600    m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, 0, GraphicsContext3D::DYNAMIC_DRAW);
    45914601    m_context->vertexAttribPointer(0, 4, GraphicsContext3D::FLOAT, false, 0, 0);
    4592     m_vertexAttribState[0].bufferBinding = m_vertexAttrib0Buffer;
     4602    state.bufferBinding = m_vertexAttrib0Buffer;
    45934603    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, 0);
    45944604    m_context->enableVertexAttribArray(0);
     
    46044614bool WebGLRenderingContext::simulateVertexAttrib0(GC3Dsizei numVertex)
    46054615{
    4606     const VertexAttribState& state = m_vertexAttribState[0];
     4616    const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
     4617    const VertexAttribValue& attribValue = m_vertexAttribValue[0];
    46074618    if (!m_currentProgram)
    46084619        return false;
     
    46244635    if (usingVertexAttrib0
    46254636        && (m_forceAttrib0BufferRefill
    4626             || state.value[0] != m_vertexAttrib0BufferValue[0]
    4627             || state.value[1] != m_vertexAttrib0BufferValue[1]
    4628             || state.value[2] != m_vertexAttrib0BufferValue[2]
    4629             || state.value[3] != m_vertexAttrib0BufferValue[3])) {
     4637            || attribValue.value[0] != m_vertexAttrib0BufferValue[0]
     4638            || attribValue.value[1] != m_vertexAttrib0BufferValue[1]
     4639            || attribValue.value[2] != m_vertexAttrib0BufferValue[2]
     4640            || attribValue.value[3] != m_vertexAttrib0BufferValue[3])) {
    46304641        OwnArrayPtr<GC3Dfloat> bufferData = adoptArrayPtr(new GC3Dfloat[(numVertex + 1) * 4]);
    46314642        for (GC3Dsizei ii = 0; ii < numVertex + 1; ++ii) {
    4632             bufferData[ii * 4] = state.value[0];
    4633             bufferData[ii * 4 + 1] = state.value[1];
    4634             bufferData[ii * 4 + 2] = state.value[2];
    4635             bufferData[ii * 4 + 3] = state.value[3];
    4636         }
    4637         m_vertexAttrib0BufferValue[0] = state.value[0];
    4638         m_vertexAttrib0BufferValue[1] = state.value[1];
    4639         m_vertexAttrib0BufferValue[2] = state.value[2];
    4640         m_vertexAttrib0BufferValue[3] = state.value[3];
     4643            bufferData[ii * 4] = attribValue.value[0];
     4644            bufferData[ii * 4 + 1] = attribValue.value[1];
     4645            bufferData[ii * 4 + 2] = attribValue.value[2];
     4646            bufferData[ii * 4 + 3] = attribValue.value[3];
     4647        }
     4648        m_vertexAttrib0BufferValue[0] = attribValue.value[0];
     4649        m_vertexAttrib0BufferValue[1] = attribValue.value[1];
     4650        m_vertexAttrib0BufferValue[2] = attribValue.value[2];
     4651        m_vertexAttrib0BufferValue[3] = attribValue.value[3];
    46414652        m_forceAttrib0BufferRefill = false;
    46424653        m_context->bufferSubData(GraphicsContext3D::ARRAY_BUFFER, 0, bufferDataSize, bufferData.get());
     
    46484659void WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation()
    46494660{
    4650     const VertexAttribState& state = m_vertexAttribState[0];
     4661    const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(0);
    46514662    if (state.bufferBinding != m_vertexAttrib0Buffer) {
    46524663        m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, objectOrZero(state.bufferBinding.get()));
     
    46584669int WebGLRenderingContext::getNumberOfExtensions()
    46594670{
    4660     return (m_oesStandardDerivatives ? 1 : 0) + (m_webkitLoseContext ? 1 : 0) + (m_oesTextureFloat ? 1 : 0);
     4671    return (m_oesVertexArrayObject ? 1 : 0) + (m_oesStandardDerivatives ? 1 : 0) + (m_webkitLoseContext ? 1 : 0) + (m_oesTextureFloat ? 1 : 0);
    46614672}
    46624673
    46634674WebGLExtension* WebGLRenderingContext::getExtensionNumber(int i)
    46644675{
     4676    if (m_oesVertexArrayObject) {
     4677        if (!i)
     4678            return m_oesVertexArrayObject.get();
     4679        --i;
     4680    }
    46654681    if (m_oesStandardDerivatives) {
    46664682        if (!i)
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h

    r78355 r79011  
    6060class OESStandardDerivatives;
    6161class OESTextureFloat;
     62class OESVertexArrayObject;
     63class WebGLVertexArrayObjectOES;
    6264
    6365class WebGLRenderingContext : public CanvasRenderingContext {
     
    287289
    288290    void removeObject(WebGLObject*);
     291   
     292    unsigned getMaxVertexAttribs() const { return m_maxVertexAttribs; }
    289293
    290294    // Helpers for JSC bindings.
     
    294298  private:
    295299    friend class WebGLObject;
     300    friend class OESVertexArrayObject;
    296301
    297302    WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes);
     
    363368    // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER and stored values for ELEMENT_ARRAY_BUFFER
    364369    RefPtr<WebGLBuffer> m_boundArrayBuffer;
    365     RefPtr<WebGLBuffer> m_boundElementArrayBuffer;
    366 
    367     // Cached values for vertex attrib range checks
    368     class VertexAttribState {
     370   
     371    RefPtr<WebGLVertexArrayObjectOES> m_defaultVertexArrayObject;
     372    RefPtr<WebGLVertexArrayObjectOES> m_boundVertexArrayObject;
     373    void setBoundVertexArrayObject(PassRefPtr<WebGLVertexArrayObjectOES> arrayObject)
     374    {
     375        if (arrayObject)
     376            m_boundVertexArrayObject = arrayObject;
     377        else
     378            m_boundVertexArrayObject = m_defaultVertexArrayObject;
     379    }
     380   
     381    class VertexAttribValue {
    369382    public:
    370         VertexAttribState()
    371             : enabled(false)
    372             , bytesPerElement(0)
    373             , size(4)
    374             , type(GraphicsContext3D::FLOAT)
    375             , normalized(false)
    376             , stride(16)
    377             , originalStride(0)
    378             , offset(0)
     383        VertexAttribValue()
    379384        {
    380385            initValue();
    381386        }
    382 
     387       
    383388        void initValue()
    384389        {
     
    388393            value[3] = 1.0f;
    389394        }
    390 
    391         bool enabled;
    392         RefPtr<WebGLBuffer> bufferBinding;
    393         GC3Dsizei bytesPerElement;
    394         GC3Dint size;
    395         GC3Denum type;
    396         bool normalized;
    397         GC3Dsizei stride;
    398         GC3Dsizei originalStride;
    399         GC3Dintptr offset;
     395       
    400396        GC3Dfloat value[4];
    401397    };
    402 
    403     Vector<VertexAttribState> m_vertexAttribState;
     398    Vector<VertexAttribValue> m_vertexAttribValue;
    404399    unsigned m_maxVertexAttribs;
    405400    RefPtr<WebGLBuffer> m_vertexAttrib0Buffer;
     
    463458    RefPtr<OESTextureFloat> m_oesTextureFloat;
    464459    RefPtr<OESStandardDerivatives> m_oesStandardDerivatives;
     460    RefPtr<OESVertexArrayObject> m_oesVertexArrayObject;
    465461    RefPtr<WebKitLoseContext> m_webkitLoseContext;
    466462
  • trunk/Source/WebCore/platform/graphics/Extensions3D.h

    r76717 r79011  
    2727#define Extensions3D_h
    2828
     29#include "GraphicsTypes3D.h"
     30
    2931#include <wtf/text/WTFString.h>
    3032
     
    5456    //   GL_OES_standard_derivatives
    5557    //   GL_OES_rgb8_rgba8
     58    //   GL_OES_vertex_array_object
    5659
    5760    // Takes full name of extension; for example,
     
    9396        RGB8_OES = 0x8051,
    9497        RGBA8_OES = 0x8058,
     98       
     99        // GL_OES_vertex_array_object names
     100        VERTEX_ARRAY_BINDING_OES = 0x85B5,
    95101    };
    96102
     
    102108   
    103109    // GL_ANGLE_framebuffer_multisample
    104     virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) = 0;   
     110    virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) = 0;
     111   
     112    // GL_OES_vertex_array_object
     113    virtual Platform3DObject createVertexArrayOES() = 0;
     114    virtual void deleteVertexArrayOES(Platform3DObject) = 0;
     115    virtual GC3Dboolean isVertexArrayOES(Platform3DObject) = 0;
     116    virtual void bindVertexArrayOES(Platform3DObject) = 0;
    105117};
    106118
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r77999 r79011  
    2929#include "IntSize.h"
    3030#include "GraphicsLayer.h"
     31#include "GraphicsTypes3D.h"
    3132#include "PlatformString.h"
    3233
     
    4243#undef VERSION
    4344#endif
    44 
    45 // GC3D types match the corresponding GL types as defined in OpenGL ES 2.0
    46 // header file gl2.h from khronos.org.
    47 typedef unsigned int GC3Denum;
    48 typedef unsigned char GC3Dboolean;
    49 typedef unsigned int GC3Dbitfield;
    50 typedef signed char GC3Dbyte;
    51 typedef unsigned char GC3Dubyte;
    52 typedef short GC3Dshort;
    53 typedef unsigned short GC3Dushort;
    54 typedef int GC3Dint;
    55 typedef int GC3Dsizei;
    56 typedef unsigned int GC3Duint;
    57 typedef float GC3Dfloat;
    58 typedef float GC3Dclampf;
    59 typedef signed long int GC3Dintptr;
    60 typedef signed long int GC3Dsizeiptr;
    61 
    62 typedef GC3Duint Platform3DObject;
    6345
    6446#if PLATFORM(MAC)
  • trunk/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h

    r76717 r79011  
    4747    virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
    4848    virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
     49    virtual Platform3DObject createVertexArrayOES();
     50    virtual void deleteVertexArrayOES(Platform3DObject);
     51    virtual GC3Dboolean isVertexArrayOES(Platform3DObject);
     52    virtual void bindVertexArrayOES(Platform3DObject);
    4953
    5054    enum {
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp

    r76717 r79011  
    8888    if (name == "GL_OES_texture_float" || name == "GL_OES_texture_half_float")
    8989        return m_availableExtensions.contains("GL_ARB_texture_float");
     90   
     91    // GL_OES_vertex_array_object
     92    if (name == "GL_OES_vertex_array_object")
     93        return m_availableExtensions.contains("GL_APPLE_vertex_array_object");
    9094
    9195    // Desktop GL always supports the standard derivative functions
     
    128132}
    129133
     134Platform3DObject Extensions3DOpenGL::createVertexArrayOES()
     135{
     136    m_context->makeContextCurrent();
     137#if GL_APPLE_vertex_array_object
     138    GLuint array = 0;
     139    glGenVertexArraysAPPLE(1, &array);
     140    return array;
     141#else
     142    return 0;
     143#endif
     144}
     145
     146void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
     147{
     148    if (!array)
     149        return;
     150   
     151    m_context->makeContextCurrent();
     152#if GL_APPLE_vertex_array_object
     153    glDeleteVertexArraysAPPLE(1, &array);
     154#else
     155#endif
     156}
     157
     158GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array)
     159{
     160    if (!array)
     161        return GL_FALSE;
     162   
     163    m_context->makeContextCurrent();
     164#if GL_APPLE_vertex_array_object
     165    return glIsVertexArrayAPPLE(array);
     166#else
     167    return GL_FALSE;
     168#endif
     169}
     170
     171void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
     172{
     173    m_context->makeContextCurrent();
     174#if GL_APPLE_vertex_array_object
     175    glBindVertexArrayAPPLE(array);
     176#else
     177    ASSERT_UNUSED(array, supports(array));
     178#endif
     179}
     180
    130181} // namespace WebCore
    131182
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h

    r76324 r79011  
    4444    virtual int getGraphicsResetStatusARB();
    4545    virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
    46     virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);   
     46    virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
     47   
     48    virtual Platform3DObject createVertexArrayOES();
     49    virtual void deleteVertexArrayOES(Platform3DObject);
     50    virtual GC3Dboolean isVertexArrayOES(Platform3DObject);
     51    virtual void bindVertexArrayOES(Platform3DObject);
    4752
    4853private:
  • trunk/Source/WebCore/platform/graphics/qt/Extensions3DQt.cpp

    r78495 r79011  
    6565}
    6666
     67Platform3DObject Extensions3DQt::createVertexArrayOES()
     68{
     69    return 0;
     70}
     71
     72void Extensions3DQt::deleteVertexArrayOES(Platform3DObject)
     73{
     74}
     75
     76GC3Dboolean Extensions3DQt::isVertexArrayOES(Platform3DObject)
     77{
     78    return GL_FALSE;
     79}
     80
     81void Extensions3DQt::bindVertexArrayOES(Platform3DObject)
     82{
     83}
     84
    6785} // namespace WebCore
    6886
  • trunk/Source/WebCore/platform/graphics/qt/Extensions3DQt.h

    r78495 r79011  
    4040    virtual int getGraphicsResetStatusARB();
    4141    virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
    42     virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);   
     42    virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
     43    virtual Platform3DObject createVertexArrayOES();
     44    virtual void deleteVertexArrayOES(Platform3DObject);
     45    virtual GC3Dboolean isVertexArrayOES(Platform3DObject);
     46    virtual void bindVertexArrayOES(Platform3DObject);
    4347
    4448private:
  • trunk/Source/WebKit/chromium/ChangeLog

    r78967 r79011  
     12011-02-18  Ben Vanik  <benvanik@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Bug 53940: Implement the OES_vertex_array_object WebGL extension
     6        https://bugs.webkit.org/show_bug.cgi?id=53940
     7
     8        Stubbed out methods for the new OES_vertex_array_object methods.
     9
     10        * src/Extensions3DChromium.cpp:
     11        (WebCore::Extensions3DChromium::createVertexArrayOES):
     12        (WebCore::Extensions3DChromium::deleteVertexArrayOES):
     13        (WebCore::Extensions3DChromium::isVertexArrayOES):
     14        (WebCore::Extensions3DChromium::bindVertexArrayOES):
     15
    1162011-02-17  Yuzo Fujishima  <yuzo@google.com>
    217
  • trunk/Source/WebKit/chromium/src/Extensions3DChromium.cpp

    r76717 r79011  
    9898}
    9999
     100Platform3DObject Extensions3DChromium::createVertexArrayOES()
     101{
     102    return 0;
     103}
     104
     105void Extensions3DChromium::deleteVertexArrayOES(Platform3DObject)
     106{
     107}
     108
     109GC3Dboolean Extensions3DChromium::isVertexArrayOES(Platform3DObject)
     110{
     111    return 0;
     112}
     113
     114void Extensions3DChromium::bindVertexArrayOES(Platform3DObject)
     115{
     116}
     117
    100118} // namespace WebCore
    101119
Note: See TracChangeset for help on using the changeset viewer.