Implement EXT_blend_minmax as a WebGL 1 extension.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 21:56:20 +0000 (21:56 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 21:56:20 +0000 (21:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128974.
<rdar://problem/19195535>

Tested by:
webgl/1.0.3/conformance/extensions/ext-blend-minmax.html
fast/canvas/webgl/constants.html

Specifications for this extension:
https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/

* 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/EXTBlendMinMax.cpp: Added.
(WebCore::EXTBlendMinMax::EXTBlendMinMax):
(WebCore::EXTBlendMinMax::~EXTBlendMinMax):
(WebCore::EXTBlendMinMax::getName):
* html/canvas/EXTBlendMinMax.h: Added.
* html/canvas/EXTBlendMinMax.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
(WebCore::WebGLRenderingContext::validateBlendEquation):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContext.idl:
* platform/graphics/Extensions3D.h:

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/constants.html
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/EXTBlendMinMax.cpp [new file with mode: 0644]
Source/WebCore/html/canvas/EXTBlendMinMax.h [new file with mode: 0644]
Source/WebCore/html/canvas/EXTBlendMinMax.idl [new file with mode: 0644]
Source/WebCore/html/canvas/WebGLExtension.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.h
Source/WebCore/html/canvas/WebGLRenderingContext.idl
Source/WebCore/platform/graphics/Extensions3D.h

index 1eb7947..ed62ac5 100644 (file)
@@ -1,3 +1,13 @@
+2014-12-12  Roger Fong  <roger_fong@apple.com>
+
+        Implement EXT_blend_minmax as a WebGL 1 extension.
+        https://bugs.webkit.org/show_bug.cgi?id=128974.
+        <rdar://problem/19195535>
+
+        Reviewed by Dean Jackson.
+
+        * fast/canvas/webgl/constants.html:
+
 2014-12-12  Alexey Proskuryakov  <ap@apple.com>
 
         http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html is flaky
index 9ad0e51..be406ba 100644 (file)
@@ -438,7 +438,11 @@ BROWSER_DEFAULT_WEBGL              : 0x9244,
 SRGB_EXT :                                  0x8C40,
 SRGB_ALPHA_EXT :                            0x8C42,
 SRGB8_ALPHA8_EXT :                          0x8C43,
-FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT : 0x8210
+FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT : 0x8210,
+
+/* EXT_BLEND_MINMAX extension */
+MIN_EXT :                                   0x8007,
+MAX_EXT :                                   0x8008
 };
 
 // Constants removed from the WebGL spec compared to ES 2.0
index aec7f8b..f327578 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/EXTBlendMinMax.idl
     html/canvas/EXTFragDepth.idl
     html/canvas/EXTShaderTextureLOD.idl
     html/canvas/EXTTextureFilterAnisotropic.idl
@@ -1675,6 +1676,7 @@ set(WebCore_SOURCES
     html/canvas/CanvasRenderingContext.cpp
     html/canvas/CanvasRenderingContext2D.cpp
     html/canvas/CanvasStyle.cpp
+    html/canvas/EXTBlendMinMax.cpp
     html/canvas/EXTFragDepth.cpp
     html/canvas/EXTShaderTextureLOD.cpp
     html/canvas/EXTTextureFilterAnisotropic.cpp
@@ -2807,6 +2809,7 @@ if (ENABLE_WEBGL)
 
     list(APPEND WebCore_SOURCES
         html/canvas/ANGLEInstancedArrays.cpp
+        html/canvas/EXTBlendMinMax.cpp
         html/canvas/EXTFragDepth.cpp
         html/canvas/EXTShaderTextureLOD.cpp
         html/canvas/EXTTextureFilterAnisotropic.cpp
@@ -2847,6 +2850,7 @@ if (ENABLE_WEBGL)
     )
     list(APPEND WebCore_IDL_FILES
         html/canvas/ANGLEInstancedArrays.idl
+        html/canvas/EXTBlendMinMax.idl
         html/canvas/EXTFragDepth.idl
         html/canvas/EXTShaderTextureLOD.idl
         html/canvas/EXTTextureFilterAnisotropic.idl
index 55711b9..434b160 100644 (file)
@@ -1,3 +1,41 @@
+2014-12-12  Roger Fong  <roger_fong@apple.com>
+
+        Implement EXT_blend_minmax as a WebGL 1 extension.
+        https://bugs.webkit.org/show_bug.cgi?id=128974.
+        <rdar://problem/19195535>
+
+        Reviewed by Dean Jackson.
+
+        Tested by:
+        webgl/1.0.3/conformance/extensions/ext-blend-minmax.html
+        fast/canvas/webgl/constants.html
+
+        Specifications for this extension:
+        https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/
+
+        * 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/EXTBlendMinMax.cpp: Added.
+        (WebCore::EXTBlendMinMax::EXTBlendMinMax):
+        (WebCore::EXTBlendMinMax::~EXTBlendMinMax):
+        (WebCore::EXTBlendMinMax::getName):
+        * html/canvas/EXTBlendMinMax.h: Added.
+        * html/canvas/EXTBlendMinMax.idl: Added.
+        * html/canvas/WebGLExtension.h:
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getExtension):
+        (WebCore::WebGLRenderingContext::getSupportedExtensions):
+        (WebCore::WebGLRenderingContext::validateBlendEquation):
+        * html/canvas/WebGLRenderingContext.h:
+        * html/canvas/WebGLRenderingContext.idl:
+        * platform/graphics/Extensions3D.h:
+
 2014-12-12  Benjamin Poulain  <bpoulain@apple.com>
 
         Remove the concept of simple selector from the parser
index 5568a24..4414681 100644 (file)
@@ -42,6 +42,7 @@
 #include "JSCanvasRenderingContext.cpp"
 #include "JSCanvasRenderingContext2D.cpp"
 #if ENABLE(WEBGL)
+#include "JSEXTBlendMinMax.cpp"
 #include "JSEXTFragDepth.cpp"
 #include "JSEXTShaderTextureLOD.cpp"
 #include "JSEXTTextureFilterAnisotropic.cpp"
index 69e9a93..d6814fa 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/EXTBlendMinMax.idl \
     $(WebCore)/html/canvas/EXTFragDepth.idl \
     $(WebCore)/html/canvas/OESElementIndexUint.idl \
     $(WebCore)/html/canvas/OESStandardDerivatives.idl \
index 9d51ede..bad3eb1 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\JSEXTBlendMinMax.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\EXTBlendMinMax.cpp" />
     <ClCompile Include="..\html\canvas\EXTFragDepth.cpp" />
     <ClCompile Include="..\html\canvas\EXTTextureFilterAnisotropic.cpp" />
     <ClCompile Include="..\html\canvas\OESElementIndexUint.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="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSEXTFragDepth.h" />
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSEXTBlendMinMax.h" />
     <ClInclude Include="..\accessibility\AccessibilityNodeObject.h" />
     <ClInclude Include="..\css\CSSImageSetValue.h" />
     <ClInclude Include="..\css\WebKitCSSResourceValue.h" />
     <ClInclude Include="..\html\canvas\EXTShaderTextureLOD.h" />
     <ClInclude Include="..\html\canvas\EXTsRGB.h" />
     <ClInclude Include="..\html\canvas\EXTFragDepth.h” />
+    <ClInclude Include="..\html\canvas\EXTBlendMinMax.h” />
     <ClInclude Include="..\html\canvas\EXTTextureFilterAnisotropic.h" />
     <ClInclude Include="..\html\canvas\OESElementIndexUint.h" />
     <ClInclude Include="..\html\canvas\OESStandardDerivatives.h" />
index 8e8cb4d..2175f68 100644 (file)
     <ClCompile Include="..\html\canvas\EXTFragDepth.cpp">
       <Filter>html\canvas</Filter>
     </ClCompile>
+    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTBlendMinMax.cpp">
+      <Filter>DerivedSources</Filter>
+    </ClCompile>
+    <ClCompile Include="..\html\canvas\EXTBlendMinMax.cpp">
+      <Filter>html\canvas</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\geolocation\Coordinates.h">
     <ClInclude Include="..\html\canvas\EXTFragDepth.h”>
       <Filter>html\canvas</Filter>
     </ClInclude>
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSEXTBlendMinMax.h”>
+      <Filter>DerivedSources</Filter>
+    </ClInclude>
+    <ClInclude Include="..\html\canvas\EXTBlendMinMax.h”>
+      <Filter>html\canvas</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\css\CSSGrammar.y.in">
index 75e5f28..21d5c3b 100644 (file)
                71E2183B17359FB8006E6E4D /* PlugInsResourcesData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71E2183917359FB8006E6E4D /* PlugInsResourcesData.cpp */; };
                71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */; };
                71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */; };
+               724ED3311A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */; };
+               724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
                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 */; };
                71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedIntegerOptionalInteger.cpp; sourceTree = "<group>"; };
                71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedIntegerOptionalInteger.h; sourceTree = "<group>"; };
                71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumerationPropertyTearOff.h; sourceTree = "<group>"; };
+               724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTBlendMinMax.cpp; path = canvas/EXTBlendMinMax.cpp; sourceTree = "<group>"; };
+               724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTBlendMinMax.h; path = canvas/EXTBlendMinMax.h; sourceTree = "<group>"; };
+               724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTBlendMinMax.idl; path = canvas/EXTBlendMinMax.idl; sourceTree = "<group>"; };
+               724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEXTBlendMinMax.cpp; path = "JSEXTBlendMinMax.cpp"; sourceTree = "<group>"; };
+               724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEXTBlendMinMax.h; path = "JSEXTBlendMinMax.h"; sourceTree = "<group>"; };
                72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
                727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTsRGB.cpp; path = canvas/EXTsRGB.cpp; sourceTree = "<group>"; };
                727AFED21A2EA6A0000442E8 /* EXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTsRGB.h; path = canvas/EXTsRGB.h; sourceTree = "<group>"; };
                                49484FC0102CF23C00187DD3 /* CanvasStyle.h */,
                                FB91392016AE4B0B001FE682 /* DOMPath.h */,
                                FB91392116AE4B0B001FE682 /* DOMPath.idl */,
+                               724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */,
+                               724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */,
+                               724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */,
                                5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */,
                                5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */,
                                5C4304AF191AC908000E2BC0 /* EXTShaderTextureLOD.idl */,
                A83B79080CCAFF2B000B0825 /* HTML */ = {
                        isa = PBXGroup;
                        children = (
+                               724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */,
+                               724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */,
                                72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */,
                                72F1ADA41A390B9F00014E18 /* JSEXTFragDepth.h */,
                                72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */,
                                A83B78FC0CCAFF15000B0825 /* JSSVGFontFaceUriElement.h in Headers */,
                                B2FA3D990AB75A6F000E5AC4 /* JSSVGForeignObjectElement.h in Headers */,
                                B2FA3D9B0AB75A6F000E5AC4 /* JSSVGGElement.h in Headers */,
+                               724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */,
                                B27B28280CEF0C0700D39D54 /* JSSVGGlyphElement.h in Headers */,
                                24D9129A13CA971400D21915 /* JSSVGGlyphRefElement.h in Headers */,
                                B2FA3D9D0AB75A6F000E5AC4 /* JSSVGGradientElement.h in Headers */,
                                BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */,
                                52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */,
                                CDF2B0101820540600F2B424 /* MockBox.cpp in Sources */,
+                               724ED3311A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp in Sources */,
                                CDF2B0121820540600F2B424 /* MockMediaPlayerMediaSource.cpp in Sources */,
                                CDF2B0141820540600F2B424 /* MockMediaSourcePrivate.cpp in Sources */,
                                07C59B6317F4D1BF000FBCBB /* MockMediaStreamCenter.cpp in Sources */,
                                A0EE0DF7144F825500F80B0D /* WebGLDebugShaders.cpp in Sources */,
                                6E3FAE8E14733FDB00E42307 /* WebGLDepthTexture.cpp in Sources */,
                                5B30695D18B3D3450099D5E8 /* WebGLDrawBuffers.cpp in Sources */,
+                               724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */,
                                6EBF0E5412A8929800DB1709 /* WebGLExtension.cpp in Sources */,
                                49C7B9CE1042D32F0009D447 /* WebGLFramebuffer.cpp in Sources */,
                                6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */,
index 3fe7135..666685e 100644 (file)
@@ -30,6 +30,7 @@
 #include "JSWebGLRenderingContext.h"
 
 #include "ANGLEInstancedArrays.h"
+#include "EXTBlendMinMax.h"
 #include "EXTFragDepth.h"
 #include "EXTShaderTextureLOD.h"
 #include "EXTTextureFilterAnisotropic.h"
@@ -38,6 +39,7 @@
 #include "HTMLCanvasElement.h"
 #include "HTMLImageElement.h"
 #include "JSANGLEInstancedArrays.h"
+#include "JSEXTBlendMinMax.h"
 #include "JSEXTFragDepth.h"
 #include "JSEXTShaderTextureLOD.h"
 #include "JSEXTTextureFilterAnisotropic.h"
@@ -219,6 +221,8 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
         return toJS(exec, globalObject, static_cast<EXTsRGB*>(extension));
     case WebGLExtension::EXTFragDepthName:
         return toJS(exec, globalObject, static_cast<EXTFragDepth*>(extension));
+    case WebGLExtension::EXTBlendMinMaxName:
+        return toJS(exec, globalObject, static_cast<EXTBlendMinMax*>(extension));
     case WebGLExtension::OESStandardDerivativesName:
         return toJS(exec, globalObject, static_cast<OESStandardDerivatives*>(extension));
     case WebGLExtension::OESTextureFloatName:
diff --git a/Source/WebCore/html/canvas/EXTBlendMinMax.cpp b/Source/WebCore/html/canvas/EXTBlendMinMax.cpp
new file mode 100644 (file)
index 0000000..aa793a5
--- /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 "EXTBlendMinMax.h"
+
+namespace WebCore {
+
+EXTBlendMinMax::EXTBlendMinMax(WebGLRenderingContext* context)
+    : WebGLExtension(context)
+{
+}
+
+EXTBlendMinMax::~EXTBlendMinMax()
+{
+}
+
+WebGLExtension::ExtensionName EXTBlendMinMax::getName() const
+{
+    return EXTBlendMinMaxName;
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)
diff --git a/Source/WebCore/html/canvas/EXTBlendMinMax.h b/Source/WebCore/html/canvas/EXTBlendMinMax.h
new file mode 100644 (file)
index 0000000..6adb912
--- /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 EXTBlendMinMax_h
+#define EXTBlendMinMax_h
+
+#include "WebGLExtension.h"
+
+namespace WebCore {
+
+class EXTBlendMinMax final : public WebGLExtension {
+public:
+    explicit EXTBlendMinMax(WebGLRenderingContext*);
+    virtual ~EXTBlendMinMax();
+
+    virtual ExtensionName getName() const override;
+};
+
+} // namespace WebCore
+
+#endif // EXTBlendMinMax_h
diff --git a/Source/WebCore/html/canvas/EXTBlendMinMax.idl b/Source/WebCore/html/canvas/EXTBlendMinMax.idl
new file mode 100644 (file)
index 0000000..08acbd8
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* 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 EXTBlendMinMax {
+    const unsigned int MIN_EXT = 0x8007;
+    const unsigned int MAX_EXT = 0x8008;
+};
index b82a047..e231048 100644 (file)
@@ -36,6 +36,7 @@ public:
     // Extension names are needed to properly wrap instances in JavaScript objects.
     enum ExtensionName {
         WebGLLoseContextName,
+        EXTBlendMinMaxName,
         EXTFragDepthName,
         EXTShaderTextureLODName,
         EXTTextureFilterAnisotropicName,
index cccb09e..aa0923a 100644 (file)
@@ -33,6 +33,7 @@
 #include "CachedImage.h"
 #include "DOMWindow.h"
 #include "Document.h"
+#include "EXTBlendMinMax.h"
 #include "EXTFragDepth.h"
 #include "EXTShaderTextureLOD.h"
 #include "EXTTextureFilterAnisotropic.h"
@@ -2455,6 +2456,14 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
     if (isContextLostOrPending())
         return nullptr;
 
+    if (equalIgnoringCase(name, "EXT_blend_minmax")
+        && m_context->getExtensions()->supports("GL_EXT_blend_minmax")) {
+        if (!m_extBlendMinMax) {
+            m_context->getExtensions()->ensureEnabled("GL_EXT_blend_minmax");
+            m_extBlendMinMax = std::make_unique<EXTBlendMinMax>(this);
+        }
+        return m_extBlendMinMax.get();
+    }
     if (equalIgnoringCase(name, "EXT_sRGB")
         && m_context->getExtensions()->supports("GL_EXT_sRGB")) {
         if (!m_extsRGB) {
@@ -3087,6 +3096,8 @@ Vector<String> WebGLRenderingContext::getSupportedExtensions()
     if (m_isPendingPolicyResolution)
         return result;
 
+    if (m_context->getExtensions()->supports("GL_EXT_blend_minmax"))
+        result.append("EXT_blend_minmax");
     if (m_context->getExtensions()->supports("GL_EXT_sRGB"))
         result.append("EXT_sRGB");
     if (m_context->getExtensions()->supports("GL_EXT_frag_depth"))
@@ -5664,7 +5675,14 @@ bool WebGLRenderingContext::validateBlendEquation(const char* functionName, GC3D
     case GraphicsContext3D::FUNC_ADD:
     case GraphicsContext3D::FUNC_SUBTRACT:
     case GraphicsContext3D::FUNC_REVERSE_SUBTRACT:
+    case Extensions3D::MIN_EXT:
+    case Extensions3D::MAX_EXT:
+        if ((mode == Extensions3D::MIN_EXT || mode == Extensions3D::MAX_EXT) && !m_extBlendMinMax) {
+            synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid mode");
+            return false;
+        }
         return true;
+        break;
     default:
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid mode");
         return false;
index dda59fc..ef88c9a 100644 (file)
@@ -41,6 +41,7 @@
 namespace WebCore {
 
 class ANGLEInstancedArrays;
+class EXTBlendMinMax;
 class EXTTextureFilterAnisotropic;
 class EXTShaderTextureLOD;
 class EXTsRGB;
@@ -541,6 +542,7 @@ private:
 
     // Enabled extension objects.
     std::unique_ptr<EXTFragDepth> m_extFragDepth;
+    std::unique_ptr<EXTBlendMinMax> m_extBlendMinMax;
     std::unique_ptr<EXTsRGB> m_extsRGB;
     std::unique_ptr<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
     std::unique_ptr<EXTShaderTextureLOD> m_extShaderTextureLOD;
index 3044aae..d555a57 100644 (file)
@@ -423,6 +423,9 @@ typedef unrestricted float GLclampf;
     const GLenum SRGB8_ALPHA8_EXT                             = 0x8C43;
     const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT    = 0x8210;
 
+    const GLenum MIN_EXT                        = 0x8007;
+    const GLenum MAX_EXT                        = 0x8008;
+
     const GLenum RENDERBUFFER_WIDTH             = 0x8D42;
     const GLenum RENDERBUFFER_HEIGHT            = 0x8D43;
     const GLenum RENDERBUFFER_INTERNAL_FORMAT   = 0x8D44;
index 9de1695..f65dd05 100644 (file)
@@ -96,6 +96,10 @@ public:
         SRGB8_ALPHA8_EXT = 0x8C43,
         FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210,
 
+        // EXT_blend_minmax enums
+        MIN_EXT = 0x8007,
+        MAX_EXT = 0x8008,
+
         // GL_EXT_texture_format_BGRA8888 enums
         BGRA_EXT = 0x80E1,