⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 199062 in webkit


Ignore:
Timestamp:
Apr 5, 2016, 9:54:07 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[WebGL2] Turn the ENABLE_WEBGL2 flag on
​https://bugs.webkit.org/show_bug.cgi?id=156061
<rdar://problem/25463193>

Patch by Antoine Quint <Antoine Quint> on 2016-04-05
Reviewed by Alex Christensen.

Source/JavaScriptCore:

  • Configurations/FeatureDefines.xcconfig:
  • runtime/CommonIdentifiers.h:

Define the conditionalized classes WebGL2RenderingContext and WebGLVertexArrayObject.

Source/WebCore:

Conditionalize the definition of the WebGL2RenderingContext and WebGLVertexArrayObject globals
based on the new WebGL2 runtime flag we introduced in ​https://webkit.org/b/156166.

Turning the ENABLE_WEBGL2 flag on caused a host of build errors which we fix here. A non-obvious
error was in code generated from the html/canvas/WebGL2RenderingContext.idl file which was solved
by updating the getBufferSubData() method to the current signature as of the March 29 Editor's
Draft of the WebGL 2 Specification (​https://www.khronos.org/registry/webgl/specs/latest/2.0/).
Missing JSC headers in WebGL2RenderingContext.cpp also caused some linking errors in Release builds.

Tests: webgl/webgl-vertex-array-object-defined.html

webgl/webgl2-rendering-context-defined.html
webgl/webgl2-rendering-context-obtain.html

  • Configurations/FeatureDefines.xcconfig:
  • bindings/js/JSWebGL2RenderingContextCustom.cpp:

(WebCore::JSWebGL2RenderingContext::getInternalformatParameter):
(WebCore::JSWebGL2RenderingContext::getQueryParameter):
(WebCore::JSWebGL2RenderingContext::getSamplerParameter):
(WebCore::JSWebGL2RenderingContext::getSyncParameter):
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
(WebCore::JSWebGL2RenderingContext::getActiveUniformBlockParameter):
(WebCore::JSWebGL2RenderingContext::getActiveUniformBlockName):

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::is3dType):

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::getBufferSubData): Deleted.

  • html/canvas/WebGL2RenderingContext.idl:
  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::create):

  • html/canvas/WebGLVertexArrayObject.idl:

Source/WebKit/mac:

  • Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

  • Configurations/FeatureDefines.xcconfig:

LayoutTests:

  • platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
  • platform/mac/js/dom/global-constructors-attributes-expected.txt:

The WebGL2RenderingContext and WebGLVertexArrayObject classes are now defined
so expectations for this test which lists the configuration of global constructors
needed to be updated.

  • webgl/webgl-vertex-array-object-defined-expected.txt: Added.
  • webgl/webgl-vertex-array-object-defined.html: Added.

Test checking that WebGLVertexArrayObject is defined.

  • webgl/webgl2-rendering-context-defined-expected.txt: Added.
  • webgl/webgl2-rendering-context-defined.html: Added.

Test checking that WebGL2RenderingContext is defined.

  • webgl/webgl2-rendering-context-obtain-expected.txt: Added.
  • webgl/webgl2-rendering-context-obtain.html: Added.

Test checking that asking for a "webgl2" context returns a WebGL2RenderingContext.

Location:
trunk
Files:
6 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199061 r199062  
     12016-04-05  Antoine Quint  <graouts@apple.com>
     2
     3        [WebGL2] Turn the ENABLE_WEBGL2 flag on
     4        https://bugs.webkit.org/show_bug.cgi?id=156061
     5        <rdar://problem/25463193>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
     10        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
     11
     12        The WebGL2RenderingContext and WebGLVertexArrayObject classes are now defined
     13        so expectations for this test which lists the configuration of global constructors
     14        needed to be updated.
     15
     16        * webgl/webgl-vertex-array-object-defined-expected.txt: Added.
     17        * webgl/webgl-vertex-array-object-defined.html: Added.
     18
     19        Test checking that WebGLVertexArrayObject is defined.
     20
     21        * webgl/webgl2-rendering-context-defined-expected.txt: Added.
     22        * webgl/webgl2-rendering-context-defined.html: Added.
     23
     24        Test checking that WebGL2RenderingContext is defined.
     25
     26        * webgl/webgl2-rendering-context-obtain-expected.txt: Added.
     27        * webgl/webgl2-rendering-context-obtain.html: Added.
     28
     29        Test checking that asking for a "webgl2" context returns a WebGL2RenderingContext.
     30
    1312016-04-05  Chris Dumez  <cdumez@apple.com>
    232
  • trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt

    r198492 r199062  
    21142114PASS Object.getOwnPropertyDescriptor(global, 'WeakSet').enumerable is false
    21152115PASS Object.getOwnPropertyDescriptor(global, 'WeakSet').configurable is true
     2116PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').value is WebGL2RenderingContext
     2117PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').hasOwnProperty('get') is false
     2118PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').hasOwnProperty('set') is false
     2119PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').enumerable is false
     2120PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').configurable is true
    21162121PASS Object.getOwnPropertyDescriptor(global, 'WebGLActiveInfo').value is WebGLActiveInfo
    21172122PASS Object.getOwnPropertyDescriptor(global, 'WebGLActiveInfo').hasOwnProperty('get') is false
    … …  
    21892194PASS Object.getOwnPropertyDescriptor(global, 'WebGLUniformLocation').enumerable is false
    21902195PASS Object.getOwnPropertyDescriptor(global, 'WebGLUniformLocation').configurable is true
     2196PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').value is WebGLVertexArrayObject
     2197PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').hasOwnProperty('get') is false
     2198PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').hasOwnProperty('set') is false
     2199PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').enumerable is false
     2200PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').configurable is true
    21912201PASS Object.getOwnPropertyDescriptor(global, 'WebKitAnimationEvent').value is WebKitAnimationEvent
    21922202PASS Object.getOwnPropertyDescriptor(global, 'WebKitAnimationEvent').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

    r198492 r199062  
    21142114PASS Object.getOwnPropertyDescriptor(global, 'WeakSet').enumerable is false
    21152115PASS Object.getOwnPropertyDescriptor(global, 'WeakSet').configurable is true
     2116PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').value is WebGL2RenderingContext
     2117PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').hasOwnProperty('get') is false
     2118PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').hasOwnProperty('set') is false
     2119PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').enumerable is false
     2120PASS Object.getOwnPropertyDescriptor(global, 'WebGL2RenderingContext').configurable is true
    21162121PASS Object.getOwnPropertyDescriptor(global, 'WebGLActiveInfo').value is WebGLActiveInfo
    21172122PASS Object.getOwnPropertyDescriptor(global, 'WebGLActiveInfo').hasOwnProperty('get') is false
    … …  
    21892194PASS Object.getOwnPropertyDescriptor(global, 'WebGLUniformLocation').enumerable is false
    21902195PASS Object.getOwnPropertyDescriptor(global, 'WebGLUniformLocation').configurable is true
     2196PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').value is WebGLVertexArrayObject
     2197PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').hasOwnProperty('get') is false
     2198PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').hasOwnProperty('set') is false
     2199PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').enumerable is false
     2200PASS Object.getOwnPropertyDescriptor(global, 'WebGLVertexArrayObject').configurable is true
    21912201PASS Object.getOwnPropertyDescriptor(global, 'WebKitAnimationEvent').value is WebKitAnimationEvent
    21922202PASS Object.getOwnPropertyDescriptor(global, 'WebKitAnimationEvent').hasOwnProperty('get') is false
  • trunk/Source/JavaScriptCore/ChangeLog

    r199052 r199062  
     12016-04-05  Antoine Quint  <graouts@apple.com>
     2
     3        [WebGL2] Turn the ENABLE_WEBGL2 flag on
     4        https://bugs.webkit.org/show_bug.cgi?id=156061
     5        <rdar://problem/25463193>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * Configurations/FeatureDefines.xcconfig:
     10        * runtime/CommonIdentifiers.h:
     11
     12        Define the conditionalized classes WebGL2RenderingContext and WebGLVertexArrayObject.
     13
    1142016-04-04  Zan Dobersek  <zdobersek@igalia.com>
    215
  • trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig

    r198475 r199062  
    177177ENABLE_WEBASSEMBLY = ;
    178178ENABLE_WEBGL = ENABLE_WEBGL;
    179 ENABLE_WEBGL2 = ;
     179ENABLE_WEBGL2 = ENABLE_WEBGL2;
    180180ENABLE_WEB_ANIMATIONS = ENABLE_WEB_ANIMATIONS;
    181181ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r199017 r199062  
    8888    macro(WeakMap)\
    8989    macro(WeakSet)\
     90    macro(WebGL2RenderingContext) \
     91    macro(WebGLVertexArrayObject) \
    9092    macro(WebSocket) \
    9193    macro(__defineGetter__) \
  • trunk/Source/WebCore/ChangeLog

    r199060 r199062  
     12016-04-05  Antoine Quint  <graouts@apple.com>
     2
     3        [WebGL2] Turn the ENABLE_WEBGL2 flag on
     4        https://bugs.webkit.org/show_bug.cgi?id=156061
     5        <rdar://problem/25463193>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Conditionalize the definition of the WebGL2RenderingContext and WebGLVertexArrayObject globals
     10        based on the new WebGL2 runtime flag we introduced in https://webkit.org/b/156166.
     11
     12        Turning the ENABLE_WEBGL2 flag on caused a host of build errors which we fix here. A non-obvious
     13        error was in code generated from the html/canvas/WebGL2RenderingContext.idl file which was solved
     14        by updating the getBufferSubData() method to the current signature as of the March 29 Editor's
     15        Draft of the WebGL 2 Specification (https://www.khronos.org/registry/webgl/specs/latest/2.0/).
     16        Missing JSC headers in WebGL2RenderingContext.cpp also caused some linking errors in Release builds.
     17
     18        Tests: webgl/webgl-vertex-array-object-defined.html
     19               webgl/webgl2-rendering-context-defined.html
     20               webgl/webgl2-rendering-context-obtain.html
     21
     22        * Configurations/FeatureDefines.xcconfig:
     23        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
     24        (WebCore::JSWebGL2RenderingContext::getInternalformatParameter):
     25        (WebCore::JSWebGL2RenderingContext::getQueryParameter):
     26        (WebCore::JSWebGL2RenderingContext::getSamplerParameter):
     27        (WebCore::JSWebGL2RenderingContext::getSyncParameter):
     28        (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
     29        (WebCore::JSWebGL2RenderingContext::getActiveUniformBlockParameter):
     30        (WebCore::JSWebGL2RenderingContext::getActiveUniformBlockName):
     31        * html/HTMLCanvasElement.cpp:
     32        (WebCore::HTMLCanvasElement::is3dType):
     33        * html/canvas/WebGL2RenderingContext.cpp:
     34        (WebCore::WebGL2RenderingContext::getBufferSubData): Deleted.
     35        * html/canvas/WebGL2RenderingContext.idl:
     36        * html/canvas/WebGLRenderingContextBase.cpp:
     37        (WebCore::WebGLRenderingContextBase::create):
     38        * html/canvas/WebGLVertexArrayObject.idl:
     39
    1402016-04-05  Antti Koivisto  <antti@apple.com>
    241
  • trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig

    r198475 r199062  
    177177ENABLE_WEBASSEMBLY = ;
    178178ENABLE_WEBGL = ENABLE_WEBGL;
    179 ENABLE_WEBGL2 = ;
     179ENABLE_WEBGL2 = ENABLE_WEBGL2;
    180180ENABLE_WEB_ANIMATIONS = ENABLE_WEB_ANIMATIONS;
    181181ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
  • trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp

    r191887 r199062  
    2929#include "JSWebGL2RenderingContext.h"
    3030
     31#include <runtime/Error.h>
    3132#include "NotImplemented.h"
    3233#include "WebGL2RenderingContext.h"
    … …  
    7172}
    7273
    73 JSValue JSWebGL2RenderingContext::getInternalformatParameter(ExecState* exec)
     74JSValue JSWebGL2RenderingContext::getInternalformatParameter(ExecState& exec)
    7475{
    7576    UNUSED_PARAM(exec);
    … …  
    7778}
    7879
    79 JSValue JSWebGL2RenderingContext::getQueryParameter(ExecState* exec)
     80JSValue JSWebGL2RenderingContext::getQueryParameter(ExecState& exec)
    8081{
    8182    UNUSED_PARAM(exec);
    … …  
    8384}
    8485
    85 JSValue JSWebGL2RenderingContext::getSamplerParameter(ExecState* exec)
     86JSValue JSWebGL2RenderingContext::getSamplerParameter(ExecState& exec)
    8687{
    8788    UNUSED_PARAM(exec);
    … …  
    8990}
    9091
    91 JSValue JSWebGL2RenderingContext::getSyncParameter(ExecState* exec)
     92JSValue JSWebGL2RenderingContext::getSyncParameter(ExecState& exec)
    9293{
    9394    UNUSED_PARAM(exec);
    … …  
    9596}
    9697
    97 JSValue JSWebGL2RenderingContext::getIndexedParameter(ExecState* exec)
     98JSValue JSWebGL2RenderingContext::getIndexedParameter(ExecState& exec)
    9899{
    99     if (exec->argumentCount() != 2)
    100         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
     100    if (exec.argumentCount() != 2)
     101        return exec.vm().throwException(&exec, createNotEnoughArgumentsError(&exec));
    101102
    102103    WebGL2RenderingContext& context = wrapped();
    103     unsigned pname = exec->uncheckedArgument(0).toInt32(exec);
    104     if (exec->hadException())
     104    unsigned pname = exec.uncheckedArgument(0).toInt32(&exec);
     105    if (exec.hadException())
    105106        return jsUndefined();
    106     unsigned index = exec->uncheckedArgument(1).toInt32(exec);
    107     if (exec->hadException())
     107    unsigned index = exec.uncheckedArgument(1).toInt32(&exec);
     108    if (exec.hadException())
    108109        return jsUndefined();
    109110    WebGLGetInfo info = context.getIndexedParameter(pname, index);
    110     return toJS(exec, globalObject(), info);
     111    return toJS(&exec, globalObject(), info);
    111112}
    112113
    113 JSValue JSWebGL2RenderingContext::getActiveUniformBlockParameter(ExecState* exec)
     114JSValue JSWebGL2RenderingContext::getActiveUniformBlockParameter(ExecState& exec)
    114115{
    115116    UNUSED_PARAM(exec);
    … …  
    117118}
    118119
    119 JSValue JSWebGL2RenderingContext::getActiveUniformBlockName(ExecState* exec)
     120JSValue JSWebGL2RenderingContext::getActiveUniformBlockName(ExecState& exec)
    120121{
    121122    UNUSED_PARAM(exec);
  • trunk/Source/WebCore/html/HTMLCanvasElement.cpp

    r198958 r199062  
    297297    return type == "webgl" || type == "experimental-webgl"
    298298#if ENABLE(WEBGL2)
    299         || type == "experimental-webgl2"
     299        || type == "webgl2"
    300300#endif
    301301        || type == "webkit-3d";
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r195743 r199062  
    5555#include "WebGLTransformFeedback.h"
    5656#include "WebGLVertexArrayObject.h"
     57#include <JavaScriptCore/GenericTypedArrayViewInlines.h>
     58#include <JavaScriptCore/JSGenericTypedArrayViewInlines.h>
    5759
    5860namespace WebCore {
    … …  
    9496    UNUSED_PARAM(writeOffset);
    9597    UNUSED_PARAM(size);
    96 }
    97 
    98 void WebGL2RenderingContext::getBufferSubData(GC3Denum target, GC3Dint64 offset, ArrayBufferView* returnedData)
    99 {
    100     UNUSED_PARAM(target);
    101     UNUSED_PARAM(offset);
    102     UNUSED_PARAM(returnedData);
    10398}
    10499
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.idl

    r186198 r199062  
    4343[
    4444    Conditional=WEBGL2,
     45    EnabledAtRuntime=WebGL2,
    4546    JSCustomMarkFunction,
    4647    DoNotCheckConstants,
    … …  
    336337    // can not be exposed safely to JavaScript. GetBufferSubData
    337338    // replaces it for the purpose of fetching data back from the GPU.
    338     [StrictTypeChecking] void getBufferSubData(GLenum target, GLintptr offset, ArrayBufferView returnedData);
    339     [StrictTypeChecking] void getBufferSubData(GLenum target, GLintptr offset, ArrayBuffer returnedData);
     339    [StrictTypeChecking] void getBufferSubData(GLenum target, GLintptr offset, ArrayBuffer? returnedData);
    340340
    341341    /* Framebuffer objects */
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r198588 r199062  
    405405        std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
    406406#if ENABLE(WEBGL2)
    407         if (type == "experimental-webgl2")
     407        if (type == "webgl2")
    408408            renderingContext = std::unique_ptr<WebGL2RenderingContext>(new WebGL2RenderingContext(canvas, attributes));
    409409        else
    … …  
    428428    std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
    429429#if ENABLE(WEBGL2)
    430     if (type == "experimental-webgl2")
     430    if (type == "webgl2")
    431431        renderingContext = std::unique_ptr<WebGL2RenderingContext>(new WebGL2RenderingContext(canvas, context, attributes));
    432432    else
  • trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.idl

    r186198 r199062  
    2525
    2626[
    27     Conditional=WEBGL2
     27    Conditional=WEBGL2,
     28    EnabledAtRuntime=WebGL2
    2829] interface WebGLVertexArrayObject {
    2930};
  • trunk/Source/WebKit/mac/ChangeLog

    r199055 r199062  
     12016-04-05  Antoine Quint  <graouts@apple.com>
     2
     3        [WebGL2] Turn the ENABLE_WEBGL2 flag on
     4        https://bugs.webkit.org/show_bug.cgi?id=156061
     5        <rdar://problem/25463193>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * Configurations/FeatureDefines.xcconfig:
     10
    1112016-04-05  Antoine Quint  <graouts@apple.com>
    212
  • trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig

    r198475 r199062  
    177177ENABLE_WEBASSEMBLY = ;
    178178ENABLE_WEBGL = ENABLE_WEBGL;
    179 ENABLE_WEBGL2 = ;
     179ENABLE_WEBGL2 = ENABLE_WEBGL2;
    180180ENABLE_WEB_ANIMATIONS = ENABLE_WEB_ANIMATIONS;
    181181ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
  • trunk/Source/WebKit2/ChangeLog

    r199061 r199062  
     12016-04-05  Antoine Quint  <graouts@apple.com>
     2
     3        [WebGL2] Turn the ENABLE_WEBGL2 flag on
     4        https://bugs.webkit.org/show_bug.cgi?id=156061
     5        <rdar://problem/25463193>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * Configurations/FeatureDefines.xcconfig:
     10
    1112016-04-05  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig

    r198475 r199062  
    177177ENABLE_WEBASSEMBLY = ;
    178178ENABLE_WEBGL = ENABLE_WEBGL;
    179 ENABLE_WEBGL2 = ;
     179ENABLE_WEBGL2 = ENABLE_WEBGL2;
    180180ENABLE_WEB_ANIMATIONS = ENABLE_WEB_ANIMATIONS;
    181181ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
Note: See TracChangeset for help on using the changeset viewer.