[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

kbr at google.com kbr at google.com
Wed Dec 22 18:26:21 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 81bb49718edc2fa53645889f9404668c5927fae0
Author: kbr at google.com <kbr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 22:50:02 2010 +0000

    2010-12-10  Kenneth Russell  <kbr at google.com>
    
            Reviewed by James Robinson.
    
            Implement extension entry points and remove EXTENSIONS enum
            https://bugs.webkit.org/show_bug.cgi?id=40316
    
            Added support for ensuring that a particular OpenGL extension is
            enabled.
    
            * public/WebGraphicsContext3D.h:
            * src/Extensions3DChromium.cpp:
            (WebCore::Extensions3DChromium::ensureEnabled):
            * src/GraphicsContext3DChromium.cpp:
            (WebCore::GraphicsContext3DInternal::initializeExtensions):
            (WebCore::GraphicsContext3DInternal::supportsExtension):
            (WebCore::GraphicsContext3DInternal::ensureExtensionEnabled):
            * src/GraphicsContext3DInternal.h:
            * src/WebGraphicsContext3DDefaultImpl.cpp:
            (WebKit::WebGraphicsContext3DDefaultImpl::getRequestableExtensionsCHROMIUM):
            (WebKit::WebGraphicsContext3DDefaultImpl::requestExtensionCHROMIUM):
            * src/WebGraphicsContext3DDefaultImpl.h:
    2010-12-10  Kenneth Russell  <kbr at google.com>
    
            Reviewed by James Robinson.
    
            Implement extension entry points and remove EXTENSIONS enum
            https://bugs.webkit.org/show_bug.cgi?id=40316
    
            Implemented WebGLRenderingContext's getSupportedExtensions and
            getExtensions entry points, and, to verify them, added support for
            the first specified WebGL extension, OES_texture_float. This
            extension is now advertised in the Chromium and WebKit ports when
            the underlying hardware supports it.
    
            The new OES_texture_float test in the WebGL conformance suite
            verifies the allocation and population of floating point textures,
            and their use as render targets. However, because this extension
            is optional, it is not easily testable with a layout test; there
            is only one set of expectations for a given test, and two would be
            needed, one when the extension is available and one when it is not.
    
            Tested with the oes-texture-float.html WebGL conformance test in
            Chromium and WebKit on Mac OS X on hardware that supports the
            extension. Also verified with a configuration that does not
            advertise the extension that this same test passes.
    
            * CMakeLists.txt:
            * DerivedSources.make:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pri:
            * WebCore.pro:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSWebGLRenderingContextCustom.cpp:
            (WebCore::toJS):
            (WebCore::JSWebGLRenderingContext::markChildren):
            (WebCore::JSWebGLRenderingContext::getExtension):
            (WebCore::JSWebGLRenderingContext::getSupportedExtensions):
            * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
            (WebCore::toV8Object):
            (WebCore::V8WebGLRenderingContext::getExtensionCallback):
            (WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallback):
            * html/canvas/OESTextureFloat.cpp: Added.
            (WebCore::OESTextureFloat::OESTextureFloat):
            (WebCore::OESTextureFloat::~OESTextureFloat):
            (WebCore::OESTextureFloat::getName):
            (WebCore::OESTextureFloat::create):
            * html/canvas/OESTextureFloat.h: Added.
            * html/canvas/OESTextureFloat.idl: Added.
            * html/canvas/WebGLExtension.cpp: Added.
            (WebCore::WebGLExtension::WebGLExtension):
            (WebCore::WebGLExtension::~WebGLExtension):
            * html/canvas/WebGLExtension.h: Added.
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::getExtension):
            (WebCore::WebGLRenderingContext::getSupportedExtensions):
            (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType):
            (WebCore::WebGLRenderingContext::validateTexFuncData):
            (WebCore::WebGLRenderingContext::getNumberOfExtensions):
            (WebCore::WebGLRenderingContext::getExtensionNumber):
            * html/canvas/WebGLRenderingContext.h:
            * html/canvas/WebGLRenderingContext.idl:
            * platform/graphics/Extensions3D.h:
            * platform/graphics/GraphicsContext3D.cpp:
            (WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
            (WebCore::GraphicsContext3D::extractTextureData):
            (WebCore::doUnpackingAndPacking):
            (WebCore::doPacking):
            (WebCore::doFloatingPointPacking):
            (WebCore::GraphicsContext3D::packPixels):
            * platform/graphics/GraphicsContext3D.h:
            * platform/graphics/chromium/Extensions3DChromium.h:
            * platform/graphics/opengl/Extensions3DOpenGL.cpp:
            (WebCore::Extensions3DOpenGL::supports):
            (WebCore::Extensions3DOpenGL::ensureEnabled):
            * platform/graphics/opengl/Extensions3DOpenGL.h:
            * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
            (WebCore::GraphicsContext3D::texImage2D):
            * platform/graphics/qt/Extensions3DQt.cpp:
            (WebCore::Extensions3DQt::ensureEnabled):
            * platform/graphics/qt/Extensions3DQt.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73806 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index e50e8d6..419888e 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -287,6 +287,7 @@ SET(WebCore_IDL_FILES
     html/canvas/Int16Array.idl
     html/canvas/Int32Array.idl
     html/canvas/Int8Array.idl
+    html/canvas/OESTextureFloat.idl
     html/canvas/Uint16Array.idl
     html/canvas/Uint32Array.idl
     html/canvas/Uint8Array.idl
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2ae63ad..ecfbcd3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,84 @@
+2010-12-10  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by James Robinson.
+
+        Implement extension entry points and remove EXTENSIONS enum
+        https://bugs.webkit.org/show_bug.cgi?id=40316
+
+        Implemented WebGLRenderingContext's getSupportedExtensions and
+        getExtensions entry points, and, to verify them, added support for
+        the first specified WebGL extension, OES_texture_float. This
+        extension is now advertised in the Chromium and WebKit ports when
+        the underlying hardware supports it.
+
+        The new OES_texture_float test in the WebGL conformance suite
+        verifies the allocation and population of floating point textures,
+        and their use as render targets. However, because this extension
+        is optional, it is not easily testable with a layout test; there
+        is only one set of expectations for a given test, and two would be
+        needed, one when the extension is available and one when it is not.
+
+        Tested with the oes-texture-float.html WebGL conformance test in
+        Chromium and WebKit on Mac OS X on hardware that supports the
+        extension. Also verified with a configuration that does not
+        advertise the extension that this same test passes.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::toJS):
+        (WebCore::JSWebGLRenderingContext::markChildren):
+        (WebCore::JSWebGLRenderingContext::getExtension):
+        (WebCore::JSWebGLRenderingContext::getSupportedExtensions):
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        (WebCore::toV8Object):
+        (WebCore::V8WebGLRenderingContext::getExtensionCallback):
+        (WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallback):
+        * html/canvas/OESTextureFloat.cpp: Added.
+        (WebCore::OESTextureFloat::OESTextureFloat):
+        (WebCore::OESTextureFloat::~OESTextureFloat):
+        (WebCore::OESTextureFloat::getName):
+        (WebCore::OESTextureFloat::create):
+        * html/canvas/OESTextureFloat.h: Added.
+        * html/canvas/OESTextureFloat.idl: Added.
+        * html/canvas/WebGLExtension.cpp: Added.
+        (WebCore::WebGLExtension::WebGLExtension):
+        (WebCore::WebGLExtension::~WebGLExtension):
+        * html/canvas/WebGLExtension.h: Added.
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getExtension):
+        (WebCore::WebGLRenderingContext::getSupportedExtensions):
+        (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType):
+        (WebCore::WebGLRenderingContext::validateTexFuncData):
+        (WebCore::WebGLRenderingContext::getNumberOfExtensions):
+        (WebCore::WebGLRenderingContext::getExtensionNumber):
+        * html/canvas/WebGLRenderingContext.h:
+        * html/canvas/WebGLRenderingContext.idl:
+        * platform/graphics/Extensions3D.h:
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
+        (WebCore::GraphicsContext3D::extractTextureData):
+        (WebCore::doUnpackingAndPacking):
+        (WebCore::doPacking):
+        (WebCore::doFloatingPointPacking):
+        (WebCore::GraphicsContext3D::packPixels):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/chromium/Extensions3DChromium.h:
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::supports):
+        (WebCore::Extensions3DOpenGL::ensureEnabled):
+        * platform/graphics/opengl/Extensions3DOpenGL.h:
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::texImage2D):
+        * platform/graphics/qt/Extensions3DQt.cpp:
+        (WebCore::Extensions3DQt::ensureEnabled):
+        * platform/graphics/qt/Extensions3DQt.h:
+
 2010-12-10  Darin Adler  <darin at apple.com>
 
         Try to fix Windows build.
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 4e0f85a..fb13afe 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -310,6 +310,7 @@ DOM_CLASSES = \
     Notation \
     Notification \
     NotificationCenter \
+    OESTextureFloat \
     OverflowEvent \
     PageTransitionEvent \
     Performance \
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 9053976..1e7d4c7 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -473,6 +473,8 @@ webcore_built_sources += \
 	DerivedSources/WebCore/JSNotificationCenter.h \
 	DerivedSources/WebCore/JSNotification.cpp \
 	DerivedSources/WebCore/JSNotification.h \
+	DerivedSources/WebCore/JSOESTextureFloat.cpp \
+	DerivedSources/WebCore/JSOESTextureFloat.h \
 	DerivedSources/WebCore/JSOverflowEvent.cpp \
 	DerivedSources/WebCore/JSOverflowEvent.h \
 	DerivedSources/WebCore/JSPageTransitionEvent.cpp \
@@ -1565,6 +1567,8 @@ webcore_sources += \
 	WebCore/html/canvas/Int32Array.h \
 	WebCore/html/canvas/Int8Array.cpp \
 	WebCore/html/canvas/Int8Array.h \
+	WebCore/html/canvas/OESTextureFloat.cpp \
+	WebCore/html/canvas/OESTextureFloat.h \
 	WebCore/html/canvas/Uint16Array.cpp \
 	WebCore/html/canvas/Uint16Array.h \
 	WebCore/html/canvas/Uint32Array.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index fca49ea..0f7c7db 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -213,6 +213,7 @@
             'html/canvas/Int16Array.idl',
             'html/canvas/Int32Array.idl',
             'html/canvas/Int8Array.idl',
+            'html/canvas/OESTextureFloat.idl',
             'html/canvas/Uint16Array.idl',
             'html/canvas/Uint32Array.idl',
             'html/canvas/Uint8Array.idl',
@@ -1913,6 +1914,8 @@
             'html/canvas/Int8Array.cpp',
             'html/canvas/Int8Array.h',
             'html/canvas/IntegralTypedArrayBase.h',
+            'html/canvas/OESTextureFloat.cpp',
+            'html/canvas/OESTextureFloat.h',
             'html/canvas/TypedArrayBase.h',
             'html/canvas/Uint16Array.cpp',
             'html/canvas/Uint16Array.h',
@@ -1926,6 +1929,8 @@
             'html/canvas/WebGLContextAttributes.h',
             'html/canvas/WebGLContextEvent.cpp',
             'html/canvas/WebGLContextEvent.h',
+            'html/canvas/WebGLExtension.cpp',
+            'html/canvas/WebGLExtension.h',
             'html/canvas/WebGLFramebuffer.cpp',
             'html/canvas/WebGLFramebuffer.h',
             'html/canvas/WebGLGetInfo.cpp',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index d3e816e..31ba32d 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -191,6 +191,7 @@ IDL_BINDINGS += \
     html/canvas/CanvasPattern.idl \
     html/canvas/CanvasRenderingContext.idl \
     html/canvas/CanvasRenderingContext2D.idl \
+    html/canvas/OESTextureFloat.idl \
     html/canvas/WebGLActiveInfo.idl \
     html/canvas/WebGLBuffer.idl \
     html/canvas/WebGLContextAttributes.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index b915789..e51e28b 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -3728,6 +3728,7 @@ HEADERS += \
         html/canvas/Int8Array.h \
         html/canvas/WebGLContextAttributes.h \
         html/canvas/Float32Array.h \
+        html/canvas/WebGLExtension.h \
         html/canvas/WebGLFramebuffer.h \
         html/canvas/WebGLGetInfo.h \
         html/canvas/Int32Array.h \
@@ -3736,6 +3737,7 @@ HEADERS += \
         html/canvas/WebGLRenderingContext.h \
         html/canvas/WebGLShader.h \
         html/canvas/Int16Array.h \
+        html/canvas/OESTextureFloat.h \
         html/canvas/WebGLTexture.h \
         html/canvas/WebGLUniformLocation.h \
         html/canvas/Uint8Array.h \
@@ -3768,6 +3770,7 @@ SOURCES += \
         html/canvas/Int8Array.cpp \
         html/canvas/WebGLContextAttributes.cpp \
         html/canvas/Float32Array.cpp \
+        html/canvas/WebGLExtension.cpp \
         html/canvas/WebGLFramebuffer.cpp \
         html/canvas/WebGLGetInfo.cpp \
         html/canvas/Int32Array.cpp \
@@ -3776,6 +3779,7 @@ SOURCES += \
         html/canvas/WebGLRenderingContext.cpp \
         html/canvas/WebGLShader.cpp \
         html/canvas/Int16Array.cpp \
+        html/canvas/OESTextureFloat.cpp \
         html/canvas/WebGLTexture.cpp \
         html/canvas/WebGLUniformLocation.cpp \
         html/canvas/Uint8Array.cpp \
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 58b51c3..b4d6aa0 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1523,6 +1523,12 @@
 		6E67D2A91280E8BD008758F7 /* Extensions3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* Extensions3D.h */; };
 		6E96BB1C11986EE2007D94CD /* IntegralTypedArrayBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E96BB1A11986EE1007D94CD /* IntegralTypedArrayBase.h */; };
 		6E96BB1D11986EE2007D94CD /* TypedArrayBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E96BB1B11986EE1007D94CD /* TypedArrayBase.h */; };
+		6EBF0E4812A8926100DB1709 /* OESTextureFloat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EBF0E4512A8926100DB1709 /* OESTextureFloat.cpp */; };
+		6EBF0E4912A8926100DB1709 /* OESTextureFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */; };
+		6EBF0E5412A8929800DB1709 /* WebGLExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EBF0E5212A8929800DB1709 /* WebGLExtension.cpp */; };
+		6EBF0E5512A8929800DB1709 /* WebGLExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E5312A8929800DB1709 /* WebGLExtension.h */; };
+		6EBF0E7612A9868800DB1709 /* JSOESTextureFloat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EBF0E7412A9868800DB1709 /* JSOESTextureFloat.cpp */; };
+		6EBF0E7712A9868800DB1709 /* JSOESTextureFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E7512A9868800DB1709 /* JSOESTextureFloat.h */; };
 		6EE8A77210F803F3005A4A24 /* JSWebGLContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */; };
 		6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */; };
 		72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
@@ -7886,6 +7892,13 @@
 		6E67D2A81280E8BD008758F7 /* Extensions3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Extensions3D.h; sourceTree = "<group>"; };
 		6E96BB1A11986EE1007D94CD /* IntegralTypedArrayBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IntegralTypedArrayBase.h; path = canvas/IntegralTypedArrayBase.h; sourceTree = "<group>"; };
 		6E96BB1B11986EE1007D94CD /* TypedArrayBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypedArrayBase.h; path = canvas/TypedArrayBase.h; sourceTree = "<group>"; };
+		6EBF0E4512A8926100DB1709 /* OESTextureFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESTextureFloat.cpp; path = canvas/OESTextureFloat.cpp; sourceTree = "<group>"; };
+		6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESTextureFloat.h; path = canvas/OESTextureFloat.h; sourceTree = "<group>"; };
+		6EBF0E4712A8926100DB1709 /* OESTextureFloat.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OESTextureFloat.idl; path = canvas/OESTextureFloat.idl; sourceTree = "<group>"; };
+		6EBF0E5212A8929800DB1709 /* WebGLExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLExtension.cpp; path = canvas/WebGLExtension.cpp; sourceTree = "<group>"; };
+		6EBF0E5312A8929800DB1709 /* WebGLExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLExtension.h; path = canvas/WebGLExtension.h; sourceTree = "<group>"; };
+		6EBF0E7412A9868800DB1709 /* JSOESTextureFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESTextureFloat.cpp; sourceTree = "<group>"; };
+		6EBF0E7512A9868800DB1709 /* JSOESTextureFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESTextureFloat.h; sourceTree = "<group>"; };
 		6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextAttributes.cpp; sourceTree = "<group>"; };
 		6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextAttributes.h; sourceTree = "<group>"; };
 		72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
@@ -13059,6 +13072,9 @@
 				49C7B9AC1042D32E0009D447 /* Int8Array.h */,
 				49C7B9AD1042D32E0009D447 /* Int8Array.idl */,
 				6E96BB1A11986EE1007D94CD /* IntegralTypedArrayBase.h */,
+				6EBF0E4512A8926100DB1709 /* OESTextureFloat.cpp */,
+				6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */,
+				6EBF0E4712A8926100DB1709 /* OESTextureFloat.idl */,
 				6E96BB1B11986EE1007D94CD /* TypedArrayBase.h */,
 				49EECDDC10503C2300099FAB /* Uint16Array.cpp */,
 				49EECDDD10503C2400099FAB /* Uint16Array.h */,
@@ -13080,6 +13096,8 @@
 				93F6F1EA127F70B10055CB06 /* WebGLContextEvent.cpp */,
 				93F6F1EB127F70B10055CB06 /* WebGLContextEvent.h */,
 				93F6F1EC127F70B10055CB06 /* WebGLContextEvent.idl */,
+				6EBF0E5212A8929800DB1709 /* WebGLExtension.cpp */,
+				6EBF0E5312A8929800DB1709 /* WebGLExtension.h */,
 				49C7B9AE1042D32E0009D447 /* WebGLFramebuffer.cpp */,
 				49C7B9AF1042D32E0009D447 /* WebGLFramebuffer.h */,
 				49C7B9B01042D32E0009D447 /* WebGLFramebuffer.idl */,
@@ -15938,6 +15956,8 @@
 				49C7B9831042D2D30009D447 /* JSInt8Array.h */,
 				E44614100CD6826900FADA75 /* JSMediaError.cpp */,
 				E44614110CD6826900FADA75 /* JSMediaError.h */,
+				6EBF0E7412A9868800DB1709 /* JSOESTextureFloat.cpp */,
+				6EBF0E7512A9868800DB1709 /* JSOESTextureFloat.h */,
 				BCEF45F30E687B5C001C1287 /* JSTextMetrics.cpp */,
 				BCEF45F40E687B5C001C1287 /* JSTextMetrics.h */,
 				E44614120CD6826900FADA75 /* JSTimeRanges.cpp */,
@@ -22167,6 +22187,9 @@
 				FDA15ECA12B03F50003A583A /* JSRealtimeAnalyserNode.h in Headers */,
 				FDA15ECE12B03F61003A583A /* JSJavaScriptAudioNode.h in Headers */,
 				FDA15ED212B03F94003A583A /* JSDelayNode.h in Headers */,
+				6EBF0E4912A8926100DB1709 /* OESTextureFloat.h in Headers */,
+				6EBF0E5512A8929800DB1709 /* WebGLExtension.h in Headers */,
+				6EBF0E7712A9868800DB1709 /* JSOESTextureFloat.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -24834,6 +24857,9 @@
 				FDA15ED112B03F94003A583A /* JSDelayNode.cpp in Sources */,
 				494BC40D12AEDD9E00743BD2 /* TransformationMatrixCA.cpp in Sources */,
 				BC51156E12B1749C00C96754 /* ScrollAnimatorMac.mm in Sources */,
+				6EBF0E4812A8926100DB1709 /* OESTextureFloat.cpp in Sources */,
+				6EBF0E5412A8929800DB1709 /* WebGLExtension.cpp in Sources */,
+				6EBF0E7612A9868800DB1709 /* JSOESTextureFloat.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
index e414278..e1963da 100644
--- a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
@@ -35,6 +35,7 @@
 #include "JSHTMLCanvasElement.h"
 #include "JSHTMLImageElement.h"
 #include "JSImageData.h"
+#include "JSOESTextureFloat.h"
 #include "JSWebGLBuffer.h"
 #include "JSFloat32Array.h"
 #include "JSWebGLFramebuffer.h"
@@ -47,8 +48,10 @@
 #include "JSUint8Array.h"
 #include "JSWebKitCSSMatrix.h"
 #include "NotImplemented.h"
+#include "OESTextureFloat.h"
 #include "WebGLBuffer.h"
 #include "Float32Array.h"
+#include "WebGLExtension.h"
 #include "WebGLFramebuffer.h"
 #include "WebGLGetInfo.h"
 #include "Int32Array.h"
@@ -161,6 +164,27 @@ enum WhichProgramCall {
     kProgramParameter, kUniform
 };
 
+static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExtension* extension)
+{
+    if (!extension)
+        return jsNull();
+    switch (extension->getName()) {
+    case WebGLExtension::OESTextureFloatName:
+        return toJS(exec, globalObject, static_cast<OESTextureFloat*>(extension));
+    }
+    ASSERT_NOT_REACHED();
+    return jsNull();
+}
+
+void JSWebGLRenderingContext::markChildren(MarkStack& markStack)
+{
+    Base::markChildren(markStack);
+
+    WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
+    for (int i = 0; i < context->getNumberOfExtensions(); ++i)
+        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), context->getExtensionNumber(i));
+}
+
 JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
 {
     if (exec->argumentCount() < 1)
@@ -186,6 +210,19 @@ JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
     return constructArray(exec, list);
 }
 
+JSValue JSWebGLRenderingContext::getExtension(ExecState* exec)
+{
+    if (exec->argumentCount() < 1)
+        return throwSyntaxError(exec);
+
+    WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
+    const String& name = ustringToString(exec->argument(0).toString(exec));
+    if (exec->hadException())
+        return jsUndefined();
+    WebGLExtension* extension = context->getExtension(name);
+    return toJS(exec, globalObject(), extension);
+}
+
 JSValue JSWebGLRenderingContext::getBufferParameter(ExecState* exec)
 {
     return getObjectParameter(this, exec, kBuffer);
@@ -280,6 +317,16 @@ JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec)
     return toJS(exec, globalObject(), info);
 }
 
+JSValue JSWebGLRenderingContext::getSupportedExtensions(ExecState* exec)
+{
+    WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
+    Vector<String> value = context->getSupportedExtensions();
+    MarkedArgumentBuffer list;
+    for (size_t ii = 0; ii < value.size(); ++ii)
+        list.append(jsString(exec, value[ii]));
+    return constructArray(exec, list);
+}
+
 JSValue JSWebGLRenderingContext::getTexParameter(ExecState* exec)
 {
     return getObjectParameter(this, exec, kTexture);
diff --git a/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index 445a76d..048cef5 100644
--- a/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -41,6 +41,7 @@
 #include <wtf/FastMalloc.h>
 
 #include "V8Binding.h"
+#include "V8BindingMacros.h"
 #include "V8ArrayBufferView.h"
 #include "V8WebGLBuffer.h"
 #include "V8Int8Array.h"
@@ -60,6 +61,7 @@
 #include "V8HTMLImageElement.h"
 #include "V8HTMLVideoElement.h"
 #include "V8ImageData.h"
+#include "V8OESTextureFloat.h"
 #include "V8Proxy.h"
 #include "WebGLRenderingContext.h"
 
@@ -151,6 +153,21 @@ static v8::Handle<v8::Value> toV8Object(const WebGLGetInfo& info)
     }
 }
 
+static v8::Handle<v8::Value> toV8Object(WebGLExtension* extension, v8::Handle<v8::Object> contextObject)
+{
+    if (!extension)
+        return v8::Null();
+    v8::Handle<v8::Value> extensionObject;
+    switch (extension->getName()) {
+    case WebGLExtension::OESTextureFloatName:
+        extensionObject = toV8(static_cast<OESTextureFloat*>(extension));
+        break;
+    }
+    ASSERT(!extensionObject.IsEmpty());
+    V8DOMWrapper::setHiddenReference(contextObject, extensionObject);
+    return extensionObject;
+}
+
 enum ObjectType {
     kBuffer, kRenderbuffer, kTexture, kVertexAttrib
 };
@@ -243,6 +260,19 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getBufferParameterCallback(const
     return getObjectParameter(args, kBuffer);
 }
 
+v8::Handle<v8::Value> V8WebGLRenderingContext::getExtensionCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.WebGLRenderingContext.getExtensionCallback()");
+    WebGLRenderingContext* imp = V8WebGLRenderingContext::toNative(args.Holder());
+    if (args.Length() < 1) {
+        V8Proxy::setDOMException(SYNTAX_ERR);
+        return notHandledByInterceptor();
+    }
+    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, name, args[0]);
+    WebGLExtension* extension = imp->getExtension(name);
+    return toV8Object(extension, args.Holder());
+}
+
 v8::Handle<v8::Value> V8WebGLRenderingContext::getFramebufferAttachmentParameterCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLRenderingContext.getFramebufferAttachmentParameter()");
@@ -341,6 +371,17 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getShaderParameterCallback(const
     return toV8Object(info);
 }
 
+v8::Handle<v8::Value> V8WebGLRenderingContext::getSupportedExtensionsCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.WebGLRenderingContext.getSupportedExtensionsCallback()");
+    WebGLRenderingContext* imp = V8WebGLRenderingContext::toNative(args.Holder());
+    Vector<String> value = imp->getSupportedExtensions();
+    v8::Local<v8::Array> array = v8::Array::New(value.size());
+    for (size_t ii = 0; ii < value.size(); ++ii)
+        array->Set(v8::Integer::New(ii), v8::String::New(fromWebCoreString(value[ii]), value[ii].length()));
+    return array;
+}
+
 v8::Handle<v8::Value> V8WebGLRenderingContext::getTexParameterCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.WebGLRenderingContext.getTexParameter()");
diff --git a/WebCore/html/canvas/OESTextureFloat.cpp b/WebCore/html/canvas/OESTextureFloat.cpp
new file mode 100644
index 0000000..dab3caf
--- /dev/null
+++ b/WebCore/html/canvas/OESTextureFloat.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(3D_CANVAS)
+
+#include "OESTextureFloat.h"
+
+namespace WebCore {
+
+OESTextureFloat::OESTextureFloat() : WebGLExtension()
+{
+}
+
+OESTextureFloat::~OESTextureFloat()
+{
+}
+
+WebGLExtension::ExtensionName OESTextureFloat::getName() const
+{
+    return OESTextureFloatName;
+}
+
+PassRefPtr<OESTextureFloat> OESTextureFloat::create()
+{
+    return adoptRef(new OESTextureFloat);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/OESTextureFloat.h b/WebCore/html/canvas/OESTextureFloat.h
new file mode 100644
index 0000000..c99bb2f
--- /dev/null
+++ b/WebCore/html/canvas/OESTextureFloat.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OESTextureFloat_h
+#define OESTextureFloat_h
+
+#include "WebGLExtension.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class OESTextureFloat : public WebGLExtension {
+public:
+    static PassRefPtr<OESTextureFloat> create();
+
+    virtual ~OESTextureFloat();
+    virtual ExtensionName getName() const;
+
+private:
+    OESTextureFloat();
+};
+
+} // namespace WebCore
+
+#endif // OESTextureFloat_h
diff --git a/WebCore/html/canvas/OESTextureFloat.idl b/WebCore/html/canvas/OESTextureFloat.idl
new file mode 100644
index 0000000..e255875
--- /dev/null
+++ b/WebCore/html/canvas/OESTextureFloat.idl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module html {
+    interface [Conditional=3D_CANVAS, OmitConstructor] OESTextureFloat {
+    };
+}
diff --git a/WebCore/html/canvas/WebGLExtension.cpp b/WebCore/html/canvas/WebGLExtension.cpp
new file mode 100644
index 0000000..580e635
--- /dev/null
+++ b/WebCore/html/canvas/WebGLExtension.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(3D_CANVAS)
+
+#include "WebGLExtension.h"
+
+namespace WebCore {
+
+WebGLExtension::WebGLExtension()
+{
+}
+
+WebGLExtension::~WebGLExtension()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/WebGLExtension.h b/WebCore/html/canvas/WebGLExtension.h
new file mode 100644
index 0000000..3df3b73
--- /dev/null
+++ b/WebCore/html/canvas/WebGLExtension.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebGLExtension_h
+#define WebGLExtension_h
+
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebGLExtension : public RefCounted<WebGLExtension> {
+public:
+    // Extension names are needed to properly wrap instances in JavaScript objects.
+    enum ExtensionName {
+        OESTextureFloatName
+    };
+
+    virtual ~WebGLExtension();
+    virtual ExtensionName getName() const = 0;
+
+protected:
+    WebGLExtension();
+};
+
+} // namespace WebCore
+
+#endif // WebGLExtension_h
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 08e9ba8..ec28b14 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -43,6 +43,7 @@
 #include "ImageData.h"
 #include "IntSize.h"
 #include "NotImplemented.h"
+#include "OESTextureFloat.h"
 #include "RenderBox.h"
 #include "RenderLayer.h"
 #include "Uint16Array.h"
@@ -1462,6 +1463,20 @@ unsigned long WebGLRenderingContext::getError()
     return m_context->getError();
 }
 
+WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
+{
+    if (equalIgnoringCase(name, "OES_texture_float")
+        && m_context->getExtensions()->supports("GL_OES_texture_float")) {
+        if (!m_oesTextureFloat) {
+            m_context->getExtensions()->ensureEnabled("GL_OES_texture_float");
+            m_oesTextureFloat = OESTextureFloat::create();
+        }
+        return m_oesTextureFloat.get();
+    }
+
+    return 0;
+}
+
 WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned long target, unsigned long attachment, unsigned long pname, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
@@ -1857,6 +1872,14 @@ String WebGLRenderingContext::getShaderSource(WebGLShader* shader, ExceptionCode
     return m_context->getShaderSource(objectOrZero(shader));
 }
 
+Vector<String> WebGLRenderingContext::getSupportedExtensions()
+{
+    Vector<String> result;
+    if (m_context->getExtensions()->supports("GL_OES_texture_float"))
+        result.append("OES_texture_float");
+    return result;
+}
+
 WebGLGetInfo WebGLRenderingContext::getTexParameter(unsigned long target, unsigned long pname, ExceptionCode& ec)
 {
     UNUSED_PARAM(ec);
@@ -3596,6 +3619,11 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, u
     case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
     case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
         break;
+    case GraphicsContext3D::FLOAT:
+        if (m_oesTextureFloat)
+            break;
+        m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+        return false;
     default:
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
         return false;
@@ -3606,14 +3634,16 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, u
     case GraphicsContext3D::ALPHA:
     case GraphicsContext3D::LUMINANCE:
     case GraphicsContext3D::LUMINANCE_ALPHA:
-        if (type != GraphicsContext3D::UNSIGNED_BYTE) {
+        if (type != GraphicsContext3D::UNSIGNED_BYTE
+            && type != GraphicsContext3D::FLOAT) {
             m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
             return false;
         }
         break;
     case GraphicsContext3D::RGB:
         if (type != GraphicsContext3D::UNSIGNED_BYTE
-            && type != GraphicsContext3D::UNSIGNED_SHORT_5_6_5) {
+            && type != GraphicsContext3D::UNSIGNED_SHORT_5_6_5
+            && type != GraphicsContext3D::FLOAT) {
             m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
             return false;
         }
@@ -3621,7 +3651,8 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, u
     case GraphicsContext3D::RGBA:
         if (type != GraphicsContext3D::UNSIGNED_BYTE
             && type != GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4
-            && type != GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1) {
+            && type != GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1
+            && type != GraphicsContext3D::FLOAT) {
             m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
             return false;
         }
@@ -3710,6 +3741,12 @@ bool WebGLRenderingContext::validateTexFuncData(long width, long height,
             return false;
         }
         break;
+    case GraphicsContext3D::FLOAT: // OES_texture_float
+        if (!pixels->isFloatArray()) {
+            m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+            return false;
+        }
+        break;
     default:
         ASSERT_NOT_REACHED();
     }
@@ -4079,6 +4116,22 @@ void WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation()
     m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, objectOrZero(m_boundArrayBuffer.get()));
 }
 
+int WebGLRenderingContext::getNumberOfExtensions()
+{
+    return (m_oesTextureFloat ? 1 : 0);
+}
+
+WebGLExtension* WebGLRenderingContext::getExtensionNumber(int i)
+{
+    if (m_oesTextureFloat) {
+        if (!i)
+            return m_oesTextureFloat.get();
+        --i;
+    }
+    // Similar tests for other extensions would go here.
+    return 0;
+}
+
 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity)
     : m_buffers(new OwnPtr<ImageBuffer>[capacity])
     , m_capacity(capacity)
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index a94d4bd..f4bd047 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -43,6 +43,7 @@ namespace WebCore {
 class WebGLActiveInfo;
 class WebGLBuffer;
 class WebGLContextAttributes;
+class WebGLExtension;
 class WebGLFramebuffer;
 class WebGLObject;
 class WebGLProgram;
@@ -55,6 +56,7 @@ class HTMLVideoElement;
 class ImageBuffer;
 class ImageData;
 class IntSize;
+class OESTextureFloat;
 
 class WebGLRenderingContext : public CanvasRenderingContext {
 public:
@@ -145,6 +147,8 @@ public:
 
     unsigned long getError();
 
+    WebGLExtension* getExtension(const String& name);
+
     WebGLGetInfo getFramebufferAttachmentParameter(unsigned long target, unsigned long attachment, unsigned long pname, ExceptionCode&);
 
     WebGLGetInfo getParameter(unsigned long pname, ExceptionCode&);
@@ -164,6 +168,8 @@ public:
 
     String getShaderSource(WebGLShader*, ExceptionCode&);
 
+    Vector<String> getSupportedExtensions();
+
     WebGLGetInfo getTexParameter(unsigned long target, unsigned long pname, ExceptionCode&);
 
     WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*, ExceptionCode&);
@@ -292,6 +298,10 @@ public:
 
     void removeObject(WebGLObject*);
 
+    // Helpers for JSC bindings.
+    int getNumberOfExtensions();
+    WebGLExtension* getExtensionNumber(int i);
+
   private:
     friend class WebGLObject;
 
@@ -456,6 +466,9 @@ public:
     bool m_isResourceSafe;
     bool m_isDepthStencilSupported;
 
+    // Enabled extension objects.
+    RefPtr<OESTextureFloat> m_oesTextureFloat;
+
     // Helpers for getParameter and others
     WebGLGetInfo getBooleanParameter(unsigned long pname);
     WebGLGetInfo getBooleanArrayParameter(unsigned long pname);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index afac638..0cc2e40 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -29,6 +29,7 @@ module html {
         Conditional=3D_CANVAS,
         InterfaceUUID=98fb48ae-7216-489c-862b-8e1217fc4443,
         ImplementationUUID=ab4f0781-152f-450e-9546-5b3987491a54,
+        CustomMarkFunction,
         DontCheckEnums
     ] WebGLRenderingContext : CanvasRenderingContext {
 
@@ -287,7 +288,6 @@ module html {
         const unsigned int VENDOR                         = 0x1F00;
         const unsigned int RENDERER                       = 0x1F01;
         const unsigned int VERSION                        = 0x1F02;
-        const unsigned int EXTENSIONS                     = 0x1F03;
 
         /* TextureMagFilter */
         const unsigned int NEAREST                        = 0x2600;
@@ -535,6 +535,9 @@ module html {
 
         [StrictTypeChecking] unsigned long getError();
 
+        // object getExtension(in DOMString name);
+        [StrictTypeChecking, Custom] void getExtension(in DOMString name);
+
         // any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException);
         [StrictTypeChecking, Custom] void getFramebufferAttachmentParameter();
         // any getParameter(in unsigned long pname) raises(DOMException);
@@ -554,6 +557,9 @@ module html {
 
         [StrictTypeChecking, ConvertNullStringTo=Null] DOMString    getShaderSource(in WebGLShader shader) raises(DOMException);
 
+        // DOMString[] getSupportedExtensions()
+        [StrictTypeChecking, Custom] void getSupportedExtensions();
+
         // any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
         [StrictTypeChecking, Custom] void getTexParameter();
 
diff --git a/WebCore/platform/graphics/Extensions3D.h b/WebCore/platform/graphics/Extensions3D.h
index 74210a5..0363a48 100644
--- a/WebCore/platform/graphics/Extensions3D.h
+++ b/WebCore/platform/graphics/Extensions3D.h
@@ -50,11 +50,17 @@ public:
     //   GL_ARB_texture_non_power_of_two / GL_OES_texture_npot
     //   GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil
     //   GL_ANGLE_framebuffer_blit / GL_ANGLE_framebuffer_multisample
+    //   GL_OES_texture_float
 
     // Takes full name of extension; for example,
     // "GL_EXT_texture_format_BGRA8888".
     virtual bool supports(const String&) = 0;
 
+    // Certain OpenGL and WebGL implementations may support enabling
+    // extensions lazily. This method may only be called with
+    // extension names for which supports returns true.
+    virtual void ensureEnabled(const String&) = 0;
+
     enum ExtensionsEnumType {
         // GL_EXT_texture_format_BGRA8888 enums
         BGRA_EXT = 0x80E1,
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index d0ee639..d6d1de7 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -86,6 +86,9 @@ bool GraphicsContext3D::computeFormatAndTypeParameters(unsigned int format,
         *componentsPerPixel = 1;
         *bytesPerComponent = sizeof(unsigned short);
         break;
+    case GraphicsContext3D::FLOAT: // OES_texture_float
+        *bytesPerComponent = sizeof(float);
+        break;
     default:
         return false;
     }
@@ -188,6 +191,27 @@ bool GraphicsContext3D::extractTextureData(unsigned int width, unsigned int heig
             ASSERT_NOT_REACHED();
         }
         break;
+    case FLOAT: // OES_texture_float
+        switch (format) {
+        case RGBA:
+            sourceDataFormat = SourceFormatRGBA32F;
+            break;
+        case RGB:
+            sourceDataFormat = SourceFormatRGB32F;
+            break;
+        case ALPHA:
+            sourceDataFormat = SourceFormatA32F;
+            break;
+        case LUMINANCE:
+            sourceDataFormat = SourceFormatR32F;
+            break;
+        case LUMINANCE_ALPHA:
+            sourceDataFormat = SourceFormatRA32F;
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        }
+        break;
     case UNSIGNED_SHORT_5_5_5_1:
         sourceDataFormat = SourceFormatRGBA5551;
         break;
@@ -501,6 +525,38 @@ void unpackA16BigToRGBA8(const uint16_t* source, uint8_t* destination)
     destination[3] = convertColor16BigTo8(source[0]);
 }
 
+void unpackRGB32FToRGBA32F(const float* source, float* destination)
+{
+    destination[0] = source[0];
+    destination[1] = source[1];
+    destination[2] = source[2];
+    destination[3] = 1;
+}
+
+void unpackR32FToRGBA32F(const float* source, float* destination)
+{
+    destination[0] = source[0];
+    destination[1] = source[0];
+    destination[2] = source[0];
+    destination[3] = 1;
+}
+
+void unpackRA32FToRGBA32F(const float* source, float* destination)
+{
+    destination[0] = source[0];
+    destination[1] = source[0];
+    destination[2] = source[0];
+    destination[3] = source[1];
+}
+
+void unpackA32FToRGBA32F(const float* source, float* destination)
+{
+    destination[0] = 0;
+    destination[1] = 0;
+    destination[2] = 0;
+    destination[3] = source[0];
+}
+
 //----------------------------------------------------------------------
 // Pixel packing routines.
 //
@@ -713,14 +769,68 @@ void packRGBA8ToUnsignedShort565Unmultiply(const uint8_t* source, uint16_t* dest
                     | ((sourceB & 0xF8) >> 3));
 }
 
+void packRGBA32FToRGB32F(const float* source, float* destination)
+{
+    destination[0] = source[0];
+    destination[1] = source[1];
+    destination[2] = source[2];
+}
+
+void packRGBA32FToRGB32FPremultiply(const float* source, float* destination)
+{
+    float scaleFactor = source[3];
+    destination[0] = source[0] * scaleFactor;
+    destination[1] = source[1] * scaleFactor;
+    destination[2] = source[2] * scaleFactor;
+}
+
+void packRGBA32FToRGBA32FPremultiply(const float* source, float* destination)
+{
+    float scaleFactor = source[3];
+    destination[0] = source[0] * scaleFactor;
+    destination[1] = source[1] * scaleFactor;
+    destination[2] = source[2] * scaleFactor;
+    destination[3] = source[3];
+}
+
+void packRGBA32FToA32F(const float* source, float* destination)
+{
+    destination[0] = source[3];
+}
+
+void packRGBA32FToR32F(const float* source, float* destination)
+{
+    destination[0] = source[0];
+}
+
+void packRGBA32FToR32FPremultiply(const float* source, float* destination)
+{
+    float scaleFactor = source[3];
+    destination[0] = source[0] * scaleFactor;
+}
+
+
+void packRGBA32FToRA32F(const float* source, float* destination)
+{
+    destination[0] = source[0];
+    destination[1] = source[3];
+}
+
+void packRGBA32FToRA32FPremultiply(const float* source, float* destination)
+{
+    float scaleFactor = source[3];
+    destination[0] = source[0] * scaleFactor;
+    destination[1] = scaleFactor;
+}
+
 } // anonymous namespace
 
 // This is used whenever unpacking is necessary; i.e., the source data
-// is not in RGBA8 format, or the unpack alignment specifies that rows
-// are not tightly packed.
-template<typename SourceType, typename DestType,
-         void unpackingFunc(const SourceType*, uint8_t*),
-         void packingFunc(const uint8_t*, DestType*)>
+// is not in RGBA8/RGBA32F format, or the unpack alignment specifies
+// that rows are not tightly packed.
+template<typename SourceType, typename IntermediateType, typename DestType,
+         void unpackingFunc(const SourceType*, IntermediateType*),
+         void packingFunc(const IntermediateType*, DestType*)>
 static void doUnpackingAndPacking(const SourceType* sourceData,
                                   unsigned int width,
                                   unsigned int height,
@@ -732,7 +842,7 @@ static void doUnpackingAndPacking(const SourceType* sourceData,
     if (!sourceElementsPerRow) {
         unsigned int numElements = width * height * sourceElementsPerPixel;
         const SourceType* endPointer = sourceData + numElements;
-        uint8_t temporaryRGBAData[4];
+        IntermediateType temporaryRGBAData[4];
         while (sourceData < endPointer) {
             unpackingFunc(sourceData, temporaryRGBAData);
             packingFunc(temporaryRGBAData, destinationData);
@@ -740,7 +850,7 @@ static void doUnpackingAndPacking(const SourceType* sourceData,
             destinationData += destinationElementsPerPixel;
         }
     } else {
-        uint8_t temporaryRGBAData[4];
+        IntermediateType temporaryRGBAData[4];
         for (unsigned int y = 0; y < height; ++y) {
             const SourceType* currentSource = sourceData;
             for (unsigned int x = 0; x < width; ++x) {
@@ -802,176 +912,176 @@ static void doPacking(const void* sourceData,
                 destinationData += destinationElementsPerPixel;
             }
         } else {
-            doUnpackingAndPacking<uint8_t, DestType, unpackRGBA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+            doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackRGBA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         }
         break;
     }
     case GraphicsContext3D::SourceFormatRGBA16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGBA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGBA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGBA16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGBA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGBA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGB8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 3, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackRGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackRGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGB16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 6, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGB16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGB16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGB16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 6, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatBGR8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 3, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackBGR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackBGR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatARGB8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackARGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackARGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatARGB16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackARGB16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackARGB16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatARGB16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackARGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackARGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatABGR8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackABGR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackABGR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatBGRA8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackBGRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackBGRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatBGRA16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackBGRA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackBGRA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatBGRA16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackBGRA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackBGRA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGBA5551: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGBA5551ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGBA5551ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGBA4444: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGBA4444ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGBA4444ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRGB565: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRGB565ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRGB565ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatR8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatR16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackR16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackR16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatR16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackR16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackR16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRA8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRA16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatRA16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackRA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackRA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatAR8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackAR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackAR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatAR16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackAR16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackAR16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatAR16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackAR16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackAR16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatA8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint8_t, DestType, unpackA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint8_t, uint8_t, DestType, unpackA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatA16Little: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     case GraphicsContext3D::SourceFormatA16Big: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
-        doUnpackingAndPacking<uint16_t, DestType, unpackA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        doUnpackingAndPacking<uint16_t, uint8_t, DestType, unpackA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
     default:
@@ -979,6 +1089,63 @@ static void doPacking(const void* sourceData,
     }
 }
 
+// This specialized routine is used only for floating-point texture uploads. It
+// does not need to be as general as doPacking, above; because there are
+// currently no native floating-point image formats in WebKit, there are only a
+// few upload paths.
+template<void packingFunc(const float*, float*)>
+static void doFloatingPointPacking(const void* sourceData,
+                                   GraphicsContext3D::SourceDataFormat sourceDataFormat,
+                                   unsigned int width,
+                                   unsigned int height,
+                                   unsigned int sourceUnpackAlignment,
+                                   float* destinationData,
+                                   unsigned int destinationElementsPerPixel)
+{
+    switch (sourceDataFormat) {
+    case GraphicsContext3D::SourceFormatRGBA8: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<float>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        ASSERT(!sourceElementsPerRow); // Guaranteed because each color channel is sizeof(float) bytes.
+        const float* source = static_cast<const float*>(sourceData);
+        unsigned int numElements = width * height * 4;
+        const float* endPointer = source + numElements;
+        while (source < endPointer) {
+            packingFunc(source, destinationData);
+            source += sourceElementsPerPixel;
+            destinationData += destinationElementsPerPixel;
+        }
+        break;
+    }
+    case GraphicsContext3D::SourceFormatRGB32F: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<float>(width, 3, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<float, float, float, unpackRGB32FToRGBA32F, packingFunc>(static_cast<const float*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
+    case GraphicsContext3D::SourceFormatR32F: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<float>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<float, float, float, unpackR32FToRGBA32F, packingFunc>(static_cast<const float*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
+    case GraphicsContext3D::SourceFormatRA32F: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<float>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<float, float, float, unpackRA32FToRGBA32F, packingFunc>(static_cast<const float*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
+    case GraphicsContext3D::SourceFormatA32F: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<float>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<float, float, float, unpackA32FToRGBA32F, packingFunc>(static_cast<const float*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
+    default:
+        ASSERT_NOT_REACHED();
+    }
+}
+
 bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
                                    GraphicsContext3D::SourceDataFormat sourceDataFormat,
                                    unsigned int width,
@@ -1113,6 +1280,87 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
         }
         break;
     }
+    case FLOAT: {
+        // OpenGL ES, and therefore WebGL, require that the format and
+        // internalformat be identical, which implies that the source and
+        // destination formats will both be floating-point in this branch -- at
+        // least, until WebKit supports floating-point image formats natively.
+        ASSERT(sourceDataFormat == SourceFormatRGBA32F || sourceDataFormat == SourceFormatRGB32F
+               || sourceDataFormat == SourceFormatRA32F || sourceDataFormat == SourceFormatR32F
+               || sourceDataFormat == SourceFormatA32F);
+        // Because WebKit doesn't use floating-point color channels for anything
+        // internally, there's no chance we have to do a (lossy) unmultiply
+        // operation.
+        ASSERT(alphaOp == AlphaDoNothing || alphaOp == AlphaDoPremultiply);
+        // For the source formats with an even number of channels (RGBA32F,
+        // RA32F) it is guaranteed that the pixel data is tightly packed because
+        // unpack alignment <= sizeof(float) * number of channels.
+        float* destination = static_cast<float*>(destinationData);
+        if (alphaOp == AlphaDoNothing
+            && ((sourceDataFormat == SourceFormatRGBA32F && destinationFormat == RGBA)
+                || (sourceDataFormat == SourceFormatRA32F && destinationFormat == LUMINANCE_ALPHA))) {
+            // No conversion necessary.
+            int numChannels = (sourceDataFormat == SourceFormatRGBA32F ? 4 : 2);
+            memcpy(destinationData, sourceData, width * height * numChannels * sizeof(float));
+            break;
+        }
+        switch (destinationFormat) {
+        case RGB:
+            switch (alphaOp) {
+            case AlphaDoNothing:
+                doFloatingPointPacking<packRGBA32FToRGB32F>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
+                break;
+            case AlphaDoPremultiply:
+                doFloatingPointPacking<packRGBA32FToRGB32FPremultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        case RGBA:
+            // AlphaDoNothing is handled above with fast path.
+            ASSERT(alphaOp == AlphaDoPremultiply);
+            doFloatingPointPacking<packRGBA32FToRGBA32FPremultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
+            break;
+        case ALPHA:
+            // From the desktop OpenGL conversion rules (OpenGL 2.1
+            // specification, Table 3.15), the alpha channel is chosen
+            // from the RGBA data.
+            doFloatingPointPacking<packRGBA32FToA32F>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
+            break;
+        case LUMINANCE:
+            // From the desktop OpenGL conversion rules (OpenGL 2.1
+            // specification, Table 3.15), the red channel is chosen
+            // from the RGBA data.
+            switch (alphaOp) {
+            case AlphaDoNothing:
+                doFloatingPointPacking<packRGBA32FToR32F>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
+                break;
+            case AlphaDoPremultiply:
+                doFloatingPointPacking<packRGBA32FToR32FPremultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        case LUMINANCE_ALPHA:
+            // From the desktop OpenGL conversion rules (OpenGL 2.1
+            // specification, Table 3.15), the red and alpha channels
+            // are chosen from the RGBA data.
+            switch (alphaOp) {
+            case AlphaDoNothing:
+                doFloatingPointPacking<packRGBA32FToRA32F>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
+                break;
+            case AlphaDoPremultiply:
+                doFloatingPointPacking<packRGBA32FToRA32FPremultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        }
+        break;
+    }
     }
     return true;
 }
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index c2d5c24..d455b65 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -536,9 +536,11 @@ public:
         SourceFormatRGBA8 = 0,
         SourceFormatRGBA16Little,
         SourceFormatRGBA16Big,
+        SourceFormatRGBA32F,
         SourceFormatRGB8,
         SourceFormatRGB16Little,
         SourceFormatRGB16Big,
+        SourceFormatRGB32F,
         SourceFormatBGR8,
         SourceFormatBGRA8,
         SourceFormatBGRA16Little,
@@ -553,15 +555,18 @@ public:
         SourceFormatR8,
         SourceFormatR16Little,
         SourceFormatR16Big,
+        SourceFormatR32F,
         SourceFormatRA8,
         SourceFormatRA16Little,
         SourceFormatRA16Big,
+        SourceFormatRA32F,
         SourceFormatAR8,
         SourceFormatAR16Little,
         SourceFormatAR16Big,
         SourceFormatA8,
         SourceFormatA16Little,
         SourceFormatA16Big,
+        SourceFormatA32F,
         SourceFormatNumFormats
     };
 
diff --git a/WebCore/platform/graphics/chromium/Extensions3DChromium.h b/WebCore/platform/graphics/chromium/Extensions3DChromium.h
index 5fda020..d120424 100644
--- a/WebCore/platform/graphics/chromium/Extensions3DChromium.h
+++ b/WebCore/platform/graphics/chromium/Extensions3DChromium.h
@@ -42,6 +42,7 @@ public:
 
     // Extensions3D methods.
     virtual bool supports(const String&);
+    virtual void ensureEnabled(const String&);
     virtual int getGraphicsResetStatusARB();
     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) { }
     virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) { }
diff --git a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
index a6fa5d9..510a705 100644
--- a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
+++ b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
@@ -76,10 +76,23 @@ bool Extensions3DOpenGL::supports(const String& name)
         return m_availableExtensions.contains("GL_EXT_framebuffer_blit");
     if (name == "GL_ANGLE_framebuffer_multisample")
         return m_availableExtensions.contains("GL_EXT_framebuffer_multisample");
-        
+
+    // If GL_ARB_texture_float is available then we report GL_OES_texture_float and
+    // GL_OES_texture_half_float as available.
+    if (name == "GL_OES_texture_float" || name == "GL_OES_texture_half_float")
+        return m_availableExtensions.contains("GL_ARB_texture_float");
+
     return m_availableExtensions.contains(name);
 }
 
+void Extensions3DOpenGL::ensureEnabled(const String& name)
+{
+#ifndef NDEBUG
+    UNUSED_PARAM(name);
+#endif
+    ASSERT(supports(name));
+}
+
 int Extensions3DOpenGL::getGraphicsResetStatusARB()
 {
     return GraphicsContext3D::NO_ERROR;
diff --git a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
index 0fbe022..59f8180 100644
--- a/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
+++ b/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
@@ -40,6 +40,7 @@ public:
 
     // Extensions3D methods.
     virtual bool supports(const String&);
+    virtual void ensureEnabled(const String&);
     virtual int getGraphicsResetStatusARB();
     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);
     virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);    
diff --git a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
index af1c8cd..4cccd33 100644
--- a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
+++ b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
@@ -1329,7 +1329,15 @@ int GraphicsContext3D::texImage2D(unsigned target, unsigned level, unsigned inte
 {
     makeContextCurrent();
 
-    ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+    unsigned openGLInternalFormat = internalformat;
+    if (type == GL_FLOAT) {
+        if (format == GL_RGBA)
+            openGLInternalFormat = GL_RGBA32F_ARB;
+        else if (format == GL_RGB)
+            openGLInternalFormat = GL_RGB32F_ARB;
+    }
+
+    ::glTexImage2D(target, level, openGLInternalFormat, width, height, border, format, type, pixels);
     return 0;
 }
 
diff --git a/WebCore/platform/graphics/qt/Extensions3DQt.cpp b/WebCore/platform/graphics/qt/Extensions3DQt.cpp
index 6a34671..cd28f0e 100644
--- a/WebCore/platform/graphics/qt/Extensions3DQt.cpp
+++ b/WebCore/platform/graphics/qt/Extensions3DQt.cpp
@@ -46,6 +46,11 @@ bool Extensions3DQt::supports(const String&)
     return false;
 }
 
+void Extensions3DQt::ensureEnabled(const String& name)
+{
+    ASSERT(supports(name));
+}
+
 int Extensions3DQt::getGraphicsResetStatusARB()
 {
     return GraphicsContext3D::NO_ERROR;
diff --git a/WebCore/platform/graphics/qt/Extensions3DQt.h b/WebCore/platform/graphics/qt/Extensions3DQt.h
index 29209ba..ae4b375 100644
--- a/WebCore/platform/graphics/qt/Extensions3DQt.h
+++ b/WebCore/platform/graphics/qt/Extensions3DQt.h
@@ -36,6 +36,7 @@ public:
 
     // Extensions3D methods.
     virtual bool supports(const String&);
+    virtual void ensureEnabled(const String&);
     virtual int getGraphicsResetStatusARB();
 
 private:
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 4f08996..c92aca6 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,26 @@
+2010-12-10  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by James Robinson.
+
+        Implement extension entry points and remove EXTENSIONS enum
+        https://bugs.webkit.org/show_bug.cgi?id=40316
+
+        Added support for ensuring that a particular OpenGL extension is
+        enabled.
+
+        * public/WebGraphicsContext3D.h:
+        * src/Extensions3DChromium.cpp:
+        (WebCore::Extensions3DChromium::ensureEnabled):
+        * src/GraphicsContext3DChromium.cpp:
+        (WebCore::GraphicsContext3DInternal::initializeExtensions):
+        (WebCore::GraphicsContext3DInternal::supportsExtension):
+        (WebCore::GraphicsContext3DInternal::ensureExtensionEnabled):
+        * src/GraphicsContext3DInternal.h:
+        * src/WebGraphicsContext3DDefaultImpl.cpp:
+        (WebKit::WebGraphicsContext3DDefaultImpl::getRequestableExtensionsCHROMIUM):
+        (WebKit::WebGraphicsContext3DDefaultImpl::requestExtensionCHROMIUM):
+        * src/WebGraphicsContext3DDefaultImpl.h:
+
 2010-12-10  John Knottenbelt  <jknotten at chromium.org>
 
         Reviewed by Steve Block.
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
index 05c164a..035b140 100644
--- a/WebKit/chromium/public/WebGraphicsContext3D.h
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -140,6 +140,10 @@ public:
     // GL_CHROMIUM_copy_texture_to_parent_texture
     virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) = 0;
 
+    // GL_CHROMIUM_request_extension
+    virtual WebString getRequestableExtensionsCHROMIUM() = 0;
+    virtual void requestExtensionCHROMIUM(const char*) = 0;
+
     // The entry points below map directly to the OpenGL ES 2.0 API.
     // See: http://www.khronos.org/registry/gles/
     // and: http://www.khronos.org/opengles/sdk/docs/man/
diff --git a/WebKit/chromium/src/Extensions3DChromium.cpp b/WebKit/chromium/src/Extensions3DChromium.cpp
index fe04986..ca2215e 100644
--- a/WebKit/chromium/src/Extensions3DChromium.cpp
+++ b/WebKit/chromium/src/Extensions3DChromium.cpp
@@ -48,6 +48,15 @@ bool Extensions3DChromium::supports(const String& name)
     return m_internal->supportsExtension(name);
 }
 
+void Extensions3DChromium::ensureEnabled(const String& name)
+{
+#ifndef NDEBUG
+    bool result =
+#endif
+        m_internal->ensureExtensionEnabled(name);
+    ASSERT(result);
+}
+
 int Extensions3DChromium::getGraphicsResetStatusARB()
 {
     return m_internal->isContextLost() ? static_cast<int>(Extensions3D::UNKNOWN_CONTEXT_RESET_ARB) : static_cast<int>(GraphicsContext3D::NO_ERROR);
diff --git a/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/WebKit/chromium/src/GraphicsContext3DChromium.cpp
index cc0c5bc..2dff52b 100644
--- a/WebKit/chromium/src/GraphicsContext3DChromium.cpp
+++ b/WebKit/chromium/src/GraphicsContext3DChromium.cpp
@@ -681,17 +681,54 @@ Extensions3D* GraphicsContext3DInternal::getExtensions()
     return m_extensions.get();
 }
 
-bool GraphicsContext3DInternal::supportsExtension(const String& name)
+namespace {
+
+void splitStringHelper(const String& str, HashSet<String>& set)
+{
+    Vector<String> substrings;
+    str.split(" ", substrings);
+    for (size_t i = 0; i < substrings.size(); ++i)
+        set.add(substrings[i]);
+}
+
+} // anonymous namespace
+
+void GraphicsContext3DInternal::initializeExtensions()
 {
     if (!m_initializedAvailableExtensions) {
         String extensionsString = getString(GraphicsContext3D::EXTENSIONS);
-        Vector<String> availableExtensions;
-        extensionsString.split(" ", availableExtensions);
-        for (size_t i = 0; i < availableExtensions.size(); ++i)
-            m_availableExtensions.add(availableExtensions[i]);
+        splitStringHelper(extensionsString, m_enabledExtensions);
+
+        String requestableExtensionsString = m_impl->getRequestableExtensionsCHROMIUM();
+        splitStringHelper(requestableExtensionsString, m_requestableExtensions);
+
         m_initializedAvailableExtensions = true;
     }
-    return m_availableExtensions.contains(name);
+}
+
+
+bool GraphicsContext3DInternal::supportsExtension(const String& name)
+{
+    initializeExtensions();
+    return m_enabledExtensions.contains(name) || m_requestableExtensions.contains(name);
+}
+
+bool GraphicsContext3DInternal::ensureExtensionEnabled(const String& name)
+{
+    initializeExtensions();
+
+    if (m_enabledExtensions.contains(name))
+        return true;
+
+    if (m_requestableExtensions.contains(name)) {
+        m_impl->requestExtensionCHROMIUM(name.ascii().data());
+        m_enabledExtensions.clear();
+        m_requestableExtensions.clear();
+        m_initializedAvailableExtensions = false;
+    }
+
+    initializeExtensions();
+    return m_enabledExtensions.contains(name);
 }
 
 DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*)
diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h
index 220cbb8..ad54a4f 100644
--- a/WebKit/chromium/src/GraphicsContext3DInternal.h
+++ b/WebKit/chromium/src/GraphicsContext3DInternal.h
@@ -265,6 +265,7 @@ public:
     // Extensions3D support.
     Extensions3D* getExtensions();
     bool supportsExtension(const String& name);
+    bool ensureExtensionEnabled(const String& name);
 
     // EXT_texture_format_BGRA8888
     bool supportsBGRA();
@@ -285,7 +286,8 @@ private:
     OwnPtr<Extensions3DChromium> m_extensions;
     WebKit::WebViewImpl* m_webViewImpl;
     bool m_initializedAvailableExtensions;
-    HashSet<String> m_availableExtensions;
+    HashSet<String> m_enabledExtensions;
+    HashSet<String> m_requestableExtensions;
 #if USE(ACCELERATED_COMPOSITING)
     RefPtr<WebGLLayerChromium> m_compositingLayer;
 #endif
@@ -301,6 +303,8 @@ private:
 #if PLATFORM(CG)
     unsigned char* m_renderOutput;
 #endif
+
+    void initializeExtensions();
 };
 
 } // namespace WebCore
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 9a74601..d1ad1cc 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -624,6 +624,15 @@ void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigne
     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
 }
 
+WebString WebGraphicsContext3DDefaultImpl::getRequestableExtensionsCHROMIUM()
+{
+    return WebString();
+}
+
+void WebGraphicsContext3DDefaultImpl::requestExtensionCHROMIUM(const char*)
+{
+}
+
 // Helper macros to reduce the amount of code.
 
 #define DELEGATE_TO_GL(name, glname)                                           \
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 32e3671..b656d0c 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -85,6 +85,9 @@ public:
     virtual void unmapTexSubImage2DCHROMIUM(const void*);
     virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
 
+    virtual WebString getRequestableExtensionsCHROMIUM();
+    virtual void requestExtensionCHROMIUM(const char*);
+
     virtual void activeTexture(unsigned long texture);
     virtual void attachShader(WebGLId program, WebGLId shader);
     virtual void bindAttribLocation(WebGLId program, unsigned long index, const char* name);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list