Changeset 168639 in webkit


Ignore:
Timestamp:
May 12, 2014 1:13:44 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Implement EXT_shader_texture_lod in WebGL.
https://bugs.webkit.org/show_bug.cgi?id=128985
<rdar://problem/16111396>

Source/WebCore:
Based on Chromium patch by bajones@chromium.org.
https://src.chromium.org/viewvc/blink?revision=171465&view=revision

Patch by Alex Christensen <achristensen@webkit.org> on 2014-05-12
Reviewed by Dean Jackson.

Test: webgl/conformance/extensions/ext-shader-texture-lod.html

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • WebCore.xcodeproj/project.pbxproj:

Added new EXTShaderTextureLOD files.

  • bindings/js/JSWebGLRenderingContextCustom.cpp:

(WebCore::toJS):
Added EXTShaderTextureLOD.

  • html/canvas/EXTShaderTextureLOD.cpp: Added.

(WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
(WebCore::EXTShaderTextureLOD::~EXTShaderTextureLOD):
(WebCore::EXTShaderTextureLOD::getName):

  • html/canvas/EXTShaderTextureLOD.h: Added.
  • html/canvas/EXTShaderTextureLOD.idl: Added.
  • html/canvas/WebGLExtension.h:

Added EXTShaderTextureLODName.

  • html/canvas/WebGLObject.cpp:

Removed unused inclusion of EXTTextureFilterAnisotropic.h.

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore::WebGLRenderingContext::getExtension):
Added EXT_shader_texture_lod.

  • html/canvas/WebGLRenderingContext.h:

Added a EXTShaderTextureLOD member variable.

LayoutTests:
Based on Firefox patch by Vladimir Vukicevic.
https://bug965848.bugzilla.mozilla.org/attachment.cgi?id=8367994

Patch by Alex Christensen <achristensen@webkit.org> on 2014-05-12
Reviewed by Dean Jackson.

  • webgl/conformance/extensions/ext-shader-texture-lod-expected.txt: Added.
  • webgl/conformance/extensions/ext-shader-texture-lod.html: Added.
  • webgl/resources/webgl_test_files/conformance/extensions/ext-shader-texture-lod.html: Added.
Location:
trunk
Files:
3 added
15 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168636 r168639  
     12014-05-12  Alex Christensen  <achristensen@webkit.org>
     2
     3        Implement EXT_shader_texture_lod in WebGL.
     4        https://bugs.webkit.org/show_bug.cgi?id=128985
     5        <rdar://problem/16111396>
     6
     7        Based on Firefox patch by Vladimir Vukicevic.
     8        https://bug965848.bugzilla.mozilla.org/attachment.cgi?id=8367994
     9
     10        Reviewed by Dean Jackson.
     11
     12        * webgl/conformance/extensions/ext-shader-texture-lod-expected.txt: Added.
     13        * webgl/conformance/extensions/ext-shader-texture-lod.html: Added.
     14        * webgl/resources/webgl_test_files/conformance/extensions/ext-shader-texture-lod.html: Added.
     15
    1162014-05-12  Martin Hock  <mhock@apple.com>
    217
  • trunk/Source/WebCore/CMakeLists.txt

    r168576 r168639  
    507507    html/canvas/CanvasRenderingContext2D.idl
    508508    html/canvas/DOMPath.idl
     509    html/canvas/EXTShaderTextureLOD.idl
    509510    html/canvas/EXTTextureFilterAnisotropic.idl
    510511    html/canvas/OESElementIndexUint.idl
     
    16531654    html/canvas/CanvasRenderingContext2D.cpp
    16541655    html/canvas/CanvasStyle.cpp
     1656    html/canvas/EXTShaderTextureLOD.cpp
    16551657    html/canvas/EXTTextureFilterAnisotropic.cpp
    16561658    html/canvas/OESElementIndexUint.cpp
     
    27882790    list(APPEND WebCore_SOURCES
    27892791        html/canvas/ANGLEInstancedArrays.cpp
     2792        html/canvas/EXTShaderTextureLOD.cpp
    27902793        html/canvas/EXTTextureFilterAnisotropic.cpp
    27912794        html/canvas/OESElementIndexUint.cpp
     
    28252828    list(APPEND WebCore_IDL_FILES
    28262829        html/canvas/ANGLEInstancedArrays.idl
     2830        html/canvas/EXTShaderTextureLOD.idl
    28272831        html/canvas/EXTTextureFilterAnisotropic.idl
    28282832        html/canvas/OESElementIndexUint.idl
     
    29302934
    29312935list(APPEND WebCore_SOURCES
     2936    platform/text/TextCodecICU.cpp
     2937    platform/text/TextEncodingDetectorICU.cpp
    29322938    platform/text/icu/UTextProvider.cpp
    29332939    platform/text/icu/UTextProviderLatin1.cpp
    29342940    platform/text/icu/UTextProviderUTF16.cpp
    2935     platform/text/TextCodecICU.cpp
    2936     platform/text/TextEncodingDetectorICU.cpp
    29372941)
    29382942list(APPEND WebCore_INCLUDE_DIRECTORIES
  • trunk/Source/WebCore/ChangeLog

    r168636 r168639  
     12014-05-12  Alex Christensen  <achristensen@webkit.org>
     2
     3        Implement EXT_shader_texture_lod in WebGL.
     4        https://bugs.webkit.org/show_bug.cgi?id=128985
     5        <rdar://problem/16111396>
     6
     7        Based on Chromium patch by bajones@chromium.org.
     8        https://src.chromium.org/viewvc/blink?revision=171465&view=revision
     9
     10        Reviewed by Dean Jackson.
     11
     12        Test: webgl/conformance/extensions/ext-shader-texture-lod.html
     13       
     14        * CMakeLists.txt:
     15        * DerivedSources.cpp:
     16        * DerivedSources.make:
     17        * WebCore.vcxproj/WebCore.vcxproj:
     18        * WebCore.vcxproj/WebCore.vcxproj.filters:
     19        * WebCore.xcodeproj/project.pbxproj:
     20        Added new EXTShaderTextureLOD files.
     21        * bindings/js/JSWebGLRenderingContextCustom.cpp:
     22        (WebCore::toJS):
     23        Added EXTShaderTextureLOD.
     24        * html/canvas/EXTShaderTextureLOD.cpp: Added.
     25        (WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
     26        (WebCore::EXTShaderTextureLOD::~EXTShaderTextureLOD):
     27        (WebCore::EXTShaderTextureLOD::getName):
     28        * html/canvas/EXTShaderTextureLOD.h: Added.
     29        * html/canvas/EXTShaderTextureLOD.idl: Added.
     30        * html/canvas/WebGLExtension.h:
     31        Added EXTShaderTextureLODName.
     32        * html/canvas/WebGLObject.cpp:
     33        Removed unused inclusion of EXTTextureFilterAnisotropic.h.
     34        * html/canvas/WebGLRenderingContext.cpp:
     35        (WebCore::WebGLRenderingContext::getExtension):
     36        Added EXT_shader_texture_lod.
     37        * html/canvas/WebGLRenderingContext.h:
     38        Added a EXTShaderTextureLOD member variable.
     39
    1402014-05-12  Martin Hock  <mhock@apple.com>
    241
  • trunk/Source/WebCore/DerivedSources.cpp

    r166965 r168639  
    4242#include "JSCanvasRenderingContext2D.cpp"
    4343#if ENABLE(WEBGL)
     44#include "JSEXTShaderTextureLOD.cpp"
    4445#include "JSEXTTextureFilterAnisotropic.cpp"
    4546#include "JSOESElementIndexUint.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r168576 r168639  
    415415    $(WebCore)/html/canvas/CanvasRenderingContext2D.idl \
    416416    $(WebCore)/html/canvas/DOMPath.idl \
     417    $(WebCore)/html/canvas/EXTShaderTextureLOD.idl \
    417418    $(WebCore)/html/canvas/EXTTextureFilterAnisotropic.idl \
    418419    $(WebCore)/html/canvas/OESElementIndexUint.idl \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r168610 r168639  
    299299      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    300300    </ClCompile>
     301    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTShaderTextureLOD.cpp">
     302      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
     303      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     304      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
     305      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
     306      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
     307      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
     308      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
     309      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     310      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
     311      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
     312      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
     313      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     314    </ClCompile>
    301315    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTTextureFilterAnisotropic.cpp">
    302316      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
     
    64896503    <ClCompile Include="..\html\canvas\CanvasContextAttributes.cpp" />
    64906504    <ClCompile Include="..\html\canvas\CanvasPathMethods.cpp" />
     6505    <ClCompile Include="..\html\canvas\EXTShaderTextureLOD.cpp" />
    64916506    <ClCompile Include="..\html\canvas\EXTTextureFilterAnisotropic.cpp" />
    64926507    <ClCompile Include="..\html\canvas\OESElementIndexUint.cpp" />
     
    1854818563    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\XPathGrammar.h" />
    1854918564    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSANGLEInstancedArrays.h" />
     18565    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTShaderTextureLOD.h" />
    1855018566    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTTextureFilterAnisotropic.h" />
    1855118567    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSOESElementIndexUint.h" />
     
    1872318739    <ClInclude Include="..\html\canvas\CanvasContextAttributes.h" />
    1872418740    <ClInclude Include="..\html\canvas\CanvasPathMethods.h" />
     18741    <ClInclude Include="..\html\canvas\EXTShaderTextureLOD.h" />
    1872518742    <ClInclude Include="..\html\canvas\EXTTextureFilterAnisotropic.h" />
    1872618743    <ClInclude Include="..\html\canvas\OESElementIndexUint.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r168610 r168639  
    65126512      <Filter>DerivedSources</Filter>
    65136513    </ClCompile>
     6514    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTShaderTextureLOD.cpp">
     6515      <Filter>DerivedSources</Filter>
     6516    </ClCompile>
    65146517    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTTextureFilterAnisotropic.cpp">
    65156518      <Filter>DerivedSources</Filter>
     
    66366639    </ClCompile>
    66376640    <ClCompile Include="..\html\canvas\OESVertexArrayObject.cpp">
     6641      <Filter>html\canvas</Filter>
     6642    </ClCompile>
     6643    <ClCompile Include="..\html\canvas\EXTShaderTextureLOD.cpp">
    66386644      <Filter>html\canvas</Filter>
    66396645    </ClCompile>
     
    1433514341      <Filter>DerivedSources</Filter>
    1433614342    </ClInclude>
     14343    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTShaderTextureLOD.h">
     14344      <Filter>DerivedSources</Filter>
     14345    </ClInclude>
    1433714346    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSEXTTextureFilterAnisotropic.h">
    1433814347      <Filter>DerivedSources</Filter>
     
    1446514474    </ClInclude>
    1446614475    <ClInclude Include="..\html\canvas\OESVertexArrayObject.h">
     14476      <Filter>html\canvas</Filter>
     14477    </ClInclude>
     14478    <ClInclude Include="..\html\canvas\EXTShaderTextureLOD.h">
    1446714479      <Filter>html\canvas</Filter>
    1446814480    </ClInclude>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r168610 r168639  
    20462046                5B30695E18B3D3450099D5E8 /* WebGLDrawBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 5B30695B18B3D3450099D5E8 /* WebGLDrawBuffers.h */; };
    20472047                5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBFCB0EBFF5CD77EBEB35395 /* RenderMathMLSpace.cpp */; };
     2048                5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */; };
     2049                5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; };
     2050                5C4304B5191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C4304B3191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp */; };
     2051                5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; };
    20482052                5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21A80013ECE5DF00BB7064 /* WebVTTParser.cpp */; };
    20492053                5D21A80313ECE5DF00BB7064 /* WebVTTParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D21A80113ECE5DF00BB7064 /* WebVTTParser.h */; };
     
    90699073                5B30695B18B3D3450099D5E8 /* WebGLDrawBuffers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLDrawBuffers.h; path = canvas/WebGLDrawBuffers.h; sourceTree = "<group>"; };
    90709074                5B30695C18B3D3450099D5E8 /* WebGLDrawBuffers.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLDrawBuffers.idl; path = canvas/WebGLDrawBuffers.idl; sourceTree = "<group>"; };
     9075                5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTShaderTextureLOD.cpp; path = canvas/EXTShaderTextureLOD.cpp; sourceTree = "<group>"; };
     9076                5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTShaderTextureLOD.h; path = canvas/EXTShaderTextureLOD.h; sourceTree = "<group>"; };
     9077                5C4304AF191AC908000E2BC0 /* EXTShaderTextureLOD.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTShaderTextureLOD.idl; path = canvas/EXTShaderTextureLOD.idl; sourceTree = "<group>"; };
     9078                5C4304B3191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTShaderTextureLOD.cpp; sourceTree = "<group>"; };
     9079                5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTShaderTextureLOD.h; sourceTree = "<group>"; };
    90719080                5D21A80013ECE5DF00BB7064 /* WebVTTParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTParser.cpp; sourceTree = "<group>"; };
    90729081                5D21A80113ECE5DF00BB7064 /* WebVTTParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTParser.h; sourceTree = "<group>"; };
     
    1553215541                        isa = PBXGroup;
    1553315542                        children = (
     15543                                5C4304AD191AC908000E2BC0 /* EXTShaderTextureLOD.cpp */,
     15544                                5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */,
     15545                                5C4304AF191AC908000E2BC0 /* EXTShaderTextureLOD.idl */,
    1553415546                                31A795C11888B72400382F90 /* ANGLEInstancedArrays.cpp */,
    1553515547                                31A795C21888B72400382F90 /* ANGLEInstancedArrays.h */,
     
    1832918341                        isa = PBXGroup;
    1833018342                        children = (
     18343                                5C4304B3191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp */,
     18344                                5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */,
    1833118345                                31A795C41888BAD100382F90 /* JSANGLEInstancedArrays.cpp */,
    1833218346                                31A795C51888BAD100382F90 /* JSANGLEInstancedArrays.h */,
     
    2333323347                                E1ED8AC30CC49BE000BFC557 /* CSSPrimitiveValueMappings.h in Headers */,
    2333423348                                A80E6CFF0A1989CA007FB8C5 /* CSSProperty.h in Headers */,
     23349                                5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */,
    2333523350                                78D02BC6154A18DF00B62D05 /* CSSPropertyAnimation.h in Headers */,
    2333623351                                656580F409D12B20000E61D7 /* CSSPropertyNames.h in Headers */,
     
    2360723622                                85E711B10AC5D5350053270F /* DOMHTMLIFrameElementInternal.h in Headers */,
    2360823623                                85DF81290AA7787200486AD7 /* DOMHTMLImageElement.h in Headers */,
     23624                                5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */,
    2360923625                                85E711B20AC5D5350053270F /* DOMHTMLImageElementInternal.h in Headers */,
    2361023626                                85F32AEC0AA63B8700FF3184 /* DOMHTMLInputElement.h in Headers */,
     
    2770327719                                F350B73513F1377D00880C43 /* InstrumentingAgents.cpp in Sources */,
    2770427720                                2D46F04E17B96FBD005647F0 /* IntPoint.cpp in Sources */,
     27721                                5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */,
    2770527722                                B27535600B053814002CE64F /* IntPointCG.cpp in Sources */,
    2770627723                                B275357C0B053814002CE64F /* IntPointMac.mm in Sources */,
     
    2775627773                                BCC065870F3CE2A700CD2D87 /* JSClientRect.cpp in Sources */,
    2775727774                                BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */,
     27775                                5C4304B5191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp in Sources */,
    2775827776                                BCA83E4F0D7CE1E9003421A8 /* JSDataTransfer.cpp in Sources */,
    2775927777                                BCA83E520D7CE205003421A8 /* JSDataTransferCustom.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp

    r167794 r168639  
    3131
    3232#include "ANGLEInstancedArrays.h"
     33#include "EXTShaderTextureLOD.h"
    3334#include "EXTTextureFilterAnisotropic.h"
    3435#include "ExceptionCode.h"
     
    3637#include "HTMLImageElement.h"
    3738#include "JSANGLEInstancedArrays.h"
     39#include "JSEXTShaderTextureLOD.h"
    3840#include "JSEXTTextureFilterAnisotropic.h"
    3941#include "JSHTMLCanvasElement.h"
     
    206208    case WebGLExtension::WebGLLoseContextName:
    207209        return toJS(exec, globalObject, static_cast<WebGLLoseContext*>(extension));
     210    case WebGLExtension::EXTShaderTextureLODName:
     211        return toJS(exec, globalObject, static_cast<EXTShaderTextureLOD*>(extension));
    208212    case WebGLExtension::EXTTextureFilterAnisotropicName:
    209213        return toJS(exec, globalObject, static_cast<EXTTextureFilterAnisotropic*>(extension));
  • trunk/Source/WebCore/html/canvas/EXTShaderTextureLOD.cpp

    r168638 r168639  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef WebGLExtension_h
    27 #define WebGLExtension_h
     26#include "config.h"
    2827
    29 #include "WebGLRenderingContext.h"
     28#if ENABLE(WEBGL)
     29#include "EXTShaderTextureLOD.h"
    3030
    3131namespace WebCore {
    3232
    33 class WebGLExtension {
    34     WTF_MAKE_FAST_ALLOCATED;
    35 public:
    36     // Extension names are needed to properly wrap instances in JavaScript objects.
    37     enum ExtensionName {
    38         WebGLLoseContextName,
    39         EXTTextureFilterAnisotropicName,
    40         OESTextureFloatName,
    41         OESTextureFloatLinearName,
    42         OESTextureHalfFloatName,
    43         OESTextureHalfFloatLinearName,
    44         OESStandardDerivativesName,
    45         OESVertexArrayObjectName,
    46         WebGLDebugRendererInfoName,
    47         WebGLDebugShadersName,
    48         WebGLCompressedTextureS3TCName,
    49         WebGLDepthTextureName,
    50         WebGLDrawBuffersName,
    51         OESElementIndexUintName,
    52         WebGLCompressedTextureATCName,
    53         WebGLCompressedTexturePVRTCName,
    54         ANGLEInstancedArraysName,
    55     };
     33EXTShaderTextureLOD::EXTShaderTextureLOD(WebGLRenderingContext* context)
     34    : WebGLExtension(context)
     35{
     36}
    5637
    57     void ref() { m_context->ref(); }
    58     void deref() { m_context->deref(); }
    59     WebGLRenderingContext* context() { return m_context; }
     38EXTShaderTextureLOD::~EXTShaderTextureLOD()
     39{
     40}
    6041
    61     virtual ~WebGLExtension();
    62     virtual ExtensionName getName() const = 0;
    63 
    64 protected:
    65     WebGLExtension(WebGLRenderingContext*);
    66     WebGLRenderingContext* m_context;
    67 };
     42WebGLExtension::ExtensionName EXTShaderTextureLOD::getName() const
     43{
     44    return EXTShaderTextureLODName;
     45}
    6846
    6947} // namespace WebCore
    7048
    71 #endif // WebGLExtension_h
     49#endif // ENABLE(WEBGL)
  • trunk/Source/WebCore/html/canvas/EXTShaderTextureLOD.h

    r168638 r168639  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef WebGLExtension_h
    27 #define WebGLExtension_h
     26#ifndef EXTShaderTextureLOD_h
     27#define EXTShaderTextureLOD_h
    2828
    29 #include "WebGLRenderingContext.h"
     29#include "WebGLExtension.h"
    3030
    3131namespace WebCore {
    3232
    33 class WebGLExtension {
    34     WTF_MAKE_FAST_ALLOCATED;
     33class EXTShaderTextureLOD : public WebGLExtension {
    3534public:
    36     // Extension names are needed to properly wrap instances in JavaScript objects.
    37     enum ExtensionName {
    38         WebGLLoseContextName,
    39         EXTTextureFilterAnisotropicName,
    40         OESTextureFloatName,
    41         OESTextureFloatLinearName,
    42         OESTextureHalfFloatName,
    43         OESTextureHalfFloatLinearName,
    44         OESStandardDerivativesName,
    45         OESVertexArrayObjectName,
    46         WebGLDebugRendererInfoName,
    47         WebGLDebugShadersName,
    48         WebGLCompressedTextureS3TCName,
    49         WebGLDepthTextureName,
    50         WebGLDrawBuffersName,
    51         OESElementIndexUintName,
    52         WebGLCompressedTextureATCName,
    53         WebGLCompressedTexturePVRTCName,
    54         ANGLEInstancedArraysName,
    55     };
     35    explicit EXTShaderTextureLOD(WebGLRenderingContext*);
     36    virtual ~EXTShaderTextureLOD();
    5637
    57     void ref() { m_context->ref(); }
    58     void deref() { m_context->deref(); }
    59     WebGLRenderingContext* context() { return m_context; }
    60 
    61     virtual ~WebGLExtension();
    62     virtual ExtensionName getName() const = 0;
    63 
    64 protected:
    65     WebGLExtension(WebGLRenderingContext*);
    66     WebGLRenderingContext* m_context;
     38    virtual ExtensionName getName() const override;
    6739};
    6840
    6941} // namespace WebCore
    7042
    71 #endif // WebGLExtension_h
     43#endif // EXTShaderTextureLOD_h
  • trunk/Source/WebCore/html/canvas/EXTShaderTextureLOD.idl

    r168638 r168639  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef WebGLExtension_h
    27 #define WebGLExtension_h
    28 
    29 #include "WebGLRenderingContext.h"
    30 
    31 namespace WebCore {
    32 
    33 class WebGLExtension {
    34     WTF_MAKE_FAST_ALLOCATED;
    35 public:
    36     // Extension names are needed to properly wrap instances in JavaScript objects.
    37     enum ExtensionName {
    38         WebGLLoseContextName,
    39         EXTTextureFilterAnisotropicName,
    40         OESTextureFloatName,
    41         OESTextureFloatLinearName,
    42         OESTextureHalfFloatName,
    43         OESTextureHalfFloatLinearName,
    44         OESStandardDerivativesName,
    45         OESVertexArrayObjectName,
    46         WebGLDebugRendererInfoName,
    47         WebGLDebugShadersName,
    48         WebGLCompressedTextureS3TCName,
    49         WebGLDepthTextureName,
    50         WebGLDrawBuffersName,
    51         OESElementIndexUintName,
    52         WebGLCompressedTextureATCName,
    53         WebGLCompressedTexturePVRTCName,
    54         ANGLEInstancedArraysName,
    55     };
    56 
    57     void ref() { m_context->ref(); }
    58     void deref() { m_context->deref(); }
    59     WebGLRenderingContext* context() { return m_context; }
    60 
    61     virtual ~WebGLExtension();
    62     virtual ExtensionName getName() const = 0;
    63 
    64 protected:
    65     WebGLExtension(WebGLRenderingContext*);
    66     WebGLRenderingContext* m_context;
     26[
     27    NoInterfaceObject,
     28    Conditional=WEBGL,
     29    GenerateIsReachable=ImplWebGLRenderingContext
     30] interface EXTShaderTextureLOD {
    6731};
    68 
    69 } // namespace WebCore
    70 
    71 #endif // WebGLExtension_h
  • trunk/Source/WebCore/html/canvas/WebGLExtension.h

    r164477 r168639  
    3737    enum ExtensionName {
    3838        WebGLLoseContextName,
     39        EXTShaderTextureLODName,
    3940        EXTTextureFilterAnisotropicName,
    4041        OESTextureFloatName,
  • trunk/Source/WebCore/html/canvas/WebGLObject.cpp

    r165676 r168639  
    3030#include "WebGLObject.h"
    3131
    32 #include "EXTTextureFilterAnisotropic.h"
    3332#include "WebGLCompressedTextureS3TC.h"
    3433#include "WebGLContextGroup.h"
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r167497 r168639  
    3434#include "DOMWindow.h"
    3535#include "Document.h"
     36#include "EXTShaderTextureLOD.h"
    3637#include "EXTTextureFilterAnisotropic.h"
    3738#include "ExceptionCode.h"
     
    24302431        return nullptr;
    24312432
     2433    if (equalIgnoringCase(name, "EXT_shader_texture_lod")
     2434        && m_context->getExtensions()->supports("GL_ARB_shader_texture_lod")) {
     2435        if (!m_extShaderTextureLOD) {
     2436            m_context->getExtensions()->ensureEnabled("GL_EXT_shader_texture_lod");
     2437            m_extShaderTextureLOD = std::make_unique<EXTShaderTextureLOD>(this);
     2438        }
     2439        return m_extShaderTextureLOD.get();
     2440    }
    24322441    if (equalIgnoringCase(name, "WEBKIT_EXT_texture_filter_anisotropic")
    24332442        && m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic")) {
     
    30403049    if (m_context->getExtensions()->supports("GL_OES_standard_derivatives"))
    30413050        result.append("OES_standard_derivatives");
     3051    if (m_context->getExtensions()->supports("GL_ARB_shader_texture_lod"))
     3052        result.append("EXT_shader_texture_lod");
    30423053    if (m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic"))
    30433054        result.append("WEBKIT_EXT_texture_filter_anisotropic");
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h

    r165676 r168639  
    4343class ANGLEInstancedArrays;
    4444class EXTTextureFilterAnisotropic;
     45class EXTShaderTextureLOD;
    4546class HTMLImageElement;
    4647class HTMLVideoElement;
     
    534535    // Enabled extension objects.
    535536    std::unique_ptr<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
     537    std::unique_ptr<EXTShaderTextureLOD> m_extShaderTextureLOD;
    536538    std::unique_ptr<OESTextureFloat> m_oesTextureFloat;
    537539    std::unique_ptr<OESTextureFloatLinear> m_oesTextureFloatLinear;
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp

    r164525 r168639  
    199199    if (name == "GL_OES_element_index_uint")
    200200        return true;
    201 
     201   
     202    if (name == "GL_EXT_shader_texture_lod")
     203        return m_availableExtensions.contains("GL_EXT_shader_texture_lod");
     204   
    202205    if (name == "GL_EXT_texture_filter_anisotropic")
    203206        return m_availableExtensions.contains("GL_EXT_texture_filter_anisotropic");
  • trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp

    r168055 r168639  
    137137            compiler.setResources(ANGLEResources);
    138138        }
     139    } else if (name == "GL_EXT_shader_texture_lod") {
     140        // Enable support in ANGLE (if not enabled already)
     141        ANGLEWebKitBridge& compiler = m_context->m_compiler;
     142        ShBuiltInResources ANGLEResources = compiler.getResources();
     143        if (!ANGLEResources.EXT_shader_texture_lod) {
     144            ANGLEResources.EXT_shader_texture_lod = 1;
     145            compiler.setResources(ANGLEResources);
     146        }
    139147    }
    140148}
Note: See TracChangeset for help on using the changeset viewer.