[CherryPick] [WEBGL] Rename WEBKIT_WEBGL_lose_context to WEBGL_lose_context.
authorKarol Świniarski <k.swiniarsk2@samsung.com>
Mon, 10 Jun 2013 11:26:37 +0000 (13:26 +0200)
committerKarol Świniarski <k.swiniarsk2@samsung.com>
Fri, 14 Jun 2013 12:19:27 +0000 (14:19 +0200)
[Title] [WEBGL] Rename WEBKIT_WEBGL_lose_context to WEBGL_lose_context.
[Problem] N/A
[Cause] N/A
[Solution] N/A
[Cherry-Picker] Karol Swiniarski

https://bugs.webkit.org/show_bug.cgi?id=108694

Change-Id: I2802734f60084b8d821387e82f91ace7d4e1157f

12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/WebGLContextEvent.html
LayoutTests/fast/canvas/webgl/context-destroyed-crash.html
LayoutTests/fast/canvas/webgl/context-lost-expected.txt
LayoutTests/fast/canvas/webgl/context-lost-restored.html
LayoutTests/fast/canvas/webgl/context-lost.html
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
Source/WebCore/html/canvas/WebGLExtension.h
Source/WebCore/html/canvas/WebGLLoseContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.cpp

index b127e7b..af1c3ea 100644 (file)
@@ -1,3 +1,20 @@
+2013-02-01 Nayan Kumar K <nayankk@motorola.com>
+
+        [WEBGL] Rename WEBKIT_WEBGL_lose_context to WEBGL_lose_context.
+        https://bugs.webkit.org/show_bug.cgi?id=108694
+
+        Reviewed by NOBODY (OOPS!).
+
+        WEBGL_lose_context is one of the community approved WebGL extension.
+        Hence remove the vendor prefix from WEBKIT_WEBGL_lose_context extension.
+        Spefication: http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
+
+        * fast/canvas/webgl/WebGLContextEvent.html:
+        * fast/canvas/webgl/context-destroyed-crash.html:
+        * fast/canvas/webgl/context-lost-expected.txt:
+        * fast/canvas/webgl/context-lost-restored.html:
+        * fast/canvas/webgl/context-lost.html:
+
 2012-10-05  Ryosuke Niwa  <rniwa@webkit.org>
 
         Deleting across multiple paragraphs can change the style of surrounding text
index 6c3088b..240bb60 100644 (file)
@@ -17,9 +17,9 @@ function createNewCanvas()
     canvas.height = 1;
 
     context = WebGLTestUtils.create3DContext(canvas);
-    extension = context.getExtension("WEBKIT_WEBGL_lose_context");
+    extension = context.getExtension("WEBGL_lose_context");
     if (!extension) {
-        debug("Could not find the WEBKIT_WEBGL_lose_context extension.");
+        debug("Could not find the WEBGL_lose_context extension.");
         return;
     }
 }
index 002eb04..1ec8c42 100644 (file)
@@ -22,7 +22,7 @@ window.onload = function()
 {
     canvas = document.createElement("canvas");
     context = create3DContext(canvas);
-    extension = context.getExtension("WEBKIT_WEBGL_lose_context");
+    extension = context.getExtension("WEBGL_lose_context");
     
     canvas = null;
     context = null;
index b956579..0abbf13 100644 (file)
@@ -169,7 +169,7 @@ PASS gl.getUniform(program, uniformLocation) is null
 PASS gl.getUniformLocation(program, 'vPosition') is null
 PASS gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) is null
 PASS gl.getSupportedExtensions() is null
-PASS gl.getExtension('WEBKIT_WEBGL_lose_context') is null
+PASS gl.getExtension('WEBGL_lose_context') is null
 PASS gl.isBuffer(buffer) is false
 PASS gl.isEnabled(gl.BLEND) is false
 PASS gl.isFramebuffer(framebuffer) is false
index 07516d9..c21b269 100644 (file)
@@ -10,10 +10,6 @@ var wtu = WebGLTestUtils;
 var canvas;
 var gl;
 var shouldGenerateGLError;
-var extensionNames = [
-    "WEBKIT_WEBGL_lose_context",
-    "MOZ_WEBGL_lose_context",
-];
 var extension;
 var bufferObjects;
 var program;
@@ -41,13 +37,9 @@ function setupTest()
     canvas.width = 1;
     canvas.height = 1;
     gl = wtu.create3DContext(canvas);
-    for (var ii = 0; ii < extensionNames.length; ++ii) {
-        extension = gl.getExtension(extensionNames[ii]);
-        if (extension)
-            break;
-    }
+    extension = gl.getExtension("WEBGL_lose_context");
     if (!extension) {
-        debug("Could not find lose_context extension under the following names: " + extensionNames.join(" "));
+        debug("Could not find lose_context extension under the following names: WEBGL_lose_context");
         return false;
     }
     return true;
index 5261d27..eccc273 100644 (file)
@@ -10,10 +10,6 @@ var wtu;
 var canvas;
 var gl;
 var shouldGenerateGLError;
-var extensionNames = [
-    "WEBKIT_WEBGL_lose_context",
-    "MOZ_WEBGL_lose_context",
-];
 var extensionName;
 var extension;
 
@@ -51,15 +47,9 @@ function init()
     // for the isContextLost() method, which we want to do regardless of the extension's presence.
     testValidContext();
 
-    for (var ii = 0; ii < extensionNames.length; ++ii) {
-        extension = gl.getExtension(extensionNames[ii]);
-        if (extension) {
-            extensionName = extensionNames[ii];
-            break;
-        }
-    }
+    extension = gl.getExtension("WEBGL_lose_context");
     if (!extension) {
-        debug("Could not find lose_context extension under the following names: " + extensionNames.join(" "));
+        debug("Could not find lose_context extension under the following names: WEBGL_lose_context");
         finishTest();
         return false;
     }
@@ -292,7 +282,7 @@ function testLostContext()
         "gl.getUniformLocation(program, 'vPosition')",
         "gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)",
         "gl.getSupportedExtensions()",
-        "gl.getExtension('" + extensionName + "')",
+        "gl.getExtension('WEBGL_lose_context')",
     ];
     for (var i = 0; i < nullTests.length; ++i) {
         shouldBeNull(nullTests[i]);
index 7fedc05..80467bd 100644 (file)
@@ -1,3 +1,28 @@
+2013-02-01 Nayan Kumar K <nayankk@motorola.com>
+
+        [WEBGL] Rename WEBKIT_WEBGL_lose_context to WEBGL_lose_context.
+        https://bugs.webkit.org/show_bug.cgi?id=108694
+
+        Reviewed by NOBODY (OOPS!).
+
+        WEBGL_lose_context is one of the community approved WebGL extension.
+        Hence remove the vendor prefix from WEBKIT_WEBGL_lose_context extension.
+        Spefication: http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
+
+        Tests already exists, modified them to verify the change in extension name.
+
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::toJS):
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        (WebCore::toV8Object):
+        * html/canvas/WebGLExtension.h:
+        * html/canvas/WebGLLoseContext.cpp:
+        (WebCore::WebGLLoseContext::getName):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore):
+        (WebCore::WebGLRenderingContext::getExtension):
+        (WebCore::WebGLRenderingContext::getSupportedExtensions):
+
 2012-10-05  Ryosuke Niwa  <rniwa@webkit.org>
 
         Deleting across multiple paragraphs can change the style of surrounding text
index d6a171f..60f6e64 100644 (file)
@@ -190,7 +190,7 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
     if (!extension)
         return jsNull();
     switch (extension->getName()) {
-    case WebGLExtension::WebKitWebGLLoseContextName:
+    case WebGLExtension::WebGLLoseContextName:
         return toJS(exec, globalObject, static_cast<WebGLLoseContext*>(extension));
     case WebGLExtension::EXTTextureFilterAnisotropicName:
         return toJS(exec, globalObject, static_cast<EXTTextureFilterAnisotropic*>(extension));
index 5904ec2..a3d7a92 100644 (file)
@@ -173,9 +173,9 @@ static v8::Handle<v8::Value> toV8Object(WebGLExtension* extension, v8::Handle<v8
     v8::Handle<v8::Value> extensionObject;
     const char* referenceName = 0;
     switch (extension->getName()) {
-    case WebGLExtension::WebKitWebGLLoseContextName:
+    case WebGLExtension::WebGLLoseContextName:
         extensionObject = toV8(static_cast<WebGLLoseContext*>(extension), isolate);
-        referenceName = "webKitWebGLLoseContextName";
+        referenceName = "webGLLoseContextName";
         break;
     case WebGLExtension::EXTTextureFilterAnisotropicName:
         extensionObject = toV8(static_cast<EXTTextureFilterAnisotropic*>(extension), isolate);
index c66a608..8dddda6 100644 (file)
@@ -34,7 +34,7 @@ class WebGLExtension {
 public:
     // Extension names are needed to properly wrap instances in JavaScript objects.
     enum ExtensionName {
-        WebKitWebGLLoseContextName, // WEBKIT_ prefix until extension is official
+        WebGLLoseContextName,
         EXTTextureFilterAnisotropicName,
         OESTextureFloatName,
         OESStandardDerivativesName,
index 244f3dc..5b96bd7 100644 (file)
@@ -44,7 +44,7 @@ WebGLLoseContext::~WebGLLoseContext()
 
 WebGLExtension::ExtensionName WebGLLoseContext::getName() const
 {
-    return WebKitWebGLLoseContextName;
+    return WebGLLoseContextName;
 }
 
 PassOwnPtr<WebGLLoseContext> WebGLLoseContext::create(WebGLRenderingContext* context)
index 63c0c23..06deb23 100755 (executable)
@@ -2326,9 +2326,7 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
         }
         return m_oesVertexArrayObject.get();
     }
-    if (equalIgnoringCase(name, "WEBKIT_WEBGL_lose_context")
-        // FIXME: remove this after a certain grace period.
-        || equalIgnoringCase(name, "WEBKIT_lose_context")) {
+    if (equalIgnoringCase(name, "WEBGL_lose_context")) {
         if (!m_webglLoseContext)
             m_webglLoseContext = WebGLLoseContext::create(this);
         return m_webglLoseContext.get();
@@ -2827,7 +2825,7 @@ Vector<String> WebGLRenderingContext::getSupportedExtensions()
         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");
+    result.append("WEBGL_lose_context");
     if (WebGLCompressedTextureS3TC::supported(this))
         result.append("WEBKIT_WEBGL_compressed_texture_s3tc");
     if (WebGLDepthTexture::supported(graphicsContext3D()))