Changeset 105705 in webkit


Ignore:
Timestamp:
Jan 24, 2012 12:54:47 AM (12 years ago)
Author:
bashi@chromium.org
Message:

[V8] Add Uint8ClampedArray support
https://bugs.webkit.org/show_bug.cgi?id=76803

Reviewed by Kenneth Russell.

Source/JavaScriptCore:

  • wtf/ArrayBufferView.h:

(WTF::ArrayBufferView::isUnsignedByteClampedArray): Added.

  • wtf/Uint8ClampedArray.h:

(WTF::Uint8ClampedArray::isUnsignedByteClampedArray): Overridden to return true.

Source/WebCore:

No new tests. fast/js/script-tests/dfg-uint8clampedarray.js should pass on chromium port.

  • WebCore.gypi: Added required files.
  • bindings/scripts/CodeGeneratorV8.pm:

(IsTypedArrayType): Added Uint8ClampedArray.

  • bindings/v8/SerializedScriptValue.cpp: Added the tag for Uint8ClampedArray.

(WebCore::V8ObjectMap::Writer::writeArrayBufferView): Appends the tag when buffer is Uint8ClampedArray.
(WebCore::V8ObjectMap::Reader::readArrayBufferView): Creates Uint8ClampedArray instance when the tag represents Uint8ClampedArray.

  • bindings/v8/custom/V8ArrayBufferViewCustomScript.js:
  • bindings/v8/custom/V8Uint8ClampedArrayCustom.cpp: Added.

(WebCore::V8Uint8ClampedArray::constructorCallback):
(WebCore::V8Uint8ClampedArray::setCallback):
(WebCore::toV8):

  • page/Crypto.cpp: Added isUnsignedByteClampedArray() call to isIntegerArray().
  • page/DOMWindow.idl: Removed ifdefs.
  • workers/WorkerContext.idl: Added Uint8ArrayConstructor.

LayoutTests:

  • platform/chromium/fast/canvas/webgl/array-unit-tests-expected.txt: Removed.
  • platform/chromium/test_expectations.txt: Removed fast/js/dfg-uint8clampedarray.html.
Location:
trunk
Files:
1 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r105701 r105705  
     12012-01-24  Kenichi Ishibashi  <bashi@chromium.org>
     2
     3        [V8] Add Uint8ClampedArray support
     4        https://bugs.webkit.org/show_bug.cgi?id=76803
     5
     6        Reviewed by Kenneth Russell.
     7
     8        * platform/chromium/fast/canvas/webgl/array-unit-tests-expected.txt: Removed.
     9        * platform/chromium/test_expectations.txt: Removed fast/js/dfg-uint8clampedarray.html.
     10
    1112012-01-23  Csaba Osztrogonác  <ossy@webkit.org>
    212
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r105691 r105705  
    38783878BUGWK65711 : svg/text/append-text-node-to-tspan.html = IMAGE+TEXT IMAGE
    38793879
    3880 // Uint8ClampedArray still not implemented.
    3881 BUGWK74455 : fast/js/dfg-uint8clampedarray.html = TEXT
    3882 
    38833880// Needs baseline
    38843881BUGWK76118 : fast/css/text-overflow-input.html = MISSING
  • trunk/Source/JavaScriptCore/ChangeLog

    r105704 r105705  
     12012-01-24  Kenichi Ishibashi  <bashi@chromium.org>
     2
     3        [V8] Add Uint8ClampedArray support
     4        https://bugs.webkit.org/show_bug.cgi?id=76803
     5
     6        Reviewed by Kenneth Russell.
     7
     8        * wtf/ArrayBufferView.h:
     9        (WTF::ArrayBufferView::isUnsignedByteClampedArray): Added.
     10        * wtf/Uint8ClampedArray.h:
     11        (WTF::Uint8ClampedArray::isUnsignedByteClampedArray): Overridden to return true.
     12
    1132012-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/Source/JavaScriptCore/wtf/ArrayBufferView.h

    r104900 r105705  
    4141    virtual bool isByteArray() const { return false; }
    4242    virtual bool isUnsignedByteArray() const { return false; }
     43    virtual bool isUnsignedByteClampedArray() const { return false; }
    4344    virtual bool isShortArray() const { return false; }
    4445    virtual bool isUnsignedShortArray() const { return false; }
  • trunk/Source/JavaScriptCore/wtf/Uint8ClampedArray.h

    r105217 r105705  
    5252    // Make constructor visible to superclass.
    5353    friend class TypedArrayBase<unsigned char>;
     54
     55    // Overridden from ArrayBufferView.
     56    virtual bool isUnsignedByteClampedArray() const { return true; }
    5457};
    5558
  • trunk/Source/WebCore/ChangeLog

    r105703 r105705  
     12012-01-24  Kenichi Ishibashi  <bashi@chromium.org>
     2
     3        [V8] Add Uint8ClampedArray support
     4        https://bugs.webkit.org/show_bug.cgi?id=76803
     5
     6        Reviewed by Kenneth Russell.
     7
     8        No new tests. fast/js/script-tests/dfg-uint8clampedarray.js should pass on chromium port.
     9
     10        * WebCore.gypi: Added required files.
     11        * bindings/scripts/CodeGeneratorV8.pm:
     12        (IsTypedArrayType): Added Uint8ClampedArray.
     13        * bindings/v8/SerializedScriptValue.cpp: Added the tag for Uint8ClampedArray.
     14        (WebCore::V8ObjectMap::Writer::writeArrayBufferView): Appends the tag when buffer is Uint8ClampedArray.
     15        (WebCore::V8ObjectMap::Reader::readArrayBufferView): Creates Uint8ClampedArray instance when the tag represents Uint8ClampedArray.
     16        * bindings/v8/custom/V8ArrayBufferViewCustomScript.js:
     17        * bindings/v8/custom/V8Uint8ClampedArrayCustom.cpp: Added.
     18        (WebCore::V8Uint8ClampedArray::constructorCallback):
     19        (WebCore::V8Uint8ClampedArray::setCallback):
     20        (WebCore::toV8):
     21        * page/Crypto.cpp: Added isUnsignedByteClampedArray() call to isIntegerArray().
     22        * page/DOMWindow.idl: Removed ifdefs.
     23        * workers/WorkerContext.idl: Added Uint8ArrayConstructor.
     24
    1252012-01-24  Ilya Tikhonovsky  <loislo@chromium.org>
    226
  • trunk/Source/WebCore/WebCore.gypi

    r105700 r105705  
    962962            'html/canvas/Uint32Array.idl',
    963963            'html/canvas/Uint8Array.idl',
     964            'html/canvas/Uint8ClampedArray.idl',
    964965            'html/canvas/WebGLActiveInfo.idl',
    965966            'html/canvas/WebGLBuffer.idl',
     
    18741875            'bindings/v8/custom/V8Uint32ArrayCustom.cpp',
    18751876            'bindings/v8/custom/V8Uint8ArrayCustom.cpp',
     1877            'bindings/v8/custom/V8Uint8ClampedArrayCustom.cpp',
    18761878            'bindings/v8/custom/V8WebGLRenderingContextCustom.cpp',
    18771879            'bindings/v8/custom/V8WebKitAnimationCustom.cpp',
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r105308 r105705  
    22442244    my $type = shift;
    22452245    return 1 if (($type eq "ArrayBuffer") or ($type eq "ArrayBufferView"));
    2246     return 1 if (($type eq "Uint8Array") or ($type eq "Uint16Array") or ($type eq "Uint32Array"));
     2246    return 1 if (($type eq "Uint8Array") or ($type eq "Uint8ClampedArray") or ($type eq "Uint16Array") or ($type eq "Uint32Array"));
    22472247    return 1 if (($type eq "Int8Array") or ($type eq "Int16Array") or ($type eq "Int32Array"));
    22482248    return 1 if (($type eq "Float32Array") or ($type eq "Float64Array"));
  • trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp

    r103100 r105705  
    5252#include "Uint32Array.h"
    5353#include "Uint8Array.h"
     54#include "Uint8ClampedArray.h"
    5455#include "V8ArrayBuffer.h"
    5556#include "V8ArrayBufferView.h"
     
    7071#include "V8Uint32Array.h"
    7172#include "V8Uint8Array.h"
     73#include "V8Uint8ClampedArray.h"
    7274#include "V8Utilities.h"
    7375
     
    215217    ByteArrayTag = 'b',
    216218    UnsignedByteArrayTag = 'B',
     219    UnsignedByteClampedArrayTag = 'C',
    217220    ShortArrayTag = 'w',
    218221    UnsignedShortArrayTag = 'W',
     
    397400        else if (arrayBufferView.isUnsignedByteArray())
    398401            append(UnsignedByteArrayTag);
     402        else if (arrayBufferView.isUnsignedByteClampedArray())
     403            append(UnsignedByteClampedArrayTag);
    399404        else if (arrayBufferView.isShortArray())
    400405            append(ShortArrayTag);
     
    16291634            *value = toV8(Uint8Array::create(arrayBuffer.release(), byteOffset, byteLength));
    16301635            break;
     1636        case UnsignedByteClampedArrayTag:
     1637            *value = toV8(Uint8ClampedArray::create(arrayBuffer.release(), byteOffset, byteLength));
     1638            break;
    16311639        case ShortArrayTag: {
    16321640            uint32_t shortLength = byteLength / sizeof(int16_t);
  • trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustomScript.js

    r104196 r105705  
    5757optimizeSetMethod(Int32Array);
    5858optimizeSetMethod(Uint8Array);
     59optimizeSetMethod(Uint8ClampedArray);
    5960optimizeSetMethod(Uint16Array);
    6061optimizeSetMethod(Uint32Array);
  • trunk/Source/WebCore/page/Crypto.cpp

    r101295 r105705  
    4343    return array->isByteArray()
    4444        || array->isUnsignedByteArray()
     45        || array->isUnsignedByteClampedArray()
    4546        || array->isShortArray()
    4647        || array->isUnsignedShortArray()
  • trunk/Source/WebCore/page/DOMWindow.idl

    r105569 r105705  
    496496        attribute Int8ArrayConstructor Int8Array; // Usable with new operator
    497497        attribute Uint8ArrayConstructor Uint8Array; // Usable with new operator
    498 #if !defined(V8_BINDING) || !V8_BINDING
    499498        attribute Uint8ClampedArrayConstructor Uint8ClampedArray; // Usable with new operator
    500 #endif
    501499        attribute Int16ArrayConstructor Int16Array; // Usable with new operator
    502500        attribute Uint16ArrayConstructor Uint16Array; // Usable with new operator
  • trunk/Source/WebCore/workers/WorkerContext.idl

    r105486 r105705  
    119119        attribute Int8ArrayConstructor Int8Array; // Usable with new operator
    120120        attribute Uint8ArrayConstructor Uint8Array; // Usable with new operator
     121        attribute Uint8ArrayConstructor Uint8ClampedArray; // Usable with new operator
    121122        attribute Int16ArrayConstructor Int16Array; // Usable with new operator
    122123        attribute Uint16ArrayConstructor Uint16Array; // Usable with new operator
Note: See TracChangeset for help on using the changeset viewer.