Commit fa6eb457 authored by cmarrin@apple.com's avatar cmarrin@apple.com
Browse files

Updated HTMLCanvasElement to accept "experimental-webgl" as the context name.

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a543207
2009-12-01 Chris Marrin <cmarrin@apple.com>
Reviewed by Oliver Hunt.
Updated webgl tests to use "experimental-webgl" as the context name.
https://bugs.webkit.org/show_bug.cgi?id=31672
* fast/canvas/webgl/gl-get-calls.html:
* fast/canvas/webgl/resources/utils3d.js:
(initWebGL):
* fast/canvas/webgl/resources/webgl-test.js:
(create3DContext):
2009-12-01 Csaba Osztrogonác <ossy@webkit.org>
 
[Qt] Put tests into skiplist because of missing textInputController.selectedRange().
......@@ -16,7 +16,7 @@ description("This test ensures basic functionality of the underlying graphics li
debug("");
debug("Canvas.getContext");
var context = document.getElementById("canvas").getContext("webkit-3d");
var context = document.getElementById("canvas").getContext("experimental-webgl");
if (!context)
testFailed("context does not exist");
else {
......
......@@ -18,7 +18,7 @@ function initWebGL(canvasName, vshader, fshader, attribs, clearColor, clearDepth
var canvas = document.getElementById(canvasName);
var gl;
try {gl = canvas.getContext("webkit-3d") } catch(e) { }
try {gl = canvas.getContext("experimental-webgl") } catch(e) { }
if (!gl)
try {gl = canvas.getContext("moz-webgl") } catch(e) { }
if (!gl) {
......
......@@ -11,7 +11,7 @@ function getShaderSource(file) {
function create3DContext() {
var canvas = document.createElement("canvas");
try {
return canvas.getContext("webkit-3d");
return canvas.getContext("experimental-webgl");
} catch(e) {}
return canvas.getContext("moz-webgl");
}
......
2009-12-01 Chris Marrin <cmarrin@apple.com>
Reviewed by Oliver Hunt.
Updated HTMLCanvasElement to accept "experimental-webgl" as the context name.
https://bugs.webkit.org/show_bug.cgi?id=31672
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
2009-12-01 Pavel Feldman <pfeldman@dhcp-172-28-174-220.spb.corp.google.com>
 
Not reviewed: chromium build fix, added missing import.
......@@ -149,9 +149,9 @@ String HTMLCanvasElement::toDataURL(const String& mimeType, ExceptionCode& ec)
CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type)
{
// A Canvas can either be "2D" or "3D" never both. If you request a 2D canvas and the existing
// context is already 2D, just return that. If the existing context is 3D, then destroy it
// before creating a new 2D context. Vice versa when requesting a 3D canvas. Requesting a
// A Canvas can either be "2D" or "webgl" but never both. If you request a 2D canvas and the existing
// context is already 2D, just return that. If the existing context is WebGL, then destroy it
// before creating a new 2D context. Vice versa when requesting a WebGL canvas. Requesting a
// context with any other type string will destroy any existing context.
// FIXME - The code depends on the context not going away once created, to prevent JS from
......@@ -167,8 +167,10 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type)
#if ENABLE(3D_CANVAS)
Settings* settings = document()->settings();
if (settings && settings->webGLEnabled()) {
// Accept the legacy "webkit-3d" name as well as the provisional "experimental-webgl" name.
// Once ratified, we will also accept "webgl" as the context name.
if ((type == "webkit-3d") ||
(type == "GL")) {
(type == "experimental-webgl")) {
if (m_context && !m_context->is3d())
return 0;
if (!m_context) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment