Implement frag depth as a WebGL 1 extension.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 00:56:33 +0000 (00:56 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 00:56:33 +0000 (00:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133635.
<rdar://problem/19195381>
Reviewed by Dean Jackson.
Test:
webgl/1.0.3/conformance/extensions/ext-frag-depth.html
Spec for this extension outlined here:
http://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS):
* html/canvas/EXTFragDepth.cpp: Added.
(WebCore::EXTFragDepth::EXTFragDepth):
(WebCore::EXTFragDepth::~EXTFragDepth):
(WebCore::EXTFragDepth::getName):
* html/canvas/EXTFragDepth.h: Added.
* html/canvas/EXTFragDepth.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/canvas/WebGLRenderingContext.h:
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::ensureEnabled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177194 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/html/canvas/EXTFragDepth.cpp [new file with mode: 0644]
Source/WebCore/html/canvas/EXTFragDepth.h [new file with mode: 0644]
Source/WebCore/html/canvas/EXTFragDepth.idl [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLExtension.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.h
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp

index 540ed95..2d09bdd 100644 (file)
@@ -1,3 +1,13 @@
+2014-12-11  Roger Fong  <roger_fong@apple.com>
+
+        Implement frag depth as a WebGL 1 extension.
+        https://bugs.webkit.org/show_bug.cgi?id=133635.
+        <rdar://problem/19195381>
+
+        Reviewed by Dean Jackson.
+
+        * platform/mac/TestExpectations: Unskip passing WebGL1 extension tests.
+
 2014-12-11  Brendan Long  <b.long@cablelabs.com>
 
         Remove DataCue "text" attribute
index e4df25e..d359547 100644 (file)
@@ -491,7 +491,21 @@ webgl/1.0.2/conformance/glsl/misc/shader-with-non-reserved-words.html [ Failure
 [ MountainLion ] webgl/1.0.2/conformance/textures/texture-size.html [ Failure ]
 
 # Skip 1.0.3 tests for now, to be unskipped when we get closer to conformance
-webgl/1.0.3
+webgl/1.0.3/conformance/attribs [ Skip ]
+webgl/1.0.3/conformance/buffers [ Skip ]
+webgl/1.0.3/conformance/canvas [ Skip ]
+webgl/1.0.3/conformance/context [ Skip ]
+webgl/1.0.3/conformance/glsl [ Skip ]
+webgl/1.0.3/conformance/renderbuffers [ Skip ]
+webgl/1.0.3/conformance/rendering [ Skip ]
+webgl/1.0.3/conformance/state [ Skip ]
+webgl/1.0.3/conformance/textures [ Skip ]
+webgl/1.0.3/conformance/typedarrays [ Skip ]
+webgl/1.0.3/conformance/uniforms [ Skip ]
+webgl/1.0.3/conformance/extensions/angle-instanced-arrays.html [ Skip ]
+webgl/1.0.3/conformance/extensions/oes-texture-half-float.html [ Skip ]
+webgl/1.0.3/conformance/extensions/webgl-compressed-texture-size-limit.html [ Skip ]
+webgl/1.0.3/conformance/extensions/webgl-draw-buffers.html [ Skip ]
 
 # Sending the mouse down event to the scrollbar starts a nested run loop which causes a hang.
 fast/events/mousedown-in-subframe-scrollbar.html [ Skip ]
index 1608ed3..aec7f8b 100644 (file)
@@ -532,6 +532,7 @@ set(WebCore_NON_SVG_IDL_FILES
     html/canvas/CanvasRenderingContext.idl
     html/canvas/CanvasRenderingContext2D.idl
     html/canvas/DOMPath.idl
+    html/canvas/EXTFragDepth.idl
     html/canvas/EXTShaderTextureLOD.idl
     html/canvas/EXTTextureFilterAnisotropic.idl
     html/canvas/EXTsRGB.idl
@@ -1674,6 +1675,7 @@ set(WebCore_SOURCES
     html/canvas/CanvasRenderingContext.cpp
     html/canvas/CanvasRenderingContext2D.cpp
     html/canvas/CanvasStyle.cpp
+    html/canvas/EXTFragDepth.cpp
     html/canvas/EXTShaderTextureLOD.cpp
     html/canvas/EXTTextureFilterAnisotropic.cpp
     html/canvas/EXTsRGB.cpp
@@ -2805,6 +2807,7 @@ if (ENABLE_WEBGL)
 
     list(APPEND WebCore_SOURCES
         html/canvas/ANGLEInstancedArrays.cpp
+        html/canvas/EXTFragDepth.cpp
         html/canvas/EXTShaderTextureLOD.cpp
         html/canvas/EXTTextureFilterAnisotropic.cpp
         html/canvas/EXTsRGB.cpp
@@ -2844,6 +2847,7 @@ if (ENABLE_WEBGL)
     )
     list(APPEND WebCore_IDL_FILES
         html/canvas/ANGLEInstancedArrays.idl
+        html/canvas/EXTFragDepth.idl
         html/canvas/EXTShaderTextureLOD.idl
         html/canvas/EXTTextureFilterAnisotropic.idl
         html/canvas/EXTsRGB.idl
index 1b7993e..3b9d3ae 100644 (file)
@@ -1,3 +1,41 @@
+2014-12-10  Roger Fong  <roger_fong@apple.com>
+
+        Implement frag depth as a WebGL 1 extension.
+        https://bugs.webkit.org/show_bug.cgi?id=133635.
+        <rdar://problem/19195381>
+
+        Reviewed by Dean Jackson.
+
+        Test:
+        webgl/1.0.3/conformance/extensions/ext-frag-depth.html
+
+        Spec for this extension outlined here:
+        http://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::toJS):
+        * html/canvas/EXTFragDepth.cpp: Added.
+        (WebCore::EXTFragDepth::EXTFragDepth):
+        (WebCore::EXTFragDepth::~EXTFragDepth):
+        (WebCore::EXTFragDepth::getName):
+        * html/canvas/EXTFragDepth.h: Added.
+        * html/canvas/EXTFragDepth.idl: Added.
+        * html/canvas/WebGLExtension.h:
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getExtension):
+        (WebCore::WebGLRenderingContext::getSupportedExtensions):
+        * html/canvas/WebGLRenderingContext.h:
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::supportsExtension):
+        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+        (WebCore::Extensions3DOpenGLCommon::ensureEnabled):
+
 2014-12-11  Chris Dumez  <cdumez@apple.com>
 
         Optimize RenderElement::rendererForRootBackground() a bit
index d641f07..5568a24 100644 (file)
@@ -42,6 +42,7 @@
 #include "JSCanvasRenderingContext.cpp"
 #include "JSCanvasRenderingContext2D.cpp"
 #if ENABLE(WEBGL)
+#include "JSEXTFragDepth.cpp"
 #include "JSEXTShaderTextureLOD.cpp"
 #include "JSEXTTextureFilterAnisotropic.cpp"
 #include "JSEXTsRGB.cpp"
index 03c96fb..69e9a93 100644 (file)
@@ -425,6 +425,7 @@ NON_SVG_BINDING_IDLS = \
     $(WebCore)/html/canvas/EXTShaderTextureLOD.idl \
     $(WebCore)/html/canvas/EXTTextureFilterAnisotropic.idl \
     $(WebCore)/html/canvas/EXTsRGB.idl \
+    $(WebCore)/html/canvas/EXTFragDepth.idl \
     $(WebCore)/html/canvas/OESElementIndexUint.idl \
     $(WebCore)/html/canvas/OESStandardDerivatives.idl \
     $(WebCore)/html/canvas/OESTextureFloat.idl \
index 57fb665..9d51ede 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTFragDepth.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\accessibility\AccessibilityNodeObject.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
     <ClCompile Include="..\html\canvas\CanvasPathMethods.cpp" />
     <ClCompile Include="..\html\canvas\EXTShaderTextureLOD.cpp" />
     <ClCompile Include="..\html\canvas\EXTsRGB.cpp" />
+    <ClCompile Include="..\html\canvas\EXTFragDepth.cpp" />
     <ClCompile Include="..\html\canvas\EXTTextureFilterAnisotropic.cpp" />
     <ClCompile Include="..\html\canvas\OESElementIndexUint.cpp" />
     <ClCompile Include="..\html\canvas\OESStandardDerivatives.cpp" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSVTTRegionList.cpp" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSVTTRegionList.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSEXTsRGB.h" />
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSEXTFragDepth.h” />
     <ClInclude Include="..\accessibility\AccessibilityNodeObject.h" />
     <ClInclude Include="..\css\CSSImageSetValue.h" />
     <ClInclude Include="..\css\WebKitCSSResourceValue.h" />
     <ClInclude Include="..\html\canvas\CanvasPathMethods.h" />
     <ClInclude Include="..\html\canvas\EXTShaderTextureLOD.h" />
     <ClInclude Include="..\html\canvas\EXTsRGB.h" />
+    <ClInclude Include="..\html\canvas\EXTFragDepth.h” />
     <ClInclude Include="..\html\canvas\EXTTextureFilterAnisotropic.h" />
     <ClInclude Include="..\html\canvas\OESElementIndexUint.h" />
     <ClInclude Include="..\html\canvas\OESStandardDerivatives.h" />
index 0c04028..8e8cb4d 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="DerivedSources">
     <ClCompile Include="..\html\canvas\EXTsRGB.cpp">
       <Filter>html\canvas</Filter>
     </ClCompile>
+    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTFragDepth.cpp">
+      <Filter>DerivedSources</Filter>
+    </ClCompile>
+    <ClCompile Include="..\html\canvas\EXTFragDepth.cpp">
+      <Filter>html\canvas</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\geolocation\Coordinates.h">
     <ClInclude Include="..\html\canvas\EXTsRGB.h">
       <Filter>html\canvas</Filter>
     </ClInclude>
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSEXTFragDepth.h”>
+      <Filter>DerivedSources</Filter>
+    </ClInclude>
+    <ClInclude Include="..\html\canvas\EXTFragDepth.h”>
+      <Filter>html\canvas</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\css\CSSGrammar.y.in">
index dfb98ba..75e5f28 100644 (file)
                72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
                727AFED41A2EA6AE000442E8 /* EXTsRGB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */; };
                72E417631A2E8D2F004C562A /* JSEXTsRGB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */; };
-               72E417651A2E8D50004C562A /* JSEXTsRGB.h in Headers */ = {isa = PBXBuildFile; fileRef = 72E417621A2E8D2F004C562A /* JSEXTsRGB.h */; };
+               72F1ADA21A3904DC00014E18 /* EXTFragDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */; };
+               72F1ADA51A390B9F00014E18 /* JSEXTFragDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */; };
                754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
                754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
                7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; };
                727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTsRGB.idl; path = canvas/EXTsRGB.idl; sourceTree = "<group>"; };
                72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTsRGB.cpp; sourceTree = "<group>"; };
                72E417621A2E8D2F004C562A /* JSEXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTsRGB.h; sourceTree = "<group>"; };
+               72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTFragDepth.cpp; path = canvas/EXTFragDepth.cpp; sourceTree = "<group>"; };
+               72F1ADA01A3904C300014E18 /* EXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTFragDepth.h; path = canvas/EXTFragDepth.h; sourceTree = "<group>"; };
+               72F1ADA11A3904C300014E18 /* EXTFragDepth.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTFragDepth.idl; path = canvas/EXTFragDepth.idl; sourceTree = "<group>"; };
+               72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEXTFragDepth.cpp; path = "JSEXTFragDepth.cpp"; sourceTree = "<group>"; };
+               72F1ADA41A390B9F00014E18 /* JSEXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEXTFragDepth.h; path = "JSEXTFragDepth.h"; sourceTree = "<group>"; };
                754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
                754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
                7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; };
                                727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */,
                                727AFED21A2EA6A0000442E8 /* EXTsRGB.h */,
                                727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */,
+                               72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */,
+                               72F1ADA01A3904C300014E18 /* EXTFragDepth.h */,
+                               72F1ADA11A3904C300014E18 /* EXTFragDepth.idl */,
                                7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */,
                                7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */,
                                E176580C180DF3A0005A96D1 /* OESElementIndexUint.idl */,
                A83B79080CCAFF2B000B0825 /* HTML */ = {
                        isa = PBXGroup;
                        children = (
+                               72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */,
+                               72F1ADA41A390B9F00014E18 /* JSEXTFragDepth.h */,
                                72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */,
                                72E417621A2E8D2F004C562A /* JSEXTsRGB.h */,
                                31A795C41888BAD100382F90 /* JSANGLEInstancedArrays.cpp */,
                                FD315FFC12B0267600C1A359 /* AudioBufferSourceNode.h in Headers */,
                                FD31607C12B026F700C1A359 /* AudioBus.h in Headers */,
                                FD31607E12B026F700C1A359 /* AudioChannel.h in Headers */,
-                               72E417651A2E8D50004C562A /* JSEXTsRGB.h in Headers */,
                                FD31600512B0267600C1A359 /* AudioContext.h in Headers */,
                                FD31607F12B026F700C1A359 /* AudioDestination.h in Headers */,
                                070F549E17F2402700169E04 /* AudioDestinationConsumer.h in Headers */,
                                5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */,
                                E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */,
                                97BC69DC1505F076001B74AC /* ChangeVersionWrapper.cpp in Sources */,
+                               72F1ADA21A3904DC00014E18 /* EXTFragDepth.cpp in Sources */,
                                FD315FFE12B0267600C1A359 /* ChannelMergerNode.cpp in Sources */,
                                FD31600112B0267600C1A359 /* ChannelSplitterNode.cpp in Sources */,
                                6550B69F099DF0270090D781 /* CharacterData.cpp in Sources */,
                                29A8124A0FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.mm in Sources */,
                                AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */,
                                AA478A8016CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm in Sources */,
+                               72F1ADA51A390B9F00014E18 /* JSEXTFragDepth.cpp in Sources */,
                                2D3EF4491917915C00034184 /* WebActionDisablingCALayerDelegate.mm in Sources */,
                                A56C5B9A189F34570082D13C /* WebConsoleAgent.cpp in Sources */,
                                CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */,
index 058bcbc..3fe7135 100644 (file)
@@ -30,6 +30,7 @@
 #include "JSWebGLRenderingContext.h"
 
 #include "ANGLEInstancedArrays.h"
+#include "EXTFragDepth.h"
 #include "EXTShaderTextureLOD.h"
 #include "EXTTextureFilterAnisotropic.h"
 #include "EXTsRGB.h"
@@ -37,6 +38,7 @@
 #include "HTMLCanvasElement.h"
 #include "HTMLImageElement.h"
 #include "JSANGLEInstancedArrays.h"
+#include "JSEXTFragDepth.h"
 #include "JSEXTShaderTextureLOD.h"
 #include "JSEXTTextureFilterAnisotropic.h"
 #include "JSEXTsRGB.h"
@@ -215,6 +217,8 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
         return toJS(exec, globalObject, static_cast<EXTTextureFilterAnisotropic*>(extension));
     case WebGLExtension::EXTsRGBName:
         return toJS(exec, globalObject, static_cast<EXTsRGB*>(extension));
+    case WebGLExtension::EXTFragDepthName:
+        return toJS(exec, globalObject, static_cast<EXTFragDepth*>(extension));
     case WebGLExtension::OESStandardDerivativesName:
         return toJS(exec, globalObject, static_cast<OESStandardDerivatives*>(extension));
     case WebGLExtension::OESTextureFloatName:
diff --git a/Source/WebCore/html/canvas/EXTFragDepth.cpp b/Source/WebCore/html/canvas/EXTFragDepth.cpp
new file mode 100644 (file)
index 0000000..c92cb7b
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 Apple 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(WEBGL)
+#include "EXTFragDepth.h"
+
+namespace WebCore {
+
+EXTFragDepth::EXTFragDepth(WebGLRenderingContext* context)
+    : WebGLExtension(context)
+{
+}
+
+EXTFragDepth::~EXTFragDepth()
+{
+}
+
+WebGLExtension::ExtensionName EXTFragDepth::getName() const
+{
+    return EXTFragDepthName;
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)
diff --git a/Source/WebCore/html/canvas/EXTFragDepth.h b/Source/WebCore/html/canvas/EXTFragDepth.h
new file mode 100644 (file)
index 0000000..ecbdf91
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2014 Apple 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 EXTFragDepth_h
+#define EXTFragDepth_h
+
+#include "WebGLExtension.h"
+
+namespace WebCore {
+
+class EXTFragDepth final : public WebGLExtension {
+public:
+    explicit EXTFragDepth(WebGLRenderingContext*);
+    virtual ~EXTFragDepth();
+
+    virtual ExtensionName getName() const override;
+};
+
+} // namespace WebCore
+
+#endif // EXTFragDepth_h
diff --git a/Source/WebCore/html/canvas/EXTFragDepth.idl b/Source/WebCore/html/canvas/EXTFragDepth.idl
new file mode 100644 (file)
index 0000000..5edc4aa
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+* Copyright (C) 2014 Apple 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.
+*/
+
+[
+    NoInterfaceObject,
+    Conditional=WEBGL,
+    GenerateIsReachable=ImplWebGLRenderingContext
+] interface EXTFragDepth {
+};
index 2e73bc0..b82a047 100644 (file)
@@ -36,6 +36,7 @@ public:
     // Extension names are needed to properly wrap instances in JavaScript objects.
     enum ExtensionName {
         WebGLLoseContextName,
+        EXTFragDepthName,
         EXTShaderTextureLODName,
         EXTTextureFilterAnisotropicName,
         EXTsRGBName,
index 67e001b..cccb09e 100644 (file)
@@ -33,6 +33,7 @@
 #include "CachedImage.h"
 #include "DOMWindow.h"
 #include "Document.h"
+#include "EXTFragDepth.h"
 #include "EXTShaderTextureLOD.h"
 #include "EXTTextureFilterAnisotropic.h"
 #include "EXTsRGB.h"
@@ -2462,7 +2463,14 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
         }
         return m_extsRGB.get();
     }
-
+    if (equalIgnoringCase(name, "EXT_frag_depth")
+        && m_context->getExtensions()->supports("GL_EXT_frag_depth")) {
+        if (!m_extFragDepth) {
+            m_context->getExtensions()->ensureEnabled("GL_EXT_frag_depth");
+            m_extFragDepth = std::make_unique<EXTFragDepth>(this);
+        }
+        return m_extFragDepth.get();
+    }
     if (equalIgnoringCase(name, "EXT_shader_texture_lod")
         && (m_context->getExtensions()->supports("GL_EXT_shader_texture_lod") || m_context->getExtensions()->supports("GL_ARB_shader_texture_lod"))) {
         if (!m_extShaderTextureLOD) {
@@ -3081,6 +3089,8 @@ Vector<String> WebGLRenderingContext::getSupportedExtensions()
 
     if (m_context->getExtensions()->supports("GL_EXT_sRGB"))
         result.append("EXT_sRGB");
+    if (m_context->getExtensions()->supports("GL_EXT_frag_depth"))
+        result.append("EXT_frag_depth");
     if (m_context->getExtensions()->supports("GL_OES_texture_float"))
         result.append("OES_texture_float");
     if (m_context->getExtensions()->supports("GL_OES_texture_float_linear"))
index 251b576..dda59fc 100644 (file)
@@ -44,6 +44,7 @@ class ANGLEInstancedArrays;
 class EXTTextureFilterAnisotropic;
 class EXTShaderTextureLOD;
 class EXTsRGB;
+class EXTFragDepth;
 class HTMLImageElement;
 class HTMLVideoElement;
 class ImageBuffer;
@@ -539,6 +540,7 @@ private:
     bool isContextLostOrPending();
 
     // Enabled extension objects.
+    std::unique_ptr<EXTFragDepth> m_extFragDepth;
     std::unique_ptr<EXTsRGB> m_extsRGB;
     std::unique_ptr<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
     std::unique_ptr<EXTShaderTextureLOD> m_extShaderTextureLOD;
index e27ac29..846026f 100644 (file)
@@ -176,6 +176,13 @@ bool Extensions3DOpenGL::supportsExtension(const String& name)
         return m_availableExtensions.contains("GL_EXT_texture_sRGB") && (m_availableExtensions.contains("GL_EXT_framebuffer_sRGB") || m_availableExtensions.contains("GL_ARB_framebuffer_sRGB"));
 #endif
 
+    if (name == "GL_EXT_frag_depth")
+#if PLATFORM(MAC)
+        return true;
+#else
+        return m_availableExtensions.contains("GL_EXT_frag_depth");
+#endif
+
     // Desktop GL always supports GL_OES_rgb8_rgba8.
     if (name == "GL_OES_rgb8_rgba8")
         return true;
index 0750e77..a411cbf 100644 (file)
@@ -144,6 +144,14 @@ void Extensions3DOpenGLCommon::ensureEnabled(const String& name)
             ANGLEResources.EXT_shader_texture_lod = 1;
             compiler.setResources(ANGLEResources);
         }
+    } else if (name == "GL_EXT_frag_depth") {
+        // Enable support in ANGLE (if not enabled already)
+        ANGLEWebKitBridge& compiler = m_context->m_compiler;
+        ShBuiltInResources ANGLEResources = compiler.getResources();
+        if (!ANGLEResources.EXT_frag_depth) {
+            ANGLEResources.EXT_frag_depth = 1;
+            compiler.setResources(ANGLEResources);
+        }
     }
 }