Changeset 58161 in webkit


Ignore:
Timestamp:
Apr 23, 2010 2:42:01 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-23 Yaar Schnitman <yaar@chromium.org>

Reviewed by Adam Barth.

Auto-generate WebGLRenderingContext overloads in V8
https://bugs.webkit.org/show_bug.cgi?id=37818

  • fast/canvas/webgl/script-tests/texImageTest.js: Test was wrong: Passing 0 value for a WebGLArray argument in texImage2D should throw the same exception as when passed to textSubImage2D.
  • platform/chromium-mac/fast/canvas/webgl/texImageTest-expected.txt:
  • fast/canvas/webgl/texImageTest-expected.txt: Changes to reflect test.

2010-04-23 Yaar Schnitman <yaar@chromium.org>

Reviewed by Adam Barth.

Auto-generate WebGLRenderingContext overloads in V8
https://bugs.webkit.org/show_bug.cgi?id=37818

  • bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
  • html/canvas/WebGLRenderingContext.cpp: Added missing overloads for the following:. (WebCore::WebGLRenderingContext::texImage2D) (WebCore::WebGLRenderingContext::texSubImage2D)
  • html/canvas/WebGLRenderingContext.h: Added missing overloads.
  • html/canvas/WebGLRenderingContext.idl: IDL definition of overloads.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r58159 r58161  
     12010-04-23  Yaar Schnitman  <yaar@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Auto-generate WebGLRenderingContext overloads in V8
     6        https://bugs.webkit.org/show_bug.cgi?id=37818
     7
     8        * fast/canvas/webgl/script-tests/texImageTest.js: Test was wrong: Passing 0 value for a WebGLArray argument in texImage2D should throw the same exception as when passed to textSubImage2D.
     9        * platform/chromium-mac/fast/canvas/webgl/texImageTest-expected.txt:
     10        * fast/canvas/webgl/texImageTest-expected.txt: Changes to reflect test.
     11
    1122010-04-23  Yuzo Fujishima  <yuzo@google.com>
    213
  • trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js

    r52835 r58161  
    1919
    2020shouldThrow("context.texSubImage2D(context.TEXTURE_2D)");
    21 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)");
     21shouldBeUndefined("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
     23shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)");
    2224shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0)");
    2325shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, imageData, false)");
  • trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt

    r52835 r58161  
    1212PASS context.texImage2D(context.TEXTURE_2D, 0, video, true, false) is undefined.
    1313PASS context.texSubImage2D(context.TEXTURE_2D) threw exception SyntaxError: Syntax error.
    14 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) is undefined.
     14PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined.
     15FAIL context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) should throw an exception. Was undefined.
    1516PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception SyntaxError: Syntax error.
    1617PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, imageData, false) is undefined.
  • trunk/LayoutTests/platform/chromium-mac/fast/canvas/webgl/texImageTest-expected.txt

    r56251 r58161  
    1212PASS context.texImage2D(context.TEXTURE_2D, 0, video, true, false) is undefined.
    1313PASS context.texSubImage2D(context.TEXTURE_2D) threw exception Error: SYNTAX_ERR: DOM Exception 12.
    14 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) is undefined.
     14PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined.
     15PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception Error: SYNTAX_ERR: DOM Exception 12.
    1516PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception Error: SYNTAX_ERR: DOM Exception 12.
    1617PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, imageData, false) is undefined.
  • trunk/WebCore/ChangeLog

    r58160 r58161  
     12010-04-23  Yaar Schnitman  <yaar@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Auto-generate WebGLRenderingContext overloads in V8
     6        https://bugs.webkit.org/show_bug.cgi?id=37818
     7
     8        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
     9        * html/canvas/WebGLRenderingContext.cpp: Added missing overloads for the following:.
     10        (WebCore::WebGLRenderingContext::texImage2D)
     11        (WebCore::WebGLRenderingContext::texSubImage2D)
     12        * html/canvas/WebGLRenderingContext.h: Added missing overloads.
     13        * html/canvas/WebGLRenderingContext.idl: IDL definition of overloads.
     14
    1152010-04-23  Jeff Schiller  <codedread@gmail.com>
    216
  • trunk/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp

    r57049 r58161  
    104104    }
    105105    return data;
    106 }
    107 
    108 v8::Handle<v8::Value> V8WebGLRenderingContext::bufferDataCallback(const v8::Arguments& args)
    109 {
    110     INC_STATS("DOM.WebGLRenderingContext.bufferData()");
    111 
    112     // Forms:
    113     // * bufferData(GLenum target, WebGLArray data, GLenum usage);
    114     //   - Sets the buffer's data from the given WebGLArray
    115     // * bufferData(GLenum target, GLsizeiptr size, GLenum usage);
    116     //   - Sets the size of the buffer to the given size in bytes
    117     if (args.Length() != 3) {
    118         V8Proxy::setDOMException(SYNTAX_ERR);
    119         return notHandledByInterceptor();
    120     }
    121 
    122     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    123     bool ok;
    124     int target = toInt32(args[0], ok);
    125     if (!ok) {
    126         V8Proxy::setDOMException(SYNTAX_ERR);
    127         return notHandledByInterceptor();
    128     }
    129     int usage = toInt32(args[2], ok);
    130     if (!ok) {
    131         V8Proxy::setDOMException(SYNTAX_ERR);
    132         return notHandledByInterceptor();
    133     }
    134     if (args[1]->IsInt32()) {
    135         int size = toInt32(args[1]);
    136         ExceptionCode exceptionCode;
    137         context->bufferData(target, size, usage, exceptionCode);
    138     } else if (V8WebGLArray::HasInstance(args[1])) {
    139         WebGLArray* array = V8WebGLArray::toNative(args[1]->ToObject());
    140         ExceptionCode exceptionCode;
    141         context->bufferData(target, array, usage, exceptionCode);
    142     } else {
    143         V8Proxy::setDOMException(SYNTAX_ERR);
    144         return notHandledByInterceptor();
    145     }
    146     return v8::Undefined();
    147 }
    148 
    149 v8::Handle<v8::Value> V8WebGLRenderingContext::bufferSubDataCallback(const v8::Arguments& args)
    150 {
    151     INC_STATS("DOM.WebGLRenderingContext.bufferSubData()");
    152 
    153     // Forms:
    154     // * bufferSubData(GLenum target, GLintptr offset, WebGLArray data);
    155     if (args.Length() != 3) {
    156         V8Proxy::setDOMException(SYNTAX_ERR);
    157         return notHandledByInterceptor();
    158     }
    159 
    160     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    161     bool ok;
    162     int target = toInt32(args[0], ok);
    163     if (!ok) {
    164         V8Proxy::setDOMException(SYNTAX_ERR);
    165         return notHandledByInterceptor();
    166     }
    167     int offset = toInt32(args[1], ok);
    168     if (!ok) {
    169         V8Proxy::setDOMException(SYNTAX_ERR);
    170         return notHandledByInterceptor();
    171     }
    172     if (!V8WebGLArray::HasInstance(args[2])) {
    173         V8Proxy::setDOMException(SYNTAX_ERR);
    174         return notHandledByInterceptor();
    175     }
    176     WebGLArray* array = V8WebGLArray::toNative(args[2]->ToObject());
    177     ExceptionCode exceptionCode;
    178     context->bufferSubData(target, offset, array, exceptionCode);
    179     return v8::Undefined();
    180106}
    181107
     
    444370}
    445371
    446 v8::Handle<v8::Value> V8WebGLRenderingContext::texImage2DCallback(const v8::Arguments& args)
    447 {
    448     INC_STATS("DOM.WebGLRenderingContext.texImage2D()");
    449 
    450     // Currently supported forms:
    451     // * void texImage2D(in GLenum target, in GLint level,
    452     //                   in GLint internalformat,
    453     //                   in GLsizei width, in GLsizei height, in GLint border,
    454     //                   in GLenum format, in GLenum type, in WebGLArray pixels);
    455     // * void texImage2D(in GLenum target, in GLint level, in ImageData pixels,
    456     //                   [Optional] in GLboolean flipY, [Optional] in GLboolean premulitplyAlpha);
    457     // * void texImage2D(in GLenum target, in GLint level, in HTMLImageElement image,
    458     //                   [Optional] in GLboolean flipY, [Optional] in GLboolean premultiplyAlpha);
    459     // * void texImage2D(in GLenum target, in GLint level, in HTMLCanvasElement image,
    460     //                   [Optional] in GLboolean flipY, [Optional] in GLboolean premultiplyAlpha);
    461     // * void texImage2D(in GLenum target, in GLint level, in HTMLVideoElement image,
    462     //                   [Optional] in GLboolean flipY, [Optional] in GLboolean premultiplyAlpha);
    463     if (args.Length() != 3 &&
    464         args.Length() != 4 &&
    465         args.Length() != 5 &&
    466         args.Length() != 9) {
    467         V8Proxy::setDOMException(SYNTAX_ERR);
    468         return notHandledByInterceptor();
    469     }
    470 
    471     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    472     bool ok;
    473     int target = toInt32(args[0], ok);
    474     if (!ok) {
    475         V8Proxy::setDOMException(SYNTAX_ERR);
    476         return notHandledByInterceptor();
    477     }
    478     int level = toInt32(args[1], ok);
    479     if (!ok) {
    480         V8Proxy::setDOMException(SYNTAX_ERR);
    481         return notHandledByInterceptor();
    482     }
    483 
    484     ExceptionCode ec = 0;
    485     if (args.Length() == 3 ||
    486         args.Length() == 4 ||
    487         args.Length() == 5) {
    488         bool flipY = false;
    489         bool premultiplyAlpha = false;
    490         if (args.Length() >= 4)
    491             flipY = args[3]->BooleanValue();
    492         if (args.Length() >= 5)
    493             premultiplyAlpha = args[4]->BooleanValue();
    494 
    495         v8::Handle<v8::Value> arg = args[2];
    496         if (V8HTMLImageElement::HasInstance(arg)) {
    497             HTMLImageElement* element = V8HTMLImageElement::toNative(v8::Handle<v8::Object>::Cast(arg));
    498             context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec);
    499         } else if (V8HTMLCanvasElement::HasInstance(arg)) {
    500             HTMLCanvasElement* element = V8HTMLCanvasElement::toNative(v8::Handle<v8::Object>::Cast(arg));
    501             context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec);
    502         } else if(V8ImageData::HasInstance(arg)) {
    503             ImageData* imageElement = V8ImageData::toNative(v8::Handle<v8::Object>::Cast(arg));
    504             context->texImage2D(target, level, imageElement, flipY, premultiplyAlpha, ec);
    505         } else if (V8HTMLVideoElement::HasInstance(arg)) {
    506             HTMLVideoElement* element = V8HTMLVideoElement::toNative(v8::Handle<v8::Object>::Cast(arg));
    507             context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec);
    508         }
    509         else {
    510             // FIXME: consider different / better exception type.
    511             V8Proxy::setDOMException(SYNTAX_ERR);
    512             return notHandledByInterceptor();
    513         }
    514         // Fall through
    515     } else if (args.Length() == 9) {
    516         int internalformat = toInt32(args[2], ok);
    517         if (!ok) {
    518             V8Proxy::setDOMException(SYNTAX_ERR);
    519             return notHandledByInterceptor();
    520         }
    521         int width = toInt32(args[3], ok);
    522         if (!ok) {
    523             V8Proxy::setDOMException(SYNTAX_ERR);
    524             return notHandledByInterceptor();
    525         }
    526         int height = toInt32(args[4], ok);
    527         if (!ok) {
    528             V8Proxy::setDOMException(SYNTAX_ERR);
    529             return notHandledByInterceptor();
    530         }
    531         int border = toInt32(args[5], ok);
    532         if (!ok) {
    533             V8Proxy::setDOMException(SYNTAX_ERR);
    534             return notHandledByInterceptor();
    535         }
    536         int format = toInt32(args[6], ok);
    537         if (!ok) {
    538             V8Proxy::setDOMException(SYNTAX_ERR);
    539             return notHandledByInterceptor();
    540         }
    541         int type = toInt32(args[7], ok);
    542         if (!ok) {
    543             V8Proxy::setDOMException(SYNTAX_ERR);
    544             return notHandledByInterceptor();
    545         }
    546         v8::Handle<v8::Value> arg = args[8];
    547         if (!arg->IsObject())
    548         // Assume that the user is passing null for texture
    549             context->texImage2D(target,
    550                                 level,
    551                                 internalformat,
    552                                 width,
    553                                 height,
    554                                 border,
    555                                 format,
    556                                 type,
    557                                 0,
    558                                 ec);
    559      else if (V8WebGLArray::HasInstance(arg)) {
    560             WebGLArray* array = V8WebGLArray::toNative(arg->ToObject());
    561             context->texImage2D(target,
    562                                 level,
    563                                 internalformat,
    564                                 width,
    565                                 height,
    566                                 border,
    567                                 format,
    568                                 type,
    569                                 array,
    570                                 ec);
    571             // Fall through
    572         } else {
    573             V8Proxy::setDOMException(SYNTAX_ERR);
    574             return notHandledByInterceptor();
    575         }
    576     } else {
    577         ASSERT_NOT_REACHED();
    578         V8Proxy::setDOMException(SYNTAX_ERR);
    579         return notHandledByInterceptor();
    580     }
    581     if (ec) {
    582         V8Proxy::setDOMException(ec);
    583         return v8::Handle<v8::Value>();
    584     }
    585     return v8::Undefined();
    586 }
    587 
    588 v8::Handle<v8::Value> V8WebGLRenderingContext::texSubImage2DCallback(const v8::Arguments& args)
    589 {
    590     INC_STATS("DOM.WebGLRenderingContext.texSubImage2D()");
    591 
    592     // Currently supported forms:
    593     // * void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    594     //                      in GLsizei width, in GLsizei height,
    595     //                      in GLenum format, in GLenum type, in WebGLArray pixels);
    596     // * void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    597     //                      in ImageData pixels, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    598     // * void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    599     //                      in HTMLImageElement image, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    600     // * void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    601     //                      in HTMLCanvasElement canvas, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    602     // * void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    603     //                      in HTMLVideoElement video, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    604 
    605     if (args.Length() != 5 &&
    606         args.Length() != 6 &&
    607         args.Length() != 7 &&
    608         args.Length() != 9) {
    609         V8Proxy::setDOMException(SYNTAX_ERR);
    610         return notHandledByInterceptor();
    611     }
    612 
    613     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    614     bool ok;
    615     int target = toInt32(args[0], ok);
    616     if (!ok) {
    617         V8Proxy::setDOMException(SYNTAX_ERR);
    618         return notHandledByInterceptor();
    619     }
    620     int level = toInt32(args[1], ok);
    621     if (!ok) {
    622         V8Proxy::setDOMException(SYNTAX_ERR);
    623         return notHandledByInterceptor();
    624     }
    625     int xoff = toInt32(args[2], ok);
    626     if (!ok) {
    627         V8Proxy::setDOMException(SYNTAX_ERR);
    628         return notHandledByInterceptor();
    629     }
    630     int yoff = toInt32(args[3], ok);
    631     if (!ok) {
    632         V8Proxy::setDOMException(SYNTAX_ERR);
    633         return notHandledByInterceptor();
    634     }
    635 
    636     ExceptionCode ec = 0;
    637     if (args.Length() == 5 ||
    638         args.Length() == 6 ||
    639         args.Length() == 7) {
    640         bool flipY = false;
    641         bool premultiplyAlpha = false;
    642         if (args.Length() >= 6)
    643             flipY = args[5]->BooleanValue();
    644         if (args.Length() >= 7)
    645             premultiplyAlpha = args[6]->BooleanValue();
    646 
    647         v8::Handle<v8::Value> arg = args[4];
    648         if (V8HTMLImageElement::HasInstance(arg)) {
    649             HTMLImageElement* element = V8HTMLImageElement::toNative(v8::Handle<v8::Object>::Cast(arg));
    650             context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec);
    651         } else if (V8HTMLCanvasElement::HasInstance(arg)) {
    652             HTMLCanvasElement* element = V8HTMLCanvasElement::toNative(v8::Handle<v8::Object>::Cast(arg));
    653             context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec);
    654         } else if(V8ImageData::HasInstance(arg)) {
    655             ImageData* imageElement = V8ImageData::toNative(v8::Handle<v8::Object>::Cast(arg));
    656             context->texSubImage2D(target, level, xoff, yoff, imageElement, flipY, premultiplyAlpha, ec);
    657         } else if (V8HTMLVideoElement::HasInstance(arg)) {
    658             HTMLVideoElement* element = V8HTMLVideoElement::toNative(v8::Handle<v8::Object>::Cast(arg));
    659             context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec);
    660         }
    661         else {
    662             // FIXME: consider different / better exception type.
    663             V8Proxy::setDOMException(SYNTAX_ERR);
    664             return notHandledByInterceptor();
    665         }
    666         // Fall through
    667     } else if (args.Length() == 9) {
    668         int width = toInt32(args[4], ok);
    669         if (!ok) {
    670             V8Proxy::setDOMException(SYNTAX_ERR);
    671             return notHandledByInterceptor();
    672         }
    673         int height = toInt32(args[5], ok);
    674         if (!ok) {
    675             V8Proxy::setDOMException(SYNTAX_ERR);
    676             return notHandledByInterceptor();
    677         }
    678         int format = toInt32(args[6], ok);
    679         if (!ok) {
    680             V8Proxy::setDOMException(SYNTAX_ERR);
    681             return notHandledByInterceptor();
    682         }
    683         int type = toInt32(args[7], ok);
    684         if (!ok) {
    685             V8Proxy::setDOMException(SYNTAX_ERR);
    686             return notHandledByInterceptor();
    687         }
    688         v8::Handle<v8::Value> arg = args[8];
    689         if (!arg->IsObject())
    690         // Assume that the user is passing null for texture
    691             context->texSubImage2D(target,
    692                                    level,
    693                                    xoff,
    694                                    yoff,
    695                                    width,
    696                                    height,
    697                                    format,
    698                                    type,
    699                                    0,
    700                                    ec);
    701      else if (V8WebGLArray::HasInstance(arg)) {
    702             WebGLArray* array = V8WebGLArray::toNative(arg->ToObject());
    703             context->texSubImage2D(target,
    704                                    level,
    705                                    xoff,
    706                                    yoff,
    707                                    width,
    708                                    height,
    709                                    format,
    710                                    type,
    711                                    array,
    712                                    ec);
    713             // Fall through
    714         } else {
    715             V8Proxy::setDOMException(SYNTAX_ERR);
    716             return notHandledByInterceptor();
    717         }
    718     } else {
    719         ASSERT_NOT_REACHED();
    720         V8Proxy::setDOMException(SYNTAX_ERR);
    721         return notHandledByInterceptor();
    722     }
    723     if (ec) {
    724         V8Proxy::setDOMException(ec);
    725         return v8::Handle<v8::Value>();
    726     }
    727     return v8::Undefined();
    728 }
    729 
    730372enum FunctionToCall {
    731373    kUniform1v, kUniform2v, kUniform3v, kUniform4v,
  • trunk/WebCore/html/canvas/WebGLRenderingContext.cpp

    r58140 r58161  
    17801780
    17811781void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageData* pixels,
     1782                                       ExceptionCode& ec)
     1783{
     1784    texImage2D(target, level, pixels, 0, 0, ec);
     1785}
     1786
     1787void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageData* pixels,
     1788                                       bool flipY, ExceptionCode& ec)
     1789{
     1790    texImage2D(target, level, pixels, flipY, 0, ec);
     1791}
     1792
     1793void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageData* pixels,
    17821794                                       bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
    17831795{
     
    17901802}
    17911803
     1804
     1805void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
     1806                                       ExceptionCode& ec)
     1807{
     1808    texImage2D(target, level, image, 0, 0, ec);
     1809}
     1810
     1811void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
     1812                                       bool flipY, ExceptionCode& ec)
     1813{
     1814    texImage2D(target, level, image, flipY, 0, ec);
     1815}
     1816
    17921817void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
    17931818                                       bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
     
    18111836
    18121837void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
    1813                                           bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
     1838                                       ExceptionCode& ec)
     1839{
     1840    texImage2D(target, level, canvas, 0, 0, ec);
     1841}
     1842
     1843void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
     1844                                       bool flipY, ExceptionCode& ec)
     1845{
     1846    texImage2D(target, level, canvas, flipY, 0, ec);
     1847}
     1848
     1849void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
     1850                                       bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
    18141851{
    18151852    ec = 0;
     
    18311868
    18321869void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
    1833                                           bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
     1870                                       ExceptionCode& ec)
     1871{
     1872    texImage2D(target, level, video, 0, 0, ec);
     1873}
     1874
     1875void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
     1876                                       bool flipY, ExceptionCode& ec)
     1877{
     1878    texImage2D(target, level, video, flipY, 0, ec);
     1879}
     1880
     1881void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
     1882                                       bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
    18341883{
    18351884    // FIXME: Need implement this call
     
    18571906
    18581907void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    1859                                              unsigned width, unsigned height,
    1860                                              unsigned format, unsigned type, WebGLArray* pixels, ExceptionCode& ec)
     1908                                          unsigned width, unsigned height,
     1909                                          unsigned format, unsigned type, WebGLArray* pixels, ExceptionCode& ec)
    18611910{
    18621911    // FIXME: For now we ignore any errors returned
     
    18651914    m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels ? pixels->baseAddress() : 0);
    18661915    cleanupAfterGraphicsCall(false);
     1916}
     1917
     1918void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     1919                                          ImageData* pixels, ExceptionCode& ec)
     1920{
     1921    texSubImage2D(target, level, xoffset, yoffset, pixels, 0, 0, ec);
     1922}
     1923
     1924void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     1925                                          ImageData* pixels, bool flipY, ExceptionCode& ec)
     1926{
     1927    texSubImage2D(target, level, xoffset, yoffset, pixels, flipY, 0, ec);
    18671928}
    18681929
     
    18791940
    18801941void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     1942                                          HTMLImageElement* image, ExceptionCode& ec)
     1943{
     1944    texSubImage2D(target, level, xoffset, yoffset, image, 0, 0, ec);
     1945}
     1946
     1947void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     1948                                          HTMLImageElement* image, bool flipY, ExceptionCode& ec)
     1949{
     1950    texSubImage2D(target, level, xoffset, yoffset, image, flipY, 0, ec);
     1951}
     1952
     1953void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    18811954                                          HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
    18821955{
     
    18991972
    19001973void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     1974                                          HTMLCanvasElement* canvas, ExceptionCode& ec)
     1975{
     1976    texSubImage2D(target, level, xoffset, yoffset, canvas, 0, 0, ec);
     1977}
     1978
     1979void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     1980                                          HTMLCanvasElement* canvas, bool flipY, ExceptionCode& ec)
     1981{
     1982    texSubImage2D(target, level, xoffset, yoffset, canvas, flipY, 0, ec);
     1983}
     1984
     1985void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    19011986                                          HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
    19021987{
     
    19162001    m_context->texSubImage2D(target, level, xoffset, yoffset, buffer->image(), flipY, premultiplyAlpha);
    19172002    cleanupAfterGraphicsCall(false);
     2003}
     2004
     2005void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     2006                                          HTMLVideoElement* video, ExceptionCode& ec)
     2007{
     2008    texSubImage2D(target, level, xoffset, yoffset, video, 0, 0, ec);
     2009}
     2010
     2011void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
     2012                                          HTMLVideoElement* video, bool flipY, ExceptionCode& ec)
     2013{
     2014    texSubImage2D(target, level, xoffset, yoffset, video, flipY, 0, ec);
    19182015}
    19192016
  • trunk/WebCore/html/canvas/WebGLRenderingContext.h

    r58140 r58161  
    200200                        unsigned width, unsigned height, unsigned border,
    201201                        unsigned format, unsigned type, WebGLArray* pixels, ExceptionCode&);
    202         void texImage2D(unsigned target, unsigned level, ImageData* pixels,
    203                         bool flipY, bool premultiplyAlpha, ExceptionCode&);
    204         void texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
    205                         bool flipY, bool premultiplyAlpha, ExceptionCode&);
    206         void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
    207                         bool flipY, bool premultiplyAlpha, ExceptionCode&);
    208         void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
    209                         bool flipY, bool premultiplyAlpha, ExceptionCode&);
     202        void texImage2D(unsigned target, unsigned level, ImageData* pixels, ExceptionCode&);
     203        void texImage2D(unsigned target, unsigned level, ImageData* pixels, bool flipY, ExceptionCode&);
     204        void texImage2D(unsigned target, unsigned level, ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     205        void texImage2D(unsigned target, unsigned level, HTMLImageElement* image, ExceptionCode&);
     206        void texImage2D(unsigned target, unsigned level, HTMLImageElement* image, bool flipY, ExceptionCode&);
     207        void texImage2D(unsigned target, unsigned level, HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     208        void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas, ExceptionCode&);
     209        void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas, bool flipY, ExceptionCode&);
     210        void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     211        void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video, ExceptionCode&);
     212        void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video, bool flipY, ExceptionCode&);
     213        void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video, bool flipY, bool premultiplyAlpha, ExceptionCode&);
    210214
    211215        void texParameterf(unsigned target, unsigned pname, float param);
     
    215219                           unsigned width, unsigned height,
    216220                           unsigned format, unsigned type, WebGLArray* pixels, ExceptionCode&);
    217         void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    218                            ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode&);
    219         void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    220                            HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
    221         void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    222                            HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode&);
    223         void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
    224                            HTMLVideoElement* video, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     221        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, ImageData* pixels, ExceptionCode&);
     222        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, ImageData* pixels, bool flipY, ExceptionCode&);
     223        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     224        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLImageElement* image, ExceptionCode&);
     225        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLImageElement* image, bool flipY, ExceptionCode&);
     226        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     227        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLCanvasElement* canvas, ExceptionCode&);
     228        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLCanvasElement* canvas, bool flipY, ExceptionCode&);
     229        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode&);
     230        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLVideoElement* video, ExceptionCode&);
     231        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLVideoElement* video, bool flipY, ExceptionCode&);
     232        void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLVideoElement* video, bool flipY, bool premultiplyAlpha, ExceptionCode&);
    225233
    226234        void uniform1f(const WebGLUniformLocation* location, float x, ExceptionCode&);
  • trunk/WebCore/html/canvas/WebGLRenderingContext.idl

    r57214 r58161  
    475475        void         blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha);
    476476
    477         // Supported forms:
    478         //   void bufferData (in GLenum target, in GLsizei size, in GLenum usage);
    479         //   void bufferData (in GLenum target, in WebGLArray data, in GLenum usage);
     477#if defined(V8_BINDING) && V8_BINDING
     478        void         bufferData(in unsigned long target, in WebGLArray data, in unsigned long usage) raises (DOMException);
     479        void         bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException);
     480        void         bufferSubData(in unsigned long target, in long offset, in WebGLArray data) raises (DOMException);
     481#else
     482        // FIXME: Unfork once JSC supports overload generation too.
    480483        [Custom] void bufferData() raises(DOMException);
    481         // Supported forms:
    482         //   void bufferSubData (in GLenum target, in GLsizeiptr offset, in WebGLArray data);
    483484        [Custom] void bufferSubData() raises(DOMException);
     485#endif
    484486
    485487        unsigned long checkFramebufferStatus(in unsigned long target);
     
    612614
    613615        // Supported forms:
    614         //   void texImage2D(in GLenum target, in GLint level, in GLenum internalformat, in GLsizei width, in GLsizei height,
    615         //                   in GLint border, in GLenum format, in GLenum type, in WebGLArray pixels);
    616         //   void texImage2D(in GLenum target, in GLint level, in ImageData pixels,
    617         //                   [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
    618         //   void texImage2D(in GLenum target, in GLint level, in HTMLImageElement image,
    619         //                   [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
    620         //   void texImage2D(in GLenum target, in GLint level, in HTMLCanvasElement canvas,
    621         //                   [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
    622         //   void texImage2D(in GLenum target, in GLint level, in HTMLVideoElement video,
    623         //                   [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha);
     616#if defined(V8_BINDING) && V8_BINDING
     617        void         texImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long width, in long height,
     618                                in long border, in unsigned long format, in unsigned long type, in WebGLArray pixels) raises (DOMException);
     619        void         texImage2D(in unsigned long target, in long level, in ImageData pixels,
     620                                in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     621        void         texImage2D(in unsigned long target, in long level, in HTMLImageElement image,
     622                                in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     623        void         texImage2D(in unsigned long target, in long level, in HTMLCanvasElement canvas,
     624                                in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     625        void         texImage2D(in unsigned long target, in long level, in HTMLVideoElement video,
     626                                in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     627
     628        void         texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
     629                                   in long width, in long height,
     630                                   in unsigned long format, in unsigned long type, in WebGLArray pixels) raises (DOMException);
     631        void         texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
     632                                   in ImageData pixels, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     633        void         texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
     634                                   in HTMLImageElement image, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     635        void         texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
     636                                   in HTMLCanvasElement canvas, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     637        void         texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
     638                                   in HTMLVideoElement video, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
     639#else
     640        // FIXME: Unfork once JSC supports overload generation too.
    624641        [Custom] void texImage2D();
    625 
    626         // Supported forms:
    627         //   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    628         //                      in GLsizei width, in GLsizei height,
    629         //                      in GLenum format, in GLenum type, in WebGLArray pixels);
    630         //   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    631         //                      in ImageData pixels, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    632         //   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    633         //                      in HTMLImageElement image, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    634         //   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    635         //                      in HTMLCanvasElement canvas, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    636         //   void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset,
    637         //                      in HTMLVideoElement video, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha);
    638642        [Custom] void texSubImage2D();
    639 
     643#endif
    640644        void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException);
    641645        [Custom] void uniform1fv(in WebGLUniformLocation location, in WebGLFloatArray v) raises(DOMException);
Note: See TracChangeset for help on using the changeset viewer.