[WebGL] Implement OES texture float linear
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Dec 2013 20:21:29 +0000 (20:21 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Dec 2013 20:21:29 +0000 (20:21 +0000)
commit09bce5211f6c5a153d1a8e08d56d7bcfd578a398
treeaf30c8480bfed9a747648c102b9407913bab6140
parent73dd34ebeb4935382ef25e1fbdc9b63dd3e59f2d
[WebGL] Implement OES texture float linear
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: https://svn.webkit.org/repository/webkit/trunk@160030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/oes-texture-float-linear-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/oes-texture-float-linear.html [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/resources/oes-texture-float-and-half-float-linear.js [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/html/canvas/OESTextureFloatLinear.cpp [new file with mode: 0644]
Source/WebCore/html/canvas/OESTextureFloatLinear.h [new file with mode: 0644]
Source/WebCore/html/canvas/OESTextureFloatLinear.idl [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLExtension.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.h
Source/WebCore/html/canvas/WebGLTexture.cpp
Source/WebCore/html/canvas/WebGLTexture.h
Source/WebCore/platform/graphics/Extensions3D.h
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp