Changeset 146795 in webkit


Ignore:
Timestamp:
Mar 25, 2013, 12:05:57 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Enabled canvas.getContext("webgl") on Desktop Chrome
https://bugs.webkit.org/show_bug.cgi?id=113079

Patch by Brandon Jones <bajones@chromium.org> on 2013-03-25
Reviewed by Dean Jackson.

Test: fast/canvas/webgl/webgl-unprefixed-context-id.html

  • bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:

(WebCore::V8HTMLCanvasElement::getContextMethodCustom):

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::getContext):

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146793 r146795  
     12013-03-25  Brandon Jones  <bajones@chromium.org>
     2
     3        Enabled canvas.getContext("webgl") on Desktop Chrome
     4        https://bugs.webkit.org/show_bug.cgi?id=113079
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: fast/canvas/webgl/webgl-unprefixed-context-id.html
     9
     10        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
     11        (WebCore::V8HTMLCanvasElement::getContextMethodCustom):
     12        * html/HTMLCanvasElement.cpp:
     13        (WebCore::HTMLCanvasElement::getContext):
     14
    1152013-03-25  Roger Fong  <roger_fong@apple.com>
    216
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp

    r143850 r146795  
    5656    RefPtr<CanvasContextAttributes> attrs;
    5757#if ENABLE(WEBGL)
    58     if (contextId == "experimental-webgl" || contextId == "webkit-3d") {
     58    if (contextId == "webgl" || contextId == "experimental-webgl" || contextId == "webkit-3d") {
    5959        attrs = WebGLContextAttributes::create();
    6060        WebGLContextAttributes* webGLAttrs = static_cast<WebGLContextAttributes*>(attrs.get());
  • trunk/Source/WebCore/html/HTMLCanvasElement.cpp

    r146351 r146795  
    194194#endif
    195195        ) {
     196
    196197        // Accept the legacy "webkit-3d" name as well as the provisional "experimental-webgl" name.
    197         // Once ratified, we will also accept "webgl" as the context name.
    198         if ((type == "webkit-3d") ||
    199             (type == "experimental-webgl")) {
     198        bool is3dContext = (type == "webkit-3d") || (type == "experimental-webgl");
     199
     200#if PLATFORM(CHROMIUM) && !OS(ANDROID)
     201        // Now that WebGL is ratified, we will also accept "webgl" as the context name in Chrome.
     202        is3dContext |= (type == "webgl");
     203#endif
     204
     205        if (is3dContext) {
    200206            if (m_context && !m_context->is3d())
    201207                return 0;
Note: See TracChangeset for help on using the changeset viewer.