Skip to content
  • dino@apple.com's avatar
    [WebGL] Implement OES texture float linear · ae867077
    dino@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=124871
    
    Reviewed by Brent Fulgham.
    
    Source/WebCore:
    
    Implement the OES_texture_float_linear extension. Generally
    we'd also enable OES_texture_half_float_linear at the same
    time, but that's blocked on webkit.org/b/110936.
    
    Test: fast/canvas/webgl/oes-texture-float-linear.html
    
    * CMakeLists.txt: Add new files.
    * DerivedSources.cpp: Ditto.
    * DerivedSources.make: Generate new file from IDL.
    * GNUmakefile.list.am: Add new files.
    * WebCore.vcxproj/WebCore.vcxproj: Ditto.
    * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
    * WebCore.xcodeproj/project.pbxproj: New files for OESTextureFloatLinear.
    
    * bindings/js/JSWebGLRenderingContextCustom.cpp:
    (WebCore::toJS): Map the new name into the appropriate type.
    
    * html/canvas/OESTextureFloatLinear.cpp: Added. This is a very simple class
    that's mostly empty.
    (WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
    (WebCore::OESTextureFloatLinear::~OESTextureFloatLinear):
    (WebCore::OESTextureFloatLinear::getName):
    (WebCore::OESTextureFloatLinear::create):
    * html/canvas/OESTextureFloatLinear.h: Added.
    * html/canvas/OESTextureFloatLinear.idl: Added.
    
    * html/canvas/WebGLExtension.h: Declare the new name in the enum of extensions.
    
    * html/canvas/WebGLRenderingContext.cpp:
    (WebCore::WebGLRenderingContext::drawArrays): Call new name.
    (WebCore::WebGLRenderingContext::drawElements): Call new name.
    (WebCore::WebGLRenderingContext::getExtension): Create the new extension if asked.
    (WebCore::WebGLRenderingContext::checkTextureCompleteness): Renamed from handleNPOTTextures. Now
    checks for the type of the texture too.
    * html/canvas/WebGLRenderingContext.h: Member variable for new extension.
    
    * html/canvas/WebGLTexture.cpp:
    (WebCore::WebGLTexture::WebGLTexture):
    (WebCore::WebGLTexture::needToUseBlackTexture): Takes an extra parameter which indicates
    if it has an extension enabled.
    (WebCore::WebGLTexture::update): Note it is a float type when updating.
    * html/canvas/WebGLTexture.h: New flag to indicate float type.
    
    * platform/graphics/Extensions3D.h: New flag type.
    * platform/graphics/opengl/Extensions3DOpenGL.cpp:
    (WebCore::Extensions3DOpenGL::supportsExtension): Add a comment about the extension.
    
    LayoutTests:
    
    Add the Khronos test files for this extension.
    
    Add the JS test file for OES_texture_float_linear and OES_texture_half_float_linear
    even though it's only used for the former at the moment.
    
    * fast/canvas/webgl/oes-texture-float-linear.html: Added.
    * fast/canvas/webgl/resources/oes-texture-float-and-half-float-linear.js: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ae867077