Title: [109798] trunk/Source/WebCore
Revision
109798
Author
commit-qu...@webkit.org
Date
2012-03-05 13:52:07 -0800 (Mon, 05 Mar 2012)

Log Message

Implement WebGL extension EXT_texture_filter_anisotropic
https://bugs.webkit.org/show_bug.cgi?id=79541

This exports the EXT_texture_filter_anisotropic extension with the WEBKIT_ prefix as defined at
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/extensions/proposals/EXT_texture_filter_anisotropic/index.html

Patch by Ben Vanik <benva...@google.com> on 2012-03-05
Reviewed by Kenneth Russell.

Tested with the Khronos conformance test for the extension, available at https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/extensions/ext-texture-filter-anisotropic.html

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::toV8Object):
* html/canvas/EXTTextureFilterAnisotropic.cpp: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
(WebCore):
(WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
(WebCore::EXTTextureFilterAnisotropic::~EXTTextureFilterAnisotropic):
(WebCore::EXTTextureFilterAnisotropic::getName):
(WebCore::EXTTextureFilterAnisotropic::create):
* html/canvas/EXTTextureFilterAnisotropic.h: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
(WebCore):
(EXTTextureFilterAnisotropic):
* html/canvas/EXTTextureFilterAnisotropic.idl: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLObject.cpp:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getParameter):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
(WebCore::WebGLRenderingContext::getTexParameter):
(WebCore::WebGLRenderingContext::texParameter):
* html/canvas/WebGLRenderingContext.h:
(WebCore):
(WebGLRenderingContext):
* platform/graphics/Extensions3D.h:
(Extensions3D):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supports):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (109797 => 109798)


--- trunk/Source/WebCore/CMakeLists.txt	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-03-05 21:52:07 UTC (rev 109798)
@@ -2238,6 +2238,7 @@
         html/canvas/WebGLUniformLocation.cpp
         html/canvas/WebGLVertexArrayObjectOES.cpp
         html/canvas/WebGLExtension.cpp
+        html/canvas/EXTTextureFilterAnisotropic.cpp
         html/canvas/OESStandardDerivatives.cpp
         html/canvas/OESTextureFloat.cpp
         html/canvas/OESVertexArrayObject.cpp
@@ -2246,6 +2247,7 @@
         platform/graphics/gpu/DrawingBuffer.cpp
     )
     LIST(APPEND WebCore_IDL_FILES
+        html/canvas/EXTTextureFilterAnisotropic.idl
         html/canvas/OESStandardDerivatives.idl
         html/canvas/OESTextureFloat.idl
         html/canvas/OESVertexArrayObject.idl

Modified: trunk/Source/WebCore/ChangeLog (109797 => 109798)


--- trunk/Source/WebCore/ChangeLog	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/ChangeLog	2012-03-05 21:52:07 UTC (rev 109798)
@@ -1,3 +1,53 @@
+2012-03-05  Ben Vanik  <benva...@google.com>
+
+        Implement WebGL extension EXT_texture_filter_anisotropic
+        https://bugs.webkit.org/show_bug.cgi?id=79541
+
+        This exports the EXT_texture_filter_anisotropic extension with the WEBKIT_ prefix as defined at
+        https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/extensions/proposals/EXT_texture_filter_anisotropic/index.html
+
+        Reviewed by Kenneth Russell.
+
+        Tested with the Khronos conformance test for the extension, available at https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/extensions/ext-texture-filter-anisotropic.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * DerivedSources.pri:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::toJS):
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        (WebCore::toV8Object):
+        * html/canvas/EXTTextureFilterAnisotropic.cpp: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
+        (WebCore):
+        (WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
+        (WebCore::EXTTextureFilterAnisotropic::~EXTTextureFilterAnisotropic):
+        (WebCore::EXTTextureFilterAnisotropic::getName):
+        (WebCore::EXTTextureFilterAnisotropic::create):
+        * html/canvas/EXTTextureFilterAnisotropic.h: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
+        (WebCore):
+        (EXTTextureFilterAnisotropic):
+        * html/canvas/EXTTextureFilterAnisotropic.idl: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
+        * html/canvas/WebGLExtension.h:
+        * html/canvas/WebGLObject.cpp:
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore):
+        (WebCore::WebGLRenderingContext::getExtension):
+        (WebCore::WebGLRenderingContext::getParameter):
+        (WebCore::WebGLRenderingContext::getSupportedExtensions):
+        (WebCore::WebGLRenderingContext::getTexParameter):
+        (WebCore::WebGLRenderingContext::texParameter):
+        * html/canvas/WebGLRenderingContext.h:
+        (WebCore):
+        (WebGLRenderingContext):
+        * platform/graphics/Extensions3D.h:
+        (Extensions3D):
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::supports):
+
 2012-03-05  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r109760.

Modified: trunk/Source/WebCore/DerivedSources.make (109797 => 109798)


--- trunk/Source/WebCore/DerivedSources.make	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/DerivedSources.make	2012-03-05 21:52:07 UTC (rev 109798)
@@ -297,6 +297,7 @@
     $(WebCore)/html/canvas/CanvasRenderingContext.idl \
     $(WebCore)/html/canvas/CanvasRenderingContext2D.idl \
     $(WebCore)/html/canvas/DataView.idl \
+    $(WebCore)/html/canvas/EXTTextureFilterAnisotropic.idl \
     $(WebCore)/html/canvas/Float32Array.idl \
     $(WebCore)/html/canvas/Float64Array.idl \
     $(WebCore)/html/canvas/Int16Array.idl \

Modified: trunk/Source/WebCore/DerivedSources.pri (109797 => 109798)


--- trunk/Source/WebCore/DerivedSources.pri	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/DerivedSources.pri	2012-03-05 21:52:07 UTC (rev 109798)
@@ -242,6 +242,7 @@
     $$PWD/html/canvas/CanvasPattern.idl \
     $$PWD/html/canvas/CanvasRenderingContext.idl \
     $$PWD/html/canvas/CanvasRenderingContext2D.idl \
+    $$PWD/html/canvas/EXTTextureFilterAnisotropic.idl \
     $$PWD/html/canvas/OESStandardDerivatives.idl \
     $$PWD/html/canvas/OESTextureFloat.idl \
     $$PWD/html/canvas/OESVertexArrayObject.idl \

Modified: trunk/Source/WebCore/GNUmakefile.list.am (109797 => 109798)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-03-05 21:52:07 UTC (rev 109798)
@@ -161,6 +161,8 @@
 	DerivedSources/WebCore/JSEntityReference.h \
 	DerivedSources/WebCore/JSErrorEvent.cpp \
 	DerivedSources/WebCore/JSErrorEvent.h \
+	DerivedSources/WebCore/JSEXTTextureFilterAnisotropic.cpp \
+	DerivedSources/WebCore/JSEXTTextureFilterAnisotropic.h \
 	DerivedSources/WebCore/JSEvent.cpp \
 	DerivedSources/WebCore/JSEventException.cpp \
 	DerivedSources/WebCore/JSEventException.h \
@@ -857,6 +859,7 @@
 	$(WebCore)/html/canvas/CanvasRenderingContext.idl \
 	$(WebCore)/html/canvas/CanvasRenderingContext2D.idl \
 	$(WebCore)/html/canvas/DataView.idl \
+	$(WebCore)/html/canvas/EXTTextureFilterAnisotropic.idl \
 	$(WebCore)/html/canvas/Float32Array.idl \
 	$(WebCore)/html/canvas/Float64Array.idl \
 	$(WebCore)/html/canvas/Int16Array.idl \
@@ -5734,6 +5737,8 @@
 	Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h \
 	Source/WebCore/html/canvas/WebGLExtension.cpp \
 	Source/WebCore/html/canvas/WebGLExtension.h \
+	Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.cpp \
+	Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.h \
 	Source/WebCore/html/canvas/OESStandardDerivatives.cpp \
 	Source/WebCore/html/canvas/OESStandardDerivatives.h \
 	Source/WebCore/html/canvas/OESTextureFloat.cpp \

Modified: trunk/Source/WebCore/Target.pri (109797 => 109798)


--- trunk/Source/WebCore/Target.pri	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/Target.pri	2012-03-05 21:52:07 UTC (rev 109798)
@@ -3735,6 +3735,7 @@
         html/canvas/WebGLRenderingContext.h \
         html/canvas/WebGLShader.h \
         html/canvas/WebGLSharedObject.h \
+        html/canvas/EXTTextureFilterAnisotropic.h \
         html/canvas/OESStandardDerivatives.h \
         html/canvas/OESTextureFloat.h \
         html/canvas/OESVertexArrayObject.h \
@@ -3775,6 +3776,7 @@
         html/canvas/WebGLRenderingContext.cpp \
         html/canvas/WebGLShader.cpp \
         html/canvas/WebGLSharedObject.cpp \
+        html/canvas/EXTTextureFilterAnisotropic.cpp \
         html/canvas/OESStandardDerivatives.cpp \
         html/canvas/OESTextureFloat.cpp \
         html/canvas/OESVertexArrayObject.cpp \

Modified: trunk/Source/WebCore/WebCore.gypi (109797 => 109798)


--- trunk/Source/WebCore/WebCore.gypi	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/WebCore.gypi	2012-03-05 21:52:07 UTC (rev 109798)
@@ -985,6 +985,7 @@
             'html/canvas/CanvasRenderingContext.idl',
             'html/canvas/CanvasRenderingContext2D.idl',
             'html/canvas/DataView.idl',
+            'html/canvas/EXTTextureFilterAnisotropic.idl',
             'html/canvas/Float32Array.idl',
             'html/canvas/Float64Array.idl',
             'html/canvas/Int16Array.idl',
@@ -5492,6 +5493,8 @@
             'html/canvas/CheckedInt.h',
             'html/canvas/DataView.cpp',
             'html/canvas/DataView.h',
+            'html/canvas/EXTTextureFilterAnisotropic.cpp',
+            'html/canvas/EXTTextureFilterAnisotropic.h',
             'html/canvas/OESStandardDerivatives.cpp',
             'html/canvas/OESStandardDerivatives.h',
             'html/canvas/OESTextureFloat.cpp',
@@ -7176,6 +7179,8 @@
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSErrorCallback.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSErrorEvent.cpp',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSErrorEvent.h',
+            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSEXTTextureFilterAnisotropic.cpp',
+            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSEXTTextureFilterAnisotropic.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSEvent.cpp',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSEvent.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSEventException.cpp',

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (109797 => 109798)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-03-05 21:52:07 UTC (rev 109798)
@@ -1857,6 +1857,10 @@
 		76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B0812370DA0006A991A /* DOMTokenList.cpp */; };
 		76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 76FC2B0912370DA0006A991A /* DOMTokenList.h */; };
 		76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76FF17E211235673001D61B5 /* PluginViewNone.cpp */; };
+		7728694E14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7728694B14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp */; };
+		7728694F14F8882500F484DC /* EXTTextureFilterAnisotropic.h in Headers */ = {isa = PBXBuildFile; fileRef = 7728694C14F8882500F484DC /* EXTTextureFilterAnisotropic.h */; };
+		7728698314FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7728698114FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp */; };
+		7728698414FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h in Headers */ = {isa = PBXBuildFile; fileRef = 7728698214FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h */; };
 		77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17A6E12F28182004E02F6 /* OESVertexArrayObject.cpp */; };
 		77A17A7212F28182004E02F6 /* OESVertexArrayObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A17A6F12F28182004E02F6 /* OESVertexArrayObject.h */; };
 		77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17A7412F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp */; };
@@ -8801,6 +8805,11 @@
 		76FC2B0912370DA0006A991A /* DOMTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTokenList.h; sourceTree = "<group>"; };
 		76FC2B0A12370DA0006A991A /* DOMTokenList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMTokenList.idl; sourceTree = "<group>"; };
 		76FF17E211235673001D61B5 /* PluginViewNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginViewNone.cpp; sourceTree = "<group>"; };
+		7728694B14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTTextureFilterAnisotropic.cpp; path = canvas/EXTTextureFilterAnisotropic.cpp; sourceTree = "<group>"; };
+		7728694C14F8882500F484DC /* EXTTextureFilterAnisotropic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTTextureFilterAnisotropic.h; path = canvas/EXTTextureFilterAnisotropic.h; sourceTree = "<group>"; };
+		7728694D14F8882500F484DC /* EXTTextureFilterAnisotropic.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTTextureFilterAnisotropic.idl; path = canvas/EXTTextureFilterAnisotropic.idl; sourceTree = "<group>"; };
+		7728698114FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTTextureFilterAnisotropic.cpp; sourceTree = "<group>"; };
+		7728698214FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTTextureFilterAnisotropic.h; sourceTree = "<group>"; };
 		77A17A6E12F28182004E02F6 /* OESVertexArrayObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESVertexArrayObject.cpp; path = canvas/OESVertexArrayObject.cpp; sourceTree = "<group>"; };
 		77A17A6F12F28182004E02F6 /* OESVertexArrayObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESVertexArrayObject.h; path = canvas/OESVertexArrayObject.h; sourceTree = "<group>"; };
 		77A17A7012F28182004E02F6 /* OESVertexArrayObject.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OESVertexArrayObject.idl; path = canvas/OESVertexArrayObject.idl; sourceTree = "<group>"; };
@@ -14589,6 +14598,9 @@
 				2E97CCE712939CB800C5C8FF /* DataView.cpp */,
 				2E97CCE812939CB800C5C8FF /* DataView.h */,
 				2E97CCE912939CB800C5C8FF /* DataView.idl */,
+				7728694B14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp */,
+				7728694C14F8882500F484DC /* EXTTextureFilterAnisotropic.h */,
+				7728694D14F8882500F484DC /* EXTTextureFilterAnisotropic.idl */,
 				49EECDCF10503C2300099FAB /* Float32Array.idl */,
 				6EBC5D80138B4C4E00A0CF8A /* Float64Array.idl */,
 				49EECDD510503C2300099FAB /* Int16Array.idl */,
@@ -17542,6 +17554,8 @@
 				7694563B1214D97C0007CBAE /* JSDOMTokenList.h */,
 				2E37E00312DBC5A400A6B233 /* JSDOMURL.cpp */,
 				2E37E00412DBC5A400A6B233 /* JSDOMURL.h */,
+				7728698114FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp */,
+				7728698214FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h */,
 				49EECEF4105070C400099FAB /* JSFloat32Array.cpp */,
 				49EECEF5105070C400099FAB /* JSFloat32Array.h */,
 				6EBC5EAD138B50F200A0CF8A /* JSFloat64Array.cpp */,
@@ -24506,6 +24520,8 @@
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
 				FD537353137B651800008DCE /* ZeroPole.h in Headers */,
+				7728694F14F8882500F484DC /* EXTTextureFilterAnisotropic.h in Headers */,
+				7728698414FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -27476,6 +27492,8 @@
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
 				FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
+				7728694E14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp in Sources */,
+				7728698314FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp (109797 => 109798)


--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp	2012-03-05 21:52:07 UTC (rev 109798)
@@ -29,9 +29,11 @@
 
 #include "JSWebGLRenderingContext.h"
 
+#include "EXTTextureFilterAnisotropic.h"
 #include "ExceptionCode.h"
 #include "HTMLCanvasElement.h"
 #include "HTMLImageElement.h"
+#include "JSEXTTextureFilterAnisotropic.h"
 #include "JSFloat32Array.h"
 #include "JSHTMLCanvasElement.h"
 #include "JSHTMLImageElement.h"
@@ -188,6 +190,8 @@
     switch (extension->getName()) {
     case WebGLExtension::WebKitWebGLLoseContextName:
         return toJS(exec, globalObject, static_cast<WebGLLoseContext*>(extension));
+    case WebGLExtension::EXTTextureFilterAnisotropicName:
+        return toJS(exec, globalObject, static_cast<EXTTextureFilterAnisotropic*>(extension));
     case WebGLExtension::OESStandardDerivativesName:
         return toJS(exec, globalObject, static_cast<OESStandardDerivatives*>(extension));
     case WebGLExtension::OESTextureFloatName:

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp (109797 => 109798)


--- trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp	2012-03-05 21:52:07 UTC (rev 109798)
@@ -39,6 +39,7 @@
 #include "V8ArrayBufferView.h"
 #include "V8Binding.h"
 #include "V8BindingMacros.h"
+#include "V8EXTTextureFilterAnisotropic.h"
 #include "V8Float32Array.h"
 #include "V8HTMLCanvasElement.h"
 #include "V8HTMLImageElement.h"
@@ -175,6 +176,10 @@
         extensionObject = toV8(static_cast<WebGLLoseContext*>(extension));
         referenceName = "webKitWebGLLoseContextName";
         break;
+    case WebGLExtension::EXTTextureFilterAnisotropicName:
+        extensionObject = toV8(static_cast<EXTTextureFilterAnisotropic*>(extension));
+        referenceName = "extTextureFilterAnisotropicName";
+        break;
     case WebGLExtension::OESStandardDerivativesName:
         extensionObject = toV8(static_cast<OESStandardDerivatives*>(extension));
         referenceName = "oesStandardDerivativesName";

Copied: trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.cpp (from rev 109797, trunk/Source/WebCore/html/canvas/WebGLExtension.h) (0 => 109798)


--- trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.cpp	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.cpp	2012-03-05 21:52:07 UTC (rev 109798)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 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(WEBGL)
+
+#include "EXTTextureFilterAnisotropic.h"
+
+namespace WebCore {
+
+EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic(WebGLRenderingContext* context)
+    : WebGLExtension(context)
+{
+}
+
+EXTTextureFilterAnisotropic::~EXTTextureFilterAnisotropic()
+{
+}
+
+WebGLExtension::ExtensionName EXTTextureFilterAnisotropic::getName() const
+{
+    return EXTTextureFilterAnisotropicName;
+}
+
+PassOwnPtr<EXTTextureFilterAnisotropic> EXTTextureFilterAnisotropic::create(WebGLRenderingContext* context)
+{
+    return adoptPtr(new EXTTextureFilterAnisotropic(context));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBGL)

Copied: trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.h (from rev 109797, trunk/Source/WebCore/html/canvas/WebGLExtension.h) (0 => 109798)


--- trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.h	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.h	2012-03-05 21:52:07 UTC (rev 109798)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2012 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 EXTTextureFilterAnisotropic_h
+#define EXTTextureFilterAnisotropic_h
+
+#include "WebGLExtension.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class EXTTextureFilterAnisotropic : public WebGLExtension {
+public:
+    static PassOwnPtr<EXTTextureFilterAnisotropic> create(WebGLRenderingContext*);
+
+    virtual ~EXTTextureFilterAnisotropic();
+    virtual ExtensionName getName() const;
+
+private:
+    EXTTextureFilterAnisotropic(WebGLRenderingContext*);
+};
+
+} // namespace WebCore
+
+#endif // EXTTextureFilterAnisotropic_h

Copied: trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl (from rev 109797, trunk/Source/WebCore/html/canvas/WebGLExtension.h) (0 => 109798)


--- trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl	                        (rev 0)
+++ trunk/Source/WebCore/html/canvas/EXTTextureFilterAnisotropic.idl	2012-03-05 21:52:07 UTC (rev 109798)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2012 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=WEBGL,
+        JSGenerateIsReachable=ImplContext,
+        OmitConstructor,
+        DoNotCheckConstants
+    ] EXTTextureFilterAnisotropic {
+        const unsigned int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+        const unsigned int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+    };
+}

Modified: trunk/Source/WebCore/html/canvas/WebGLExtension.h (109797 => 109798)


--- trunk/Source/WebCore/html/canvas/WebGLExtension.h	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/html/canvas/WebGLExtension.h	2012-03-05 21:52:07 UTC (rev 109798)
@@ -35,6 +35,7 @@
     // Extension names are needed to properly wrap instances in _javascript_ objects.
     enum ExtensionName {
         WebKitWebGLLoseContextName, // WEBKIT_ prefix until extension is official
+        EXTTextureFilterAnisotropicName,
         OESTextureFloatName,
         OESStandardDerivativesName,
         OESVertexArrayObjectName,

Modified: trunk/Source/WebCore/html/canvas/WebGLObject.cpp (109797 => 109798)


--- trunk/Source/WebCore/html/canvas/WebGLObject.cpp	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/html/canvas/WebGLObject.cpp	2012-03-05 21:52:07 UTC (rev 109798)
@@ -29,6 +29,7 @@
 
 #include "WebGLObject.h"
 
+#include "EXTTextureFilterAnisotropic.h"
 #include "OESStandardDerivatives.h"
 #include "OESTextureFloat.h"
 #include "OESVertexArrayObject.h"

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (109797 => 109798)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2012-03-05 21:52:07 UTC (rev 109798)
@@ -34,6 +34,7 @@
 #include "CheckedInt.h"
 #include "Console.h"
 #include "DOMWindow.h"
+#include "EXTTextureFilterAnisotropic.h"
 #include "ExceptionCode.h"
 #include "Extensions3D.h"
 #include "Frame.h"
@@ -2211,6 +2212,14 @@
     if (isContextLost())
         return 0;
 
+    if (equalIgnoringCase(name, "WEBKIT_EXT_texture_filter_anisotropic")
+        && m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic")) {
+        if (!m_extTextureFilterAnisotropic) {
+            m_context->getExtensions()->ensureEnabled("GL_EXT_texture_filter_anisotropic");
+            m_extTextureFilterAnisotropic = EXTTextureFilterAnisotropic::create(this);
+        }
+        return m_extTextureFilterAnisotropic.get();
+    }
     if (equalIgnoringCase(name, "OES_standard_derivatives")
         && m_context->getExtensions()->supports("GL_OES_standard_derivatives")) {
         if (!m_oesStandardDerivatives) {
@@ -2522,6 +2531,11 @@
         }
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getParameter", "invalid parameter name, OES_vertex_array_object not enabled");
         return WebGLGetInfo();
+    case Extensions3D::MAX_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
+        if (m_extTextureFilterAnisotropic)
+            return getUnsignedIntParameter(Extensions3D::MAX_TEXTURE_MAX_ANISOTROPY_EXT);
+        synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getParameter", "invalid parameter name, EXT_texture_filter_anisotropic not enabled");
+        return WebGLGetInfo();
     default:
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getParameter", "invalid parameter name");
         return WebGLGetInfo();
@@ -2683,6 +2697,8 @@
         result.append("OES_texture_float");
     if (m_context->getExtensions()->supports("GL_OES_standard_derivatives"))
         result.append("OES_standard_derivatives");
+    if (m_context->getExtensions()->supports("GL_EXT_texture_filter_anisotropic"))
+        result.append("WEBKIT_EXT_texture_filter_anisotropic");
     if (m_context->getExtensions()->supports("GL_OES_vertex_array_object"))
         result.append("OES_vertex_array_object");
     result.append("WEBKIT_WEBGL_lose_context");
@@ -2715,6 +2731,13 @@
     case GraphicsContext3D::TEXTURE_WRAP_T:
         m_context->getTexParameteriv(target, pname, &value);
         return WebGLGetInfo(static_cast<unsigned int>(value));
+    case Extensions3D::TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
+        if (m_extTextureFilterAnisotropic) {
+            m_context->getTexParameteriv(target, pname, &value);
+            return WebGLGetInfo(static_cast<unsigned int>(value));
+        }
+        synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getTexParameter", "invalid parameter name, EXT_texture_filter_anisotropic not enabled");
+        return WebGLGetInfo();
     default:
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getTexParameter", "invalid parameter name");
         return WebGLGetInfo();
@@ -3538,6 +3561,12 @@
             return;
         }
         break;
+    case Extensions3D::TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
+        if (!m_extTextureFilterAnisotropic) {
+            synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "texParameter", "invalid parameter, EXT_texture_filter_anisotropic not enabled");
+            return;
+        }
+        break;
     default:
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "texParameter", "invalid parameter name");
         return;

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (109797 => 109798)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h	2012-03-05 21:52:07 UTC (rev 109798)
@@ -40,6 +40,7 @@
 
 namespace WebCore {
 
+class EXTTextureFilterAnisotropic;
 class HTMLImageElement;
 class HTMLVideoElement;
 class ImageBuffer;
@@ -499,6 +500,7 @@
     int m_numGLErrorsToConsoleAllowed;
 
     // Enabled extension objects.
+    OwnPtr<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
     OwnPtr<OESTextureFloat> m_oesTextureFloat;
     OwnPtr<OESStandardDerivatives> m_oesStandardDerivatives;
     OwnPtr<OESVertexArrayObject> m_oesVertexArrayObject;

Modified: trunk/Source/WebCore/platform/graphics/Extensions3D.h (109797 => 109798)


--- trunk/Source/WebCore/platform/graphics/Extensions3D.h	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/platform/graphics/Extensions3D.h	2012-03-05 21:52:07 UTC (rev 109798)
@@ -65,6 +65,7 @@
     //   GL_EXT_texture_compression_s3tc
     //   GL_OES_compressed_ETC1_RGB8_texture
     //   GL_IMG_texture_compression_pvrtc
+    //   EXT_texture_filter_anisotropic
 
     // Takes full name of extension; for example,
     // "GL_EXT_texture_format_BGRA8888".
@@ -135,6 +136,10 @@
         COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01,
         COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02,
         COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03,
+
+        // GL_EXT_texture_filter_anisotropic
+        TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE,
+        MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF,
     };
 
     // GL_ARB_robustness

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (109797 => 109798)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp	2012-03-05 21:49:25 UTC (rev 109797)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp	2012-03-05 21:52:07 UTC (rev 109798)
@@ -98,6 +98,9 @@
     if (name == "GL_OES_standard_derivatives")
         return true;
 
+    if (name == "GL_EXT_texture_filter_anisotropic")
+        return m_availableExtensions.contains("GL_EXT_texture_filter_anisotropic");
+
     return m_availableExtensions.contains(name);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to