Changeset 60980 in webkit


Ignore:
Timestamp:
Jun 10, 2010 4:05:23 PM (14 years ago)
Author:
kbr@google.com
Message:

2010-06-10 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r60979.
http://trac.webkit.org/changeset/60979
https://bugs.webkit.org/show_bug.cgi?id=40450

Broke build on Leopard (Requested by kbr_google on #webkit).

  • bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::JSWebGLRenderingContext::bufferData): (WebCore::JSWebGLRenderingContext::bufferSubData): (WebCore::JSWebGLRenderingContext::texImage2D): (WebCore::JSWebGLRenderingContext::texSubImage2D):
  • bindings/scripts/CodeGeneratorJS.pm:
  • html/HTMLCanvasElement.idl:
  • html/HTMLImageElement.idl:
  • html/HTMLVideoElement.idl:
  • html/canvas/WebGLRenderingContext.idl:

2010-06-10 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r60979.
http://trac.webkit.org/changeset/60979
https://bugs.webkit.org/show_bug.cgi?id=40450

Broke build on Leopard (Requested by kbr_google on #webkit).

  • fast/canvas/webgl/script-tests/texImageTest.js:
  • fast/canvas/webgl/texImageTest-expected.txt:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60979 r60980  
     12010-06-10  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r60979.
     4        http://trac.webkit.org/changeset/60979
     5        https://bugs.webkit.org/show_bug.cgi?id=40450
     6
     7        Broke build on Leopard (Requested by kbr_google on #webkit).
     8
     9        * fast/canvas/webgl/script-tests/texImageTest.js:
     10        * fast/canvas/webgl/texImageTest-expected.txt:
     11
    1122010-06-10  Kenneth Russell  <kbr@google.com>
    213
  • trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js

    r60979 r60980  
    2020shouldThrow("context.texSubImage2D(context.TEXTURE_2D)");
    2121shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null)");
     22// FIXME: The following test fails on JSC: https://bugs.webkit.org/show_bug.cgi?id=38024
    2223shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)");
    2324shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0)");
  • trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt

    r60979 r60980  
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    5 PASS context.texImage2D(context.TEXTURE_2D) threw exception TypeError: Type error.
     5PASS context.texImage2D(context.TEXTURE_2D) threw exception SyntaxError: Syntax error.
    66PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 64, 64, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined.
    7 PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.
     7PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception SyntaxError: Syntax error.
    88PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 2, 2, 0, context.RGBA, context.UNSIGNED_BYTE, array) is undefined.
    99PASS context.texImage2D(context.TEXTURE_2D, 0, imageData, true) is undefined.
     
    1111PASS context.texImage2D(context.TEXTURE_2D, 0, canvas2d, false) is undefined.
    1212PASS context.texImage2D(context.TEXTURE_2D, 0, video, true, false) is undefined.
    13 PASS context.texSubImage2D(context.TEXTURE_2D) threw exception TypeError: Type error.
     13PASS context.texSubImage2D(context.TEXTURE_2D) threw exception SyntaxError: Syntax error.
    1414PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined.
    15 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.
    16 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.
     15FAIL context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) should throw an exception. Was undefined.
     16PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception SyntaxError: Syntax error.
    1717PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, imageData, false) is undefined.
    1818PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, image) is undefined.
  • trunk/WebCore/ChangeLog

    r60979 r60980  
     12010-06-10  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r60979.
     4        http://trac.webkit.org/changeset/60979
     5        https://bugs.webkit.org/show_bug.cgi?id=40450
     6
     7        Broke build on Leopard (Requested by kbr_google on #webkit).
     8
     9        * bindings/js/JSWebGLRenderingContextCustom.cpp:
     10        (WebCore::JSWebGLRenderingContext::bufferData):
     11        (WebCore::JSWebGLRenderingContext::bufferSubData):
     12        (WebCore::JSWebGLRenderingContext::texImage2D):
     13        (WebCore::JSWebGLRenderingContext::texSubImage2D):
     14        * bindings/scripts/CodeGeneratorJS.pm:
     15        * html/HTMLCanvasElement.idl:
     16        * html/HTMLImageElement.idl:
     17        * html/HTMLVideoElement.idl:
     18        * html/canvas/WebGLRenderingContext.idl:
     19
    1202010-06-10  Kenneth Russell  <kbr@google.com>
    221
  • trunk/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp

    r60979 r60980  
    6767
    6868namespace WebCore {
     69
     70JSValue JSWebGLRenderingContext::bufferData(JSC::ExecState* exec)
     71{
     72    if (exec->argumentCount() != 3)
     73        return throwSyntaxError(exec);
     74
     75    unsigned target = exec->argument(0).toInt32(exec);
     76    unsigned usage = exec->argument(2).toInt32(exec);
     77    ExceptionCode ec = 0;
     78
     79    // If argument 1 is a number, we are initializing this buffer to that size
     80    if (!exec->argument(1).isObject()) {
     81        unsigned int count = exec->argument(1).toInt32(exec);
     82        static_cast<WebGLRenderingContext*>(impl())->bufferData(target, count, usage, ec);
     83    } else {
     84        ArrayBufferView* array = toArrayBufferView(exec->argument(1));
     85        static_cast<WebGLRenderingContext*>(impl())->bufferData(target, array, usage, ec);
     86    }
     87
     88    setDOMException(exec, ec);
     89    return jsUndefined();
     90}
     91
     92JSValue JSWebGLRenderingContext::bufferSubData(JSC::ExecState* exec)
     93{
     94    if (exec->argumentCount() != 3)
     95        return throwSyntaxError(exec);
     96
     97    unsigned target = exec->argument(0).toInt32(exec);
     98    unsigned offset = exec->argument(1).toInt32(exec);
     99    ExceptionCode ec = 0;
     100   
     101    ArrayBufferView* array = toArrayBufferView(exec->argument(2));
     102   
     103    static_cast<WebGLRenderingContext*>(impl())->bufferSubData(target, offset, array, ec);
     104
     105    setDOMException(exec, ec);
     106    return jsUndefined();
     107}
    69108
    70109static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo& info)
     
    273312}
    274313
     314//   void texImage2D(in GLenum target, in GLint level, in GLenum internalformat, in GLsizei width, in GLsizei height, in GLint border, in GLenum format, in GLenum type, in ArrayBufferView pixels);
     315//   void texImage2D(in GLenum target, in GLint level, in ImageData pixels, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
     316//   void texImage2D(in GLenum target, in GLint level, in HTMLImageElement image, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
     317//   void texImage2D(in GLenum target, in GLint level, in HTMLCanvasElement canvas, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
     318//   void texImage2D(in GLenum target, in GLint level, in HTMLVideoElement video, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
     319JSValue JSWebGLRenderingContext::texImage2D(ExecState* exec)
     320{
     321    if (exec->argumentCount() < 3 || exec->argumentCount() > 9)
     322        return throwSyntaxError(exec);
     323
     324    ExceptionCode ec = 0;
     325   
     326    WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());   
     327    unsigned target = exec->argument(0).toInt32(exec);
     328    if (exec->hadException())   
     329        return jsUndefined();
     330   
     331    unsigned level = exec->argument(1).toInt32(exec);
     332    if (exec->hadException())   
     333        return jsUndefined();
     334
     335    JSObject* o = 0;
     336   
     337    if (exec->argumentCount() <= 5) {
     338        // This is one of the last 4 forms. Param 2 can be ImageData or <img>, <canvas> or <video> element.
     339        JSValue value = exec->argument(2);
     340   
     341        if (!value.isObject())
     342            return throwTypeError(exec);
     343       
     344        o = asObject(value);
     345       
     346        bool flipY = exec->argument(3).toBoolean(exec);
     347        bool premultiplyAlpha = exec->argument(4).toBoolean(exec);
     348       
     349        if (o->inherits(&JSImageData::s_info)) {
     350            ImageData* data = static_cast<ImageData*>(static_cast<JSImageData*>(o)->impl());
     351            context->texImage2D(target, level, data, flipY, premultiplyAlpha, ec);
     352        } else if (o->inherits(&JSHTMLImageElement::s_info)) {
     353            HTMLImageElement* element = static_cast<HTMLImageElement*>(static_cast<JSHTMLImageElement*>(o)->impl());
     354            context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec);
     355        } else if (o->inherits(&JSHTMLCanvasElement::s_info)) {
     356            HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(static_cast<JSHTMLCanvasElement*>(o)->impl());
     357            context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec);
     358#if ENABLE(VIDEO)
     359        } else if (o->inherits(&JSHTMLVideoElement::s_info)) {
     360            HTMLVideoElement* element = static_cast<HTMLVideoElement*>(static_cast<JSHTMLVideoElement*>(o)->impl());
     361            context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec);
     362#endif
     363        } else
     364            ec = TYPE_MISMATCH_ERR;
     365    } else {
     366        if (exec->argumentCount() != 9)
     367            return throwSyntaxError(exec);
     368
     369        // This must be the ArrayBufferView case
     370        unsigned internalformat = exec->argument(2).toInt32(exec);
     371        if (exec->hadException())   
     372            return jsUndefined();
     373
     374        unsigned width = exec->argument(3).toInt32(exec);
     375        if (exec->hadException())   
     376            return jsUndefined();
     377
     378        unsigned height = exec->argument(4).toInt32(exec);
     379        if (exec->hadException())   
     380            return jsUndefined();
     381
     382        unsigned border = exec->argument(5).toInt32(exec);
     383        if (exec->hadException())   
     384            return jsUndefined();
     385
     386        unsigned format = exec->argument(6).toInt32(exec);
     387        if (exec->hadException())   
     388            return jsUndefined();
     389
     390        unsigned type = exec->argument(7).toInt32(exec);
     391        if (exec->hadException())   
     392            return jsUndefined();
     393
     394        JSValue value = exec->argument(8);
     395           
     396        // For this case passing 0 (for a null array) is allowed
     397        if (value.isNull())
     398            context->texImage2D(target, level, internalformat, width, height, border, format, type, 0, ec);
     399        else if (value.isObject()) {
     400            o = asObject(value);
     401           
     402            if (o->inherits(&JSArrayBufferView::s_info)) {
     403                // FIXME: Need to check to make sure ArrayBufferView is a Int8Array or Int16Array,
     404                // depending on the passed type parameter.
     405                ArrayBufferView* obj = static_cast<ArrayBufferView*>(static_cast<JSArrayBufferView*>(o)->impl());
     406                context->texImage2D(target, level, internalformat, width, height, border, format, type, obj, ec);
     407            } else
     408                return throwTypeError(exec);
     409        } else
     410            return throwTypeError(exec);
     411    }
     412   
     413    setDOMException(exec, ec);
     414    return jsUndefined();   
     415}
     416
     417//   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in GLsizei width, in GLsizei height, in GLenum format, in GLenum type, in ArrayBufferView pixels);
     418//   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in ImageData pixels, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
     419//   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLImageElement image, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
     420//   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLCanvasElement canvas, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
     421//   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLVideoElement video, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
     422JSValue JSWebGLRenderingContext::texSubImage2D(ExecState* exec)
     423{
     424    if (exec->argumentCount() < 5 || exec->argumentCount() > 9)
     425        return throwSyntaxError(exec);
     426
     427    ExceptionCode ec = 0;
     428
     429    WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());   
     430    unsigned target = exec->argument(0).toInt32(exec);
     431    if (exec->hadException())   
     432        return jsUndefined();
     433
     434    unsigned level = exec->argument(1).toInt32(exec);
     435    if (exec->hadException())   
     436        return jsUndefined();
     437   
     438    unsigned xoff = exec->argument(2).toInt32(exec);
     439    if (exec->hadException())   
     440        return jsUndefined();
     441   
     442    unsigned yoff = exec->argument(3).toInt32(exec);
     443    if (exec->hadException())   
     444        return jsUndefined();
     445   
     446    JSObject* o = 0;
     447       
     448    if (exec->argumentCount() <= 7) {
     449        // This is one of the last 4 forms. Param 4 can be <img>, <canvas> or <video> element, of the format param.
     450        JSValue value = exec->argument(4);
     451
     452        if (!value.isObject())
     453            return throwSyntaxError(exec);
     454
     455        o = asObject(value);
     456
     457        bool flipY = exec->argument(5).toBoolean(exec);
     458        bool premultiplyAlpha = exec->argument(6).toBoolean(exec);
     459       
     460        if (o->inherits(&JSImageData::s_info)) {
     461            ImageData* data = static_cast<ImageData*>(static_cast<JSImageData*>(o)->impl());
     462            context->texSubImage2D(target, level, xoff, yoff, data, flipY, premultiplyAlpha, ec);
     463        } else if (o->inherits(&JSHTMLImageElement::s_info)) {
     464            HTMLImageElement* element = static_cast<HTMLImageElement*>(static_cast<JSHTMLImageElement*>(o)->impl());
     465            context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec);
     466        } else if (o->inherits(&JSHTMLCanvasElement::s_info)) {
     467            HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(static_cast<JSHTMLCanvasElement*>(o)->impl());
     468            context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec);
     469#if ENABLE(VIDEO)
     470        } else if (o->inherits(&JSHTMLVideoElement::s_info)) {
     471            HTMLVideoElement* element = static_cast<HTMLVideoElement*>(static_cast<JSHTMLVideoElement*>(o)->impl());
     472            context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec);
     473#endif
     474        } else
     475            ec = TYPE_MISMATCH_ERR;
     476    } else {
     477        // This must be the ArrayBufferView form
     478        if (exec->argumentCount() != 9)
     479            return throwSyntaxError(exec);
     480
     481        unsigned width = exec->argument(4).toInt32(exec);
     482        if (exec->hadException())   
     483            return jsUndefined();
     484       
     485        unsigned height = exec->argument(5).toInt32(exec);
     486        if (exec->hadException())   
     487            return jsUndefined();
     488       
     489        unsigned format = exec->argument(6).toInt32(exec);
     490        if (exec->hadException())   
     491            return jsUndefined();
     492       
     493        unsigned type = exec->argument(7).toInt32(exec);
     494        if (exec->hadException())   
     495            return jsUndefined();
     496       
     497        JSValue value = exec->argument(8);
     498        if (!value.isObject())
     499            context->texSubImage2D(target, level, xoff, yoff, width, height, format, type, 0, ec);
     500        else {
     501            o = asObject(value);
     502       
     503            if (o->inherits(&JSArrayBufferView::s_info)) {
     504                ArrayBufferView* obj = static_cast<ArrayBufferView*>(static_cast<JSArrayBufferView*>(o)->impl());
     505                context->texSubImage2D(target, level, xoff, yoff, width, height, format, type, obj, ec);
     506            } else
     507                return throwTypeError(exec);
     508        }
     509    }
     510   
     511    setDOMException(exec, ec);
     512    return jsUndefined();
     513}
     514
    275515template<typename T, size_t inlineCapacity>
    276516bool toVector(JSC::ExecState* exec, JSC::JSValue value, Vector<T, inlineCapacity>& vector)
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r60979 r60980  
    11161116        # be converted to a string via .toString).
    11171117        push(@andExpression, "(${value}.isNull() || ${value}.isUndefined() || ${value}.isString() || ${value}.isObject())") if $codeGenerator->IsStringType($type);
    1118         push(@andExpression, "(${value}.isNull() || ${value}.isObject() && asObject(${value})->inherits(&JS${type}::s_info))") unless IsNativeType($type);
     1118        push(@andExpression, "(${value}.isNull() || asObject(${value})->inherits(&JS${type}::s_info))") unless IsNativeType($type);
    11191119
    11201120        $parameterIndex++;
     
    17871787                # Append a number to an overloaded method's name to make it unique:
    17881788                $functionName = $functionName . $function->{overloadIndex};
    1789                 # Make this function static to avoid compiler warnings, since we
    1790                 # don't generate a prototype for it in the header.
    1791                 push(@implContent, "static ");
    17921789            }
    17931790           
  • trunk/WebCore/html/HTMLCanvasElement.idl

    r60979 r60980  
    2828
    2929    interface [
    30         CustomMarkFunction,
    31         GenerateNativeConverter
     30        CustomMarkFunction
    3231    ] HTMLCanvasElement : HTMLElement {
    3332
  • trunk/WebCore/html/HTMLImageElement.idl

    r60979 r60980  
    2121module html {
    2222
    23     interface [
    24         GenerateNativeConverter
    25     ] HTMLImageElement : HTMLElement {
     23    interface HTMLImageElement : HTMLElement {
    2624                 attribute [ConvertNullToNullString, Reflect] DOMString name;
    2725                 attribute [ConvertNullToNullString, Reflect] DOMString align;
  • trunk/WebCore/html/HTMLVideoElement.idl

    r60979 r60980  
    2525
    2626module html {
    27     interface [
    28         Conditional=VIDEO,
    29         GenerateNativeConverter
    30     ] HTMLVideoElement : HTMLMediaElement {
     27    interface [Conditional=VIDEO] HTMLVideoElement : HTMLMediaElement {
    3128        attribute unsigned long width;
    3229        attribute unsigned long height;
  • trunk/WebCore/html/canvas/WebGLRenderingContext.idl

    r60979 r60980  
    475475        void         blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha);
    476476
     477#if defined(V8_BINDING) && V8_BINDING
    477478        void         bufferData(in unsigned long target, in ArrayBufferView data, in unsigned long usage) raises (DOMException);
    478479        void         bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException);
    479480        void         bufferSubData(in unsigned long target, in long offset, in ArrayBufferView data) raises (DOMException);
     481#else
     482        // FIXME: Unfork once JSC supports overload generation too.
     483        [Custom] void bufferData() raises(DOMException);
     484        [Custom] void bufferSubData() raises(DOMException);
     485#endif
    480486
    481487        unsigned long checkFramebufferStatus(in unsigned long target);
     
    608614
    609615        // Supported forms:
     616#if defined(V8_BINDING) && V8_BINDING
    610617        void         texImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long width, in long height,
    611618                                in long border, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises (DOMException);
     
    630637        void         texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
    631638                                   in HTMLVideoElement video, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
    632 
     639#else
     640        // FIXME: Unfork once JSC supports overload generation too.
     641        [Custom] void texImage2D();
     642        [Custom] void texSubImage2D();
     643#endif
    633644        void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException);
    634645        [Custom] void uniform1fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
Note: See TracChangeset for help on using the changeset viewer.