Changeset 114992 in webkit


Ignore:
Timestamp:
Apr 23, 2012 8:43:31 PM (12 years ago)
Author:
kbr@google.com
Message:

Change ImageData to reference Uint8ClampedArray rather than CanvasPixelArray
https://bugs.webkit.org/show_bug.cgi?id=73011

Reviewed by Oliver Hunt.

Source/WebCore:

Changed ImageData to contain Uint8ClampedArray instead of ByteArray
per current HTML5 spec.

In order to avoid introducing large data copies, it was necessary to
switch a few other places in WebKit to use Uint8ClampedArray at the
same time, most notably the FilterEffect implementation, portions of
ImageBuffer, and a couple of places in the image encoders.

Note that the change in method name from "get" to "item" occurred
because JSC's autogenerated indexed getters reference a method
called "item". If desired, a convenience method could be
introduced to avoid the renamings in the FilterEffect classes.

With these changes, ByteArray and some custom code in JavaScriptCore
actually become unreferenced, and can be deleted. This deletion will
be done separately in Bug 83655, to keep the size of this patch
manageable.

Test: fast/canvas/imagedata-contains-uint8clampedarray.html

  • bindings/js/JSImageDataCustom.cpp:

(WebCore::toJS):

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readTerminal):

  • bindings/v8/SerializedScriptValue.cpp:
  • bindings/v8/custom/V8ImageDataCustom.cpp:

(WebCore::toV8):

  • bridge/qt/qt_pixmapruntime.cpp:

(JSC::Bindings::QtPixmapToImageDataMethod::invoke):

  • html/ImageData.cpp:

(WebCore::ImageData::create):
(WebCore::ImageData::ImageData):

  • html/ImageData.h:

(ImageData):
(WebCore::ImageData::data):

  • html/ImageData.idl:
  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::createEmptyImageData):
(WebCore::CanvasRenderingContext2D::getImageData):
(WebCore::CanvasRenderingContext2D::putImageData):

  • platform/graphics/GraphicsContext3D.cpp:

(WebCore::GraphicsContext3D::extractImageData):

  • platform/graphics/ImageBuffer.cpp:

(WebCore::ImageBuffer::genericConvertToLuminanceMask):

  • platform/graphics/ImageBuffer.h:
  • platform/graphics/ShadowBlur.cpp:

(WebCore::ShadowBlur::blurShadowBuffer):

  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::getImageData):
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):

  • platform/graphics/cg/ImageBufferCG.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageDataToDataURL):

  • platform/graphics/cg/ImageBufferDataCG.cpp:

(WebCore::ImageBufferData::getData):
(WebCore::ImageBufferData::putData):

  • platform/graphics/cg/ImageBufferDataCG.h:

(ImageBufferData):

  • platform/graphics/filters/FEBlend.cpp:

(WebCore::FEBlend::platformApplySoftware):

  • platform/graphics/filters/FEColorMatrix.cpp:

(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):

  • platform/graphics/filters/FEComponentTransfer.cpp:

(WebCore::FEComponentTransfer::platformApplySoftware):

  • platform/graphics/filters/FEComposite.cpp:

(WebCore::FEComposite::platformArithmeticSoftware):
(WebCore::FEComposite::platformApplySoftware):

  • platform/graphics/filters/FEComposite.h:
  • platform/graphics/filters/FEConvolveMatrix.cpp:

(WebCore::setDestinationPixels):
(WebCore::FEConvolveMatrix::fastSetInteriorPixels):
(WebCore::FEConvolveMatrix::fastSetOuterPixels):
(WebCore::FEConvolveMatrix::platformApplySoftware):

  • platform/graphics/filters/FEConvolveMatrix.h:

(PaintingData):

  • platform/graphics/filters/FECustomFilter.cpp:

(WebCore::FECustomFilter::platformApplySoftware):
(WebCore::FECustomFilter::bindProgramAndBuffers):

  • platform/graphics/filters/FECustomFilter.h:

(JSC):
(FECustomFilter):

  • platform/graphics/filters/FEDisplacementMap.cpp:

(WebCore::FEDisplacementMap::platformApplySoftware):

  • platform/graphics/filters/FEDropShadow.cpp:

(WebCore::FEDropShadow::platformApplySoftware):

  • platform/graphics/filters/FEGaussianBlur.cpp:

(WebCore::boxBlur):
(WebCore::FEGaussianBlur::platformApplyGeneric):
(WebCore::FEGaussianBlur::platformApply):
(WebCore::FEGaussianBlur::platformApplySoftware):

  • platform/graphics/filters/FEGaussianBlur.h:

(PlatformApplyParameters):
(FEGaussianBlur):

  • platform/graphics/filters/FELighting.cpp:

(WebCore::FELighting::LightingData::topLeft):
(WebCore::FELighting::LightingData::topRow):
(WebCore::FELighting::LightingData::topRight):
(WebCore::FELighting::LightingData::leftColumn):
(WebCore::FELighting::LightingData::interior):
(WebCore::FELighting::LightingData::rightColumn):
(WebCore::FELighting::LightingData::bottomLeft):
(WebCore::FELighting::LightingData::bottomRow):
(WebCore::FELighting::LightingData::bottomRight):
(WebCore::FELighting::inlineSetPixel):
(WebCore::FELighting::drawLighting):
(WebCore::FELighting::platformApplySoftware):

  • platform/graphics/filters/FELighting.h:

(LightingData):
(FELighting):

  • platform/graphics/filters/FEMorphology.cpp:

(WebCore::FEMorphology::platformApplyGeneric):
(WebCore::FEMorphology::platformApplySoftware):

  • platform/graphics/filters/FEMorphology.h:

(PaintingData):

  • platform/graphics/filters/FETurbulence.cpp:

(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::platformApplySoftware):

  • platform/graphics/filters/FETurbulence.h:

(FillRegionParameters):
(FETurbulence):

  • platform/graphics/filters/FilterEffect.cpp:

(WebCore::FilterEffect::forceValidPreMultipliedPixels):
(WebCore::FilterEffect::asUnmultipliedImage):
(WebCore::FilterEffect::asPremultipliedImage):
(WebCore::FilterEffect::copyImageBytes):
(WebCore::FilterEffect::copyUnmultipliedImage):
(WebCore::FilterEffect::copyPremultipliedImage):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):

  • platform/graphics/filters/FilterEffect.h:

(FilterEffect):

  • platform/graphics/filters/arm/FEGaussianBlurNEON.h:

(WebCore::FEGaussianBlur::platformApplyNeon):

  • platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:

(WebCore::GraphicsContext3D::paintRenderingResultsToImageData):

  • platform/graphics/qt/ImageBufferQt.cpp:

(WebCore::getImageData):
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):

  • platform/graphics/skia/ImageBufferSkia.cpp:

(WebCore::getImageData):
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):

  • platform/graphics/texmap/TextureMapperGL.cpp:
  • platform/graphics/wince/ImageBufferWinCE.cpp:

(WebCore::getImageData):
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):

  • platform/graphics/wx/ImageBufferWx.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):

  • platform/image-encoders/skia/JPEGImageEncoder.cpp:

(WebCore::JPEGImageEncoder::encode):

  • platform/image-encoders/skia/PNGImageEncoder.cpp:

(WebCore::PNGImageEncoder::encode):

  • platform/image-encoders/skia/WEBPImageEncoder.cpp:

(WebCore::WEBPImageEncoder::encode):

Source/WebKit/chromium:

  • src/GraphicsContext3DChromium.cpp:

(WebCore::GraphicsContext3DPrivate::paintRenderingResultsToImageData):

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::doPixelReadbackToCanvas):

Source/WTF:

  • wtf/ArrayBuffer.h:

(ArrayBuffer):
(WTF::ArrayBuffer::create):
(WTF::ArrayBuffer::createUninitialized):
(WTF):
(WTF::ArrayBufferContents::tryAllocate):

  • wtf/TypedArrayBase.h:

(WTF::TypedArrayBase::createUninitialized):
(TypedArrayBase):

  • wtf/Uint8ClampedArray.h:

(Uint8ClampedArray):
(WTF::Uint8ClampedArray::createUninitialized):
(WTF):
(WTF::Uint8ClampedArray::zeroFill):

LayoutTests:

  • fast/canvas/imagedata-contains-uint8clampedarray-expected.txt: Added.
  • fast/canvas/imagedata-contains-uint8clampedarray.html: Added.
  • fast/dom/Window/script-tests/postmessage-clone.js:
  • fast/dom/Window/window-postmessage-clone-expected.txt:
  • platform/chromium/fast/dom/Window/window-postmessage-clone-expected.txt:
  • platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt:
Location:
trunk
Files:
2 added
61 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r114990 r114992  
     12012-04-23  Kenneth Russell  <kbr@google.com>
     2
     3        Change ImageData to reference Uint8ClampedArray rather than CanvasPixelArray
     4        https://bugs.webkit.org/show_bug.cgi?id=73011
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * fast/canvas/imagedata-contains-uint8clampedarray-expected.txt: Added.
     9        * fast/canvas/imagedata-contains-uint8clampedarray.html: Added.
     10        * fast/dom/Window/script-tests/postmessage-clone.js:
     11        * fast/dom/Window/window-postmessage-clone-expected.txt:
     12        * platform/chromium/fast/dom/Window/window-postmessage-clone-expected.txt:
     13        * platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt:
     14
    1152012-04-23  Kent Tamura  <tkent@chromium.org>
    216
  • trunk/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js

    r100239 r114992  
    6060    mutatedImageData.data[i] = i % 256;
    6161tryPostMessage('imageData', false, imageData);
    62 tryPostMessage('imageData.data', true, null, DOMException.DATA_CLONE_ERR)
     62tryPostMessage('imageData.data', false, imageData.data)
    6363tryPostMessage('mutatedImageData', false, imageData);
    64 tryPostMessage('mutatedImageData.data', true, null, DOMException.DATA_CLONE_ERR)
     64tryPostMessage('mutatedImageData.data', false, imageData.data)
    6565for (var i = 0; i < imageData.data.length * 4; i++)
    6666    mutatedImageData.data[i] = 0;
  • trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt

    r91959 r114992  
    77PASS: 'postMessage(window)' threw TypeError: Type error
    88PASS: 'postMessage(({get a() { throw "x" }}))' threw x
    9 FAIL: 'postMessage(imageData.data)' should throw but didn't
    10 FAIL: 'postMessage(mutatedImageData.data)' should throw but didn't
    119PASS: 'postMessage((function() {return {get a() { throw "accessor-exn"; }};})())' threw accessor-exn
    1210PASS: 'postMessage((function() {var obja = {get p() { throw "accessor-exn"; }}; return {get a() { return obja; }};})())' threw accessor-exn
     
    4543PASS: eventData[0] is === to eventData[1]
    4644PASS: eventData is [object ImageData] of type object
     45PASS: eventData is [object Uint8ClampedArray] of type object
    4746PASS: eventData is [object ImageData] of type object
     47PASS: eventData is [object Uint8ClampedArray] of type object
    4848PASS: eventData is 42 of type number
    4949PASS: eventData is 42 of type number
  • trunk/LayoutTests/platform/chromium/fast/dom/Window/window-postmessage-clone-expected.txt

    r91959 r114992  
    55PASS: 'postMessage(window)' threw Error: DATA_CLONE_ERR: DOM Exception 25
    66PASS: 'postMessage(({get a() { throw "x" }}))' threw x
    7 PASS: 'postMessage(imageData.data)' threw Error: DATA_CLONE_ERR: DOM Exception 25
    8 PASS: 'postMessage(mutatedImageData.data)' threw Error: DATA_CLONE_ERR: DOM Exception 25
    97PASS: 'postMessage((function() {return {get a() { throw "accessor-exn"; }};})())' threw accessor-exn
    108PASS: 'postMessage((function() {var obja = {get p() { throw "accessor-exn"; }}; return {get a() { return obja; }};})())' threw accessor-exn
     
    4139PASS: eventData[0] is === to eventData[1]
    4240PASS: eventData is [object ImageData] of type object
     41PASS: eventData is [object Uint8ClampedArray] of type object
    4342PASS: eventData is [object ImageData] of type object
     43PASS: eventData is [object Uint8ClampedArray] of type object
    4444PASS: eventData is 42 of type number
    4545PASS: eventData is 42 of type number
  • trunk/LayoutTests/platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt

    r92368 r114992  
    3838PASS: eventData.graph1 is === to eventData.graph2
    3939PASS: eventData[0] is === to eventData[1]
    40 FAIL: 'postMessage(imageData.data)' should throw but didn't
    41 FAIL: 'postMessage(mutatedImageData.data)' should throw but didn't
    4240PASS: 'postMessage((function() {return {get a() { throw "accessor-exn"; }};})())' threw accessor-exn
    4341PASS: 'postMessage((function() {var obja = {get p() { throw "accessor-exn"; }}; return {get a() { return obja; }};})())' threw accessor-exn
     
    4543PASS: sanity on file reference equality
    4644PASS: eventData is [object ImageData] of type object
     45PASS: eventData is [object Uint8ClampedArray] of type object
    4746PASS: eventData is [object ImageData] of type object
     47PASS: eventData is [object Uint8ClampedArray] of type object
    4848PASS: eventData is 42 of type number
    4949PASS: eventData is 42 of type number
  • trunk/Source/WTF/ChangeLog

    r114985 r114992  
     12012-04-23  Kenneth Russell  <kbr@google.com>
     2
     3        Change ImageData to reference Uint8ClampedArray rather than CanvasPixelArray
     4        https://bugs.webkit.org/show_bug.cgi?id=73011
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * wtf/ArrayBuffer.h:
     9        (ArrayBuffer):
     10        (WTF::ArrayBuffer::create):
     11        (WTF::ArrayBuffer::createUninitialized):
     12        (WTF):
     13        (WTF::ArrayBufferContents::tryAllocate):
     14        * wtf/TypedArrayBase.h:
     15        (WTF::TypedArrayBase::createUninitialized):
     16        (TypedArrayBase):
     17        * wtf/Uint8ClampedArray.h:
     18        (Uint8ClampedArray):
     19        (WTF::Uint8ClampedArray::createUninitialized):
     20        (WTF):
     21        (WTF::Uint8ClampedArray::zeroFill):
     22
    1232012-04-23  George Staikos  <staikos@webkit.org>
    224
  • trunk/Source/WTF/wtf/ArrayBuffer.h

    r111778 r114992  
    5858    friend class ArrayBuffer;
    5959
    60     static inline void tryAllocate(unsigned numElements, unsigned elementByteSize, ArrayBufferContents&);
     60    enum InitializationPolicy {
     61        ZeroInitialize,
     62        DontInitialize
     63    };
     64
     65    static inline void tryAllocate(unsigned numElements, unsigned elementByteSize, InitializationPolicy, ArrayBufferContents&);
    6166    void transfer(ArrayBufferContents& other)
    6267    {
     
    7984    static inline PassRefPtr<ArrayBuffer> create(ArrayBufferContents&);
    8085
     86    // Only for use by Uint8ClampedArray::createUninitialized.
     87    static inline PassRefPtr<ArrayBuffer> createUninitialized(unsigned numElements, unsigned elementByteSize);
     88
    8189    inline void* data();
    8290    inline const void* data() const;
     
    95103
    96104private:
     105    static inline PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned elementByteSize, ArrayBufferContents::InitializationPolicy);
     106
    97107    inline ArrayBuffer(ArrayBufferContents&);
    98108    inline PassRefPtr<ArrayBuffer> sliceImpl(unsigned begin, unsigned end) const;
     
    116126PassRefPtr<ArrayBuffer> ArrayBuffer::create(unsigned numElements, unsigned elementByteSize)
    117127{
     128    return create(numElements, elementByteSize, ArrayBufferContents::ZeroInitialize);
     129}
     130
     131PassRefPtr<ArrayBuffer> ArrayBuffer::create(ArrayBuffer* other)
     132{
     133    return ArrayBuffer::create(other->data(), other->byteLength());
     134}
     135
     136PassRefPtr<ArrayBuffer> ArrayBuffer::create(const void* source, unsigned byteLength)
     137{
    118138    ArrayBufferContents contents;
    119     ArrayBufferContents::tryAllocate(numElements, elementByteSize, contents);
    120     if (!contents.m_data)
    121         return 0;
    122     return adoptRef(new ArrayBuffer(contents));
    123 }
    124 
    125 PassRefPtr<ArrayBuffer> ArrayBuffer::create(ArrayBuffer* other)
    126 {
    127     return ArrayBuffer::create(other->data(), other->byteLength());
    128 }
    129 
    130 PassRefPtr<ArrayBuffer> ArrayBuffer::create(const void* source, unsigned byteLength)
    131 {
    132     ArrayBufferContents contents;
    133     ArrayBufferContents::tryAllocate(byteLength, 1, contents);
     139    ArrayBufferContents::tryAllocate(byteLength, 1, ArrayBufferContents::ZeroInitialize, contents);
    134140    if (!contents.m_data)
    135141        return 0;
     
    144150}
    145151
     152PassRefPtr<ArrayBuffer> ArrayBuffer::createUninitialized(unsigned numElements, unsigned elementByteSize)
     153{
     154    return create(numElements, elementByteSize, ArrayBufferContents::DontInitialize);
     155}
     156
     157PassRefPtr<ArrayBuffer> ArrayBuffer::create(unsigned numElements, unsigned elementByteSize, ArrayBufferContents::InitializationPolicy policy)
     158{
     159    ArrayBufferContents contents;
     160    ArrayBufferContents::tryAllocate(numElements, elementByteSize, policy, contents);
     161    if (!contents.m_data)
     162        return 0;
     163    return adoptRef(new ArrayBuffer(contents));
     164}
     165
    146166ArrayBuffer::ArrayBuffer(ArrayBufferContents& contents)
    147167    : m_firstView(0)
     
    189209}
    190210
    191 void ArrayBufferContents::tryAllocate(unsigned numElements, unsigned elementByteSize, ArrayBufferContents& result)
     211void ArrayBufferContents::tryAllocate(unsigned numElements, unsigned elementByteSize, ArrayBufferContents::InitializationPolicy policy, ArrayBufferContents& result)
    192212{
    193213    // Do not allow 32-bit overflow of the total size.
     
    202222        }
    203223    }
    204     if (WTF::tryFastCalloc(numElements, elementByteSize).getValue(result.m_data)) {
     224    bool allocationSucceeded = false;
     225    if (policy == ZeroInitialize)
     226        allocationSucceeded = WTF::tryFastCalloc(numElements, elementByteSize).getValue(result.m_data);
     227    else {
     228        ASSERT(policy == DontInitialize);
     229        allocationSucceeded = WTF::tryFastMalloc(numElements * elementByteSize).getValue(result.m_data);
     230    }
     231
     232    if (allocationSucceeded) {
    205233        result.m_sizeInBytes = numElements * elementByteSize;
    206234        return;
  • trunk/Source/WTF/wtf/TypedArrayBase.h

    r111778 r114992  
    105105
    106106    template <class Subclass>
     107    static PassRefPtr<Subclass> createUninitialized(unsigned length)
     108    {
     109        RefPtr<ArrayBuffer> buffer = ArrayBuffer::createUninitialized(length, sizeof(T));
     110        if (!buffer.get())
     111            return 0;
     112        return create<Subclass>(buffer, 0, length);
     113    }
     114
     115    template <class Subclass>
    107116    PassRefPtr<Subclass> subarrayImpl(int start, int end) const
    108117    {
  • trunk/Source/WTF/wtf/Uint8ClampedArray.h

    r111778 r114992  
    3939    static inline PassRefPtr<Uint8ClampedArray> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
    4040
     41    // Should only be used for WebCore-internal use (like filters and
     42    // getImageData) when it is known the entire array will be filled.
     43    // Do not return these results directly to JavaScript.
     44    static inline PassRefPtr<Uint8ClampedArray> createUninitialized(unsigned length);
     45
     46    // It's only needed to potentially call this method if the array
     47    // was created uninitialized -- the default initialization paths
     48    // zero the allocated memory.
     49    inline void zeroFill();
     50
    4151    // Can’t use "using" here due to a bug in the RVCT compiler.
    4252    bool set(TypedArrayBase<unsigned char>* array, unsigned offset) { return TypedArrayBase<unsigned char>::set(array, offset); }
     
    7282}
    7383
     84PassRefPtr<Uint8ClampedArray> Uint8ClampedArray::createUninitialized(unsigned length)
     85{
     86    return TypedArrayBase<unsigned char>::createUninitialized<Uint8ClampedArray>(length);
     87}
     88
     89void Uint8ClampedArray::zeroFill()
     90{
     91    zeroRange(0, length());
     92}
     93
    7494void Uint8ClampedArray::set(unsigned index, double value)
    7595{
  • trunk/Source/WebCore/ChangeLog

    r114991 r114992  
     12012-04-23  Kenneth Russell  <kbr@google.com>
     2
     3        Change ImageData to reference Uint8ClampedArray rather than CanvasPixelArray
     4        https://bugs.webkit.org/show_bug.cgi?id=73011
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Changed ImageData to contain Uint8ClampedArray instead of ByteArray
     9        per current HTML5 spec.
     10
     11        In order to avoid introducing large data copies, it was necessary to
     12        switch a few other places in WebKit to use Uint8ClampedArray at the
     13        same time, most notably the FilterEffect implementation, portions of
     14        ImageBuffer, and a couple of places in the image encoders.
     15
     16        Note that the change in method name from "get" to "item" occurred
     17        because JSC's autogenerated indexed getters reference a method
     18        called "item". If desired, a convenience method could be
     19        introduced to avoid the renamings in the FilterEffect classes.
     20
     21        With these changes, ByteArray and some custom code in JavaScriptCore
     22        actually become unreferenced, and can be deleted. This deletion will
     23        be done separately in Bug 83655, to keep the size of this patch
     24        manageable.
     25
     26        Test: fast/canvas/imagedata-contains-uint8clampedarray.html
     27
     28        * bindings/js/JSImageDataCustom.cpp:
     29        (WebCore::toJS):
     30        * bindings/js/SerializedScriptValue.cpp:
     31        (WebCore::CloneSerializer::dumpIfTerminal):
     32        (WebCore::CloneDeserializer::readTerminal):
     33        * bindings/v8/SerializedScriptValue.cpp:
     34        * bindings/v8/custom/V8ImageDataCustom.cpp:
     35        (WebCore::toV8):
     36        * bridge/qt/qt_pixmapruntime.cpp:
     37        (JSC::Bindings::QtPixmapToImageDataMethod::invoke):
     38        * html/ImageData.cpp:
     39        (WebCore::ImageData::create):
     40        (WebCore::ImageData::ImageData):
     41        * html/ImageData.h:
     42        (ImageData):
     43        (WebCore::ImageData::data):
     44        * html/ImageData.idl:
     45        * html/canvas/CanvasRenderingContext2D.cpp:
     46        (WebCore::createEmptyImageData):
     47        (WebCore::CanvasRenderingContext2D::getImageData):
     48        (WebCore::CanvasRenderingContext2D::putImageData):
     49        * platform/graphics/GraphicsContext3D.cpp:
     50        (WebCore::GraphicsContext3D::extractImageData):
     51        * platform/graphics/ImageBuffer.cpp:
     52        (WebCore::ImageBuffer::genericConvertToLuminanceMask):
     53        * platform/graphics/ImageBuffer.h:
     54        * platform/graphics/ShadowBlur.cpp:
     55        (WebCore::ShadowBlur::blurShadowBuffer):
     56        * platform/graphics/cairo/ImageBufferCairo.cpp:
     57        (WebCore::getImageData):
     58        (WebCore::ImageBuffer::getUnmultipliedImageData):
     59        (WebCore::ImageBuffer::getPremultipliedImageData):
     60        (WebCore::ImageBuffer::putByteArray):
     61        * platform/graphics/cg/ImageBufferCG.cpp:
     62        (WebCore::ImageBuffer::getUnmultipliedImageData):
     63        (WebCore::ImageBuffer::getPremultipliedImageData):
     64        (WebCore::ImageBuffer::putByteArray):
     65        (WebCore::ImageBuffer::toDataURL):
     66        (WebCore::ImageDataToDataURL):
     67        * platform/graphics/cg/ImageBufferDataCG.cpp:
     68        (WebCore::ImageBufferData::getData):
     69        (WebCore::ImageBufferData::putData):
     70        * platform/graphics/cg/ImageBufferDataCG.h:
     71        (ImageBufferData):
     72        * platform/graphics/filters/FEBlend.cpp:
     73        (WebCore::FEBlend::platformApplySoftware):
     74        * platform/graphics/filters/FEColorMatrix.cpp:
     75        (WebCore::effectType):
     76        (WebCore::FEColorMatrix::platformApplySoftware):
     77        * platform/graphics/filters/FEComponentTransfer.cpp:
     78        (WebCore::FEComponentTransfer::platformApplySoftware):
     79        * platform/graphics/filters/FEComposite.cpp:
     80        (WebCore::FEComposite::platformArithmeticSoftware):
     81        (WebCore::FEComposite::platformApplySoftware):
     82        * platform/graphics/filters/FEComposite.h:
     83        * platform/graphics/filters/FEConvolveMatrix.cpp:
     84        (WebCore::setDestinationPixels):
     85        (WebCore::FEConvolveMatrix::fastSetInteriorPixels):
     86        (WebCore::FEConvolveMatrix::fastSetOuterPixels):
     87        (WebCore::FEConvolveMatrix::platformApplySoftware):
     88        * platform/graphics/filters/FEConvolveMatrix.h:
     89        (PaintingData):
     90        * platform/graphics/filters/FECustomFilter.cpp:
     91        (WebCore::FECustomFilter::platformApplySoftware):
     92        (WebCore::FECustomFilter::bindProgramAndBuffers):
     93        * platform/graphics/filters/FECustomFilter.h:
     94        (JSC):
     95        (FECustomFilter):
     96        * platform/graphics/filters/FEDisplacementMap.cpp:
     97        (WebCore::FEDisplacementMap::platformApplySoftware):
     98        * platform/graphics/filters/FEDropShadow.cpp:
     99        (WebCore::FEDropShadow::platformApplySoftware):
     100        * platform/graphics/filters/FEGaussianBlur.cpp:
     101        (WebCore::boxBlur):
     102        (WebCore::FEGaussianBlur::platformApplyGeneric):
     103        (WebCore::FEGaussianBlur::platformApply):
     104        (WebCore::FEGaussianBlur::platformApplySoftware):
     105        * platform/graphics/filters/FEGaussianBlur.h:
     106        (PlatformApplyParameters):
     107        (FEGaussianBlur):
     108        * platform/graphics/filters/FELighting.cpp:
     109        (WebCore::FELighting::LightingData::topLeft):
     110        (WebCore::FELighting::LightingData::topRow):
     111        (WebCore::FELighting::LightingData::topRight):
     112        (WebCore::FELighting::LightingData::leftColumn):
     113        (WebCore::FELighting::LightingData::interior):
     114        (WebCore::FELighting::LightingData::rightColumn):
     115        (WebCore::FELighting::LightingData::bottomLeft):
     116        (WebCore::FELighting::LightingData::bottomRow):
     117        (WebCore::FELighting::LightingData::bottomRight):
     118        (WebCore::FELighting::inlineSetPixel):
     119        (WebCore::FELighting::drawLighting):
     120        (WebCore::FELighting::platformApplySoftware):
     121        * platform/graphics/filters/FELighting.h:
     122        (LightingData):
     123        (FELighting):
     124        * platform/graphics/filters/FEMorphology.cpp:
     125        (WebCore::FEMorphology::platformApplyGeneric):
     126        (WebCore::FEMorphology::platformApplySoftware):
     127        * platform/graphics/filters/FEMorphology.h:
     128        (PaintingData):
     129        * platform/graphics/filters/FETurbulence.cpp:
     130        (WebCore::FETurbulence::fillRegion):
     131        (WebCore::FETurbulence::platformApplySoftware):
     132        * platform/graphics/filters/FETurbulence.h:
     133        (FillRegionParameters):
     134        (FETurbulence):
     135        * platform/graphics/filters/FilterEffect.cpp:
     136        (WebCore::FilterEffect::forceValidPreMultipliedPixels):
     137        (WebCore::FilterEffect::asUnmultipliedImage):
     138        (WebCore::FilterEffect::asPremultipliedImage):
     139        (WebCore::FilterEffect::copyImageBytes):
     140        (WebCore::FilterEffect::copyUnmultipliedImage):
     141        (WebCore::FilterEffect::copyPremultipliedImage):
     142        (WebCore::FilterEffect::createUnmultipliedImageResult):
     143        (WebCore::FilterEffect::createPremultipliedImageResult):
     144        * platform/graphics/filters/FilterEffect.h:
     145        (FilterEffect):
     146        * platform/graphics/filters/arm/FEGaussianBlurNEON.h:
     147        (WebCore::FEGaussianBlur::platformApplyNeon):
     148        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
     149        (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
     150        * platform/graphics/qt/ImageBufferQt.cpp:
     151        (WebCore::getImageData):
     152        (WebCore::ImageBuffer::getUnmultipliedImageData):
     153        (WebCore::ImageBuffer::getPremultipliedImageData):
     154        (WebCore::ImageBuffer::putByteArray):
     155        * platform/graphics/skia/ImageBufferSkia.cpp:
     156        (WebCore::getImageData):
     157        (WebCore::ImageBuffer::getUnmultipliedImageData):
     158        (WebCore::ImageBuffer::getPremultipliedImageData):
     159        (WebCore::ImageBuffer::putByteArray):
     160        * platform/graphics/texmap/TextureMapperGL.cpp:
     161        * platform/graphics/wince/ImageBufferWinCE.cpp:
     162        (WebCore::getImageData):
     163        (WebCore::ImageBuffer::getUnmultipliedImageData):
     164        (WebCore::ImageBuffer::getPremultipliedImageData):
     165        (WebCore::ImageBuffer::putByteArray):
     166        * platform/graphics/wx/ImageBufferWx.cpp:
     167        (WebCore::ImageBuffer::getUnmultipliedImageData):
     168        (WebCore::ImageBuffer::getPremultipliedImageData):
     169        (WebCore::ImageBuffer::putByteArray):
     170        * platform/image-encoders/skia/JPEGImageEncoder.cpp:
     171        (WebCore::JPEGImageEncoder::encode):
     172        * platform/image-encoders/skia/PNGImageEncoder.cpp:
     173        (WebCore::PNGImageEncoder::encode):
     174        * platform/image-encoders/skia/WEBPImageEncoder.cpp:
     175        (WebCore::WEBPImageEncoder::encode):
     176
    11772012-04-23  Ryan Sleevi  <rsleevi@chromium.org>
    2178
  • trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp

    r104324 r114992  
    2626#include "config.h"
    2727#include "JSImageData.h"
     28#include "JSUint8ClampedArray.h"
    2829
    2930#include "ImageData.h"
    3031#include "PlatformString.h"
    3132
    32 #include <runtime/JSByteArray.h>
    3333#include <wtf/StdLibExtras.h>
    3434
     
    4848    wrapper = CREATE_DOM_WRAPPER(exec, globalObject, ImageData, imageData);
    4949    Identifier dataName(exec, "data");
    50     Structure* cpaStructure = getCachedDOMStructure(globalObject, &JSByteArray::s_info);
    51     if (!cpaStructure)
    52         cpaStructure = cacheDOMStructure(globalObject, JSByteArray::createStructure(exec->globalData(), globalObject, jsNull(), &JSByteArray::s_info), &JSByteArray::s_info);
    53     wrapper->putDirect(exec->globalData(), dataName, JSByteArray::create(exec, cpaStructure, imageData->data()->data()), DontDelete | ReadOnly);
     50    wrapper->putDirect(exec->globalData(), dataName, toJS(exec, globalObject, imageData->data()), DontDelete | ReadOnly);
    5451    exec->heap()->reportExtraMemoryCost(imageData->data()->length());
    5552   
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r114013 r114992  
    6464#include <runtime/RegExpObject.h>
    6565#include <wtf/ArrayBuffer.h>
    66 #include <wtf/ByteArray.h>
    6766#include <wtf/HashTraits.h>
     67#include <wtf/Uint8ClampedArray.h>
    6868#include <wtf/Vector.h>
    6969
     
    610610                write(data->height());
    611611                write(data->data()->length());
    612                 write(data->data()->data()->data(), data->data()->length());
     612                write(data->data()->data(), data->data()->length());
    613613                return true;
    614614            }
     
    14311431            }
    14321432            RefPtr<ImageData> result = ImageData::create(IntSize(width, height));
    1433             memcpy(result->data()->data()->data(), m_ptr, length);
     1433            memcpy(result->data()->data(), m_ptr, length);
    14341434            m_ptr += length;
    14351435            return getJSValue(result.get());
  • trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp

    r111258 r114992  
    3535#include <wtf/ArrayBufferView.h>
    3636#include "Blob.h"
    37 #include <wtf/ByteArray.h>
    3837#include "CanvasPixelArray.h"
    3938#include "DataView.h"
     
    10071006        if (!imageData)
    10081007            return;
    1009         WTF::ByteArray* pixelArray = imageData->data()->data();
     1008        Uint8ClampedArray* pixelArray = imageData->data();
    10101009        m_writer.writeImageData(imageData->width(), imageData->height(), pixelArray->data(), pixelArray->length());
    10111010    }
     
    15831582            return false;
    15841583        RefPtr<ImageData> imageData = ImageData::create(IntSize(width, height));
    1585         WTF::ByteArray* pixelArray = imageData->data()->data();
     1584        Uint8ClampedArray* pixelArray = imageData->data();
    15861585        ASSERT(pixelArray);
    15871586        ASSERT(pixelArray->length() >= pixelDataLength);
  • trunk/Source/WebCore/bindings/v8/custom/V8ImageDataCustom.cpp

    r114927 r114992  
    3232#include "V8ImageData.h"
    3333
    34 #include "V8CanvasPixelArray.h"
     34#include "V8Uint8ClampedArray.h"
    3535
    3636namespace WebCore {
     
    4242    v8::Handle<v8::Object> wrapper = V8ImageData::wrap(impl);
    4343    if (!wrapper.IsEmpty()) {
    44         // Create a V8 CanvasPixelArray object.
     44        // Create a V8 Uint8ClampedArray object.
    4545        v8::Handle<v8::Value> pixelArray = toV8(impl->data(), isolate);
    4646        // Set the "data" property of the ImageData object to
  • trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp

    r97448 r114992  
    9393        int width = instance->width();
    9494        int height = instance->height();
    95         RefPtr<ByteArray> byteArray = ByteArray::create(width * height * 4);
    96         copyPixels(instance->toImage(), width, height, byteArray->data());
    97         RefPtr<ImageData> imageData = ImageData::create(IntSize(width, height), byteArray);
     95        RefPtr<ImageData> imageData = ImageData::create(IntSize(width, height));
     96        copyPixels(instance->toImage(), width, height, imageData->data()->data());
    9897        return toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), imageData.get());
    9998    }
  • trunk/Source/WebCore/html/ImageData.cpp

    r95901 r114992  
    3434PassRefPtr<ImageData> ImageData::create(const IntSize& size)
    3535{
     36    Checked<int, RecordOverflow> dataSize = 4;
     37    dataSize *= size.width();
     38    dataSize *= size.height();
     39    if (dataSize.hasOverflowed())
     40        return 0;
     41
    3642    return adoptRef(new ImageData(size));
    3743}
    3844
    39 PassRefPtr<ImageData> ImageData::create(const IntSize& size, PassRefPtr<ByteArray> byteArray)
     45PassRefPtr<ImageData> ImageData::create(const IntSize& size, PassRefPtr<Uint8ClampedArray> byteArray)
    4046{
     47    Checked<int, RecordOverflow> dataSize = 4;
     48    dataSize *= size.width();
     49    dataSize *= size.height();
     50    if (dataSize.hasOverflowed())
     51        return 0;
     52
     53    if (dataSize.unsafeGet() < 0
     54        || static_cast<unsigned>(dataSize.unsafeGet()) > byteArray->length())
     55        return 0;
     56
    4157    return adoptRef(new ImageData(size, byteArray));
    4258}
     
    4460ImageData::ImageData(const IntSize& size)
    4561    : m_size(size)
    46     , m_data(CanvasPixelArray::create(size.width() * size.height() * 4))
     62    , m_data(Uint8ClampedArray::createUninitialized(size.width() * size.height() * 4))
    4763{
    4864}
    4965
    50 ImageData::ImageData(const IntSize& size, PassRefPtr<ByteArray> byteArray)
     66ImageData::ImageData(const IntSize& size, PassRefPtr<Uint8ClampedArray> byteArray)
    5167    : m_size(size)
    52     , m_data(CanvasPixelArray::create(byteArray))
     68    , m_data(byteArray)
    5369{
     70    ASSERT(static_cast<unsigned>(size.width() * size.height() * 4) <= m_data->length());
    5471}
    5572
  • trunk/Source/WebCore/html/ImageData.h

    r95901 r114992  
    3030#define ImageData_h
    3131
    32 #include "CanvasPixelArray.h"
    3332#include "IntSize.h"
    34 #include <wtf/ByteArray.h>
    3533#include <wtf/RefCounted.h>
    3634#include <wtf/RefPtr.h>
     35#include <wtf/Uint8ClampedArray.h>
    3736
    3837namespace WebCore {
     
    4140public:
    4241    static PassRefPtr<ImageData> create(const IntSize&);
    43     static PassRefPtr<ImageData> create(const IntSize&, PassRefPtr<ByteArray>);
     42    static PassRefPtr<ImageData> create(const IntSize&, PassRefPtr<Uint8ClampedArray>);
    4443
    4544    IntSize size() const { return m_size; }
    4645    int width() const { return m_size.width(); }
    4746    int height() const { return m_size.height(); }
    48     CanvasPixelArray* data() const { return m_data.get(); }
     47    Uint8ClampedArray* data() const { return m_data.get(); }
    4948
    5049private:
    5150    ImageData(const IntSize&);
    52     ImageData(const IntSize&, PassRefPtr<ByteArray>);
     51    ImageData(const IntSize&, PassRefPtr<Uint8ClampedArray>);
    5352
    5453    IntSize m_size;
    55     RefPtr<CanvasPixelArray> m_data;
     54    RefPtr<Uint8ClampedArray> m_data;
    5655};
    5756
  • trunk/Source/WebCore/html/ImageData.idl

    r107636 r114992  
    3535        readonly attribute long height;
    3636#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
    37         readonly attribute CanvasPixelArray data;
     37        readonly attribute Uint8ClampedArray data;
    3838#endif
    3939    };
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r114691 r114992  
    6363#include "TextRun.h"
    6464
    65 #include <wtf/ByteArray.h>
     65#if USE(ACCELERATED_COMPOSITING)
     66#include "RenderLayer.h"
     67#endif
     68
    6669#include <wtf/CheckedArithmetic.h>
    6770#include <wtf/MathExtras.h>
    6871#include <wtf/OwnPtr.h>
     72#include <wtf/Uint8ClampedArray.h>
    6973#include <wtf/UnusedParam.h>
    7074
     
    17411745
    17421746    RefPtr<ImageData> data = ImageData::create(size);
    1743     memset(data->data()->data()->data(), 0, data->data()->data()->length());
     1747    data->data()->zeroFill();
    17441748    return data.release();
    17451749}
     
    18301834        return createEmptyImageData(imageDataRect.size());
    18311835
    1832     RefPtr<ByteArray> byteArray = buffer->getUnmultipliedImageData(imageDataRect, coordinateSystem);
     1836    RefPtr<Uint8ClampedArray> byteArray = buffer->getUnmultipliedImageData(imageDataRect, coordinateSystem);
    18331837    if (!byteArray)
    18341838        return 0;
     
    19031907    sourceRect.move(-destOffset);
    19041908
    1905     buffer->putByteArray(Unmultiplied, data->data()->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset), coordinateSystem);
     1909    buffer->putByteArray(Unmultiplied, data->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset), coordinateSystem);
    19061910
    19071911    if (coordinateSystem == ImageBuffer::BackingStoreCoordinateSystem) {
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp

    r110602 r114992  
    203203    int dataBytes = width * height * 4;
    204204    data.resize(dataBytes);
    205     if (!packPixels(imageData->data()->data()->data(),
     205    if (!packPixels(imageData->data()->data(),
    206206                    SourceFormatRGBA8,
    207207                    width,
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp

    r109016 r114992  
    7373{
    7474    IntRect luminanceRect(IntPoint(), internalSize());
    75     RefPtr<ByteArray> srcPixelArray = getUnmultipliedImageData(luminanceRect);
     75    RefPtr<Uint8ClampedArray> srcPixelArray = getUnmultipliedImageData(luminanceRect);
    7676   
    7777    unsigned pixelArrayLength = srcPixelArray->length();
    7878    for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
    79         unsigned char a = srcPixelArray->get(pixelOffset + 3);
     79        unsigned char a = srcPixelArray->item(pixelOffset + 3);
    8080        if (!a)
    8181            continue;
    82         unsigned char r = srcPixelArray->get(pixelOffset);
    83         unsigned char g = srcPixelArray->get(pixelOffset + 1);
    84         unsigned char b = srcPixelArray->get(pixelOffset + 2);
     82        unsigned char r = srcPixelArray->item(pixelOffset);
     83        unsigned char g = srcPixelArray->item(pixelOffset + 1);
     84        unsigned char b = srcPixelArray->item(pixelOffset + 2);
    8585       
    8686        double luma = (r * 0.2125 + g * 0.7154 + b * 0.0721) * ((double)a / 255.0);
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.h

    r114150 r114992  
    3939#include "IntSize.h"
    4040#include "ImageBufferData.h"
    41 #include <wtf/ByteArray.h>
    4241#include <wtf/Forward.h>
    4342#include <wtf/OwnPtr.h>
    4443#include <wtf/PassOwnPtr.h>
    4544#include <wtf/PassRefPtr.h>
     45#include <wtf/Uint8ClampedArray.h>
    4646#include <wtf/Vector.h>
    4747
     
    9999        enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSystem };
    100100
    101         PassRefPtr<ByteArray> getUnmultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
    102         PassRefPtr<ByteArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
     101        PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
     102        PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
    103103
    104         void putByteArray(Multiply multiplied, ByteArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem);
     104        void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem);
    105105       
    106106        void convertToLuminanceMask();
  • trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp

    r109016 r114992  
    827827
    828828    IntRect blurRect(IntPoint(), templateSize);
    829     RefPtr<ByteArray> layerData = m_layerImage->getUnmultipliedImageData(blurRect);
     829    RefPtr<Uint8ClampedArray> layerData = m_layerImage->getUnmultipliedImageData(blurRect);
    830830    blurLayerImage(layerData->data(), blurRect.size(), blurRect.width() * 4);
    831831    m_layerImage->putByteArray(Unmultiplied, layerData.get(), blurRect.size(), blurRect, IntPoint());
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r114216 r114992  
    133133
    134134template <Multiply multiplied>
    135 PassRefPtr<ByteArray> getImageData(const IntRect& rect, const ImageBufferData& data, const IntSize& size)
     135PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBufferData& data, const IntSize& size)
    136136{
    137137    ASSERT(cairo_surface_get_type(data.m_surface) == CAIRO_SURFACE_TYPE_IMAGE);
    138138
    139     RefPtr<ByteArray> result = ByteArray::create(rect.width() * rect.height() * 4);
     139    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    140140    unsigned char* dataSrc = cairo_image_surface_get_data(data.m_surface);
    141141    unsigned char* dataDst = result->data();
    142142
    143143    if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > size.width() || (rect.y() + rect.height()) > size.height())
    144         memset(dataDst, 0, result->length());
     144        result->zeroFill();
    145145
    146146    int originx = rect.x();
     
    191191}
    192192
    193 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
     193PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    194194{
    195195    return getImageData<Unmultiplied>(rect, m_data, m_size);
    196196}
    197197
    198 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
     198PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    199199{
    200200    return getImageData<Premultiplied>(rect, m_data, m_size);
    201201}
    202202
    203 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
     203void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    204204{
    205205    ASSERT(cairo_surface_get_type(m_data.m_surface) == CAIRO_SURFACE_TYPE_IMAGE);
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r114616 r114992  
    307307}
    308308
    309 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
     309PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
    310310{
    311311    if (m_context->isAcceleratedContext()) {
     
    318318}
    319319
    320 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
     320PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
    321321{
    322322    if (m_context->isAcceleratedContext()) {
     
    329329}
    330330
    331 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem coordinateSystem)
     331void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem coordinateSystem)
    332332{
    333333    if (!m_context->isAcceleratedContext()) {
     
    441441    ASSERT(uti);
    442442
    443     RefPtr<ByteArray> premultipliedData;
     443    RefPtr<Uint8ClampedArray> premultipliedData;
    444444    RetainPtr<CGImageRef> image;
    445445
     
    481481    RetainPtr<CGDataProviderRef> dataProvider;
    482482
    483     unsigned char* data = source.data()->data()->data();
     483    unsigned char* data = source.data()->data();
    484484    RetainPtr<CFStringRef> uti = utiFromMIMEType(mimeType);
    485485    ASSERT(uti);
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp

    r113457 r114992  
    117117#endif // USE(ACCELERATE)
    118118
    119 PassRefPtr<ByteArray> ImageBufferData::getData(const IntRect& rect, const IntSize& size, bool accelerateRendering, bool unmultiplied, float resolutionScale) const
     119PassRefPtr<Uint8ClampedArray> ImageBufferData::getData(const IntRect& rect, const IntSize& size, bool accelerateRendering, bool unmultiplied, float resolutionScale) const
    120120{
    121121    float area = 4.0f * rect.width() * rect.height();
     
    123123        return 0;
    124124
    125     RefPtr<ByteArray> result = ByteArray::create(rect.width() * rect.height() * 4);
     125    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    126126    unsigned char* data = result->data();
    127127   
     
    129129    int endy = ceilf(rect.maxY() * resolutionScale);
    130130    if (rect.x() < 0 || rect.y() < 0 || endx > size.width() || endy > size.height())
    131         memset(data, 0, result->length());
     131        result->zeroFill();
    132132   
    133133    int originx = rect.x();
     
    343343}
    344344
    345 void ImageBufferData::putData(ByteArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, const IntSize& size, bool accelerateRendering, bool unmultiplied, float resolutionScale)
     345void ImageBufferData::putData(Uint8ClampedArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, const IntSize& size, bool accelerateRendering, bool unmultiplied, float resolutionScale)
    346346{
    347347    ASSERT(sourceRect.width() > 0);
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h

    r113457 r114992  
    2626
    2727#include "Image.h"
    28 #include <wtf/ByteArray.h>
    2928#include <wtf/CheckedArithmetic.h>
    3029#include <wtf/RefPtr.h>
    3130#include <wtf/RetainPtr.h>
     31#include <wtf/Uint8ClampedArray.h>
    3232
    3333#if (PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD))
     
    5959#endif
    6060
    61     PassRefPtr<ByteArray> getData(const IntRect& rect, const IntSize& size, bool accelerateRendering, bool unmultiplied, float resolutionScale) const;
    62     void putData(ByteArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, const IntSize& size, bool accelerateRendering, bool unmultiplied, float resolutionScale);
     61    PassRefPtr<Uint8ClampedArray> getData(const IntRect&, const IntSize&, bool accelerateRendering, bool unmultiplied, float resolutionScale) const;
     62    void putData(Uint8ClampedArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, const IntSize&, bool accelerateRendering, bool unmultiplied, float resolutionScale);
    6363};
    6464
  • trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp

    r97853 r114992  
    3232#include "TextStream.h"
    3333
    34 #include <wtf/ByteArray.h>
     34#include <wtf/Uint8ClampedArray.h>
    3535
    3636typedef unsigned char (*BlendType)(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB);
     
    9595    ASSERT(m_mode <= FEBLEND_MODE_LIGHTEN);
    9696
    97     ByteArray* dstPixelArray = createPremultipliedImageResult();
     97    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
    9898    if (!dstPixelArray)
    9999        return;
    100100
    101101    IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    102     RefPtr<ByteArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
     102    RefPtr<Uint8ClampedArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
    103103
    104104    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
    105     RefPtr<ByteArray> srcPixelArrayB = in2->asPremultipliedImage(effectBDrawingRect);
     105    RefPtr<Uint8ClampedArray> srcPixelArrayB = in2->asPremultipliedImage(effectBDrawingRect);
    106106
    107107    unsigned pixelArrayLength = srcPixelArrayA->length();
    108108    ASSERT(pixelArrayLength == srcPixelArrayB->length());
    109109    for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
    110         unsigned char alphaA = srcPixelArrayA->get(pixelOffset + 3);
    111         unsigned char alphaB = srcPixelArrayB->get(pixelOffset + 3);
     110        unsigned char alphaA = srcPixelArrayA->item(pixelOffset + 3);
     111        unsigned char alphaB = srcPixelArrayB->item(pixelOffset + 3);
    112112        for (unsigned channel = 0; channel < 3; ++channel) {
    113             unsigned char colorA = srcPixelArrayA->get(pixelOffset + channel);
    114             unsigned char colorB = srcPixelArrayB->get(pixelOffset + channel);
     113            unsigned char colorA = srcPixelArrayA->item(pixelOffset + channel);
     114            unsigned char colorB = srcPixelArrayB->item(pixelOffset + channel);
    115115            unsigned char result;
    116116
  • trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp

    r106836 r114992  
    3131#include "TextStream.h"
    3232
    33 #include <wtf/ByteArray.h>
    3433#include <wtf/MathExtras.h>
     34#include <wtf/Uint8ClampedArray.h>
    3535
    3636namespace WebCore {
     
    126126
    127127template<ColorMatrixType filterType>
    128 void effectType(ByteArray* pixelArray, const Vector<float>& values)
     128void effectType(Uint8ClampedArray* pixelArray, const Vector<float>& values)
    129129{
    130130    unsigned pixelArrayLength = pixelArray->length();
    131131    for (unsigned pixelByteOffset = 0; pixelByteOffset < pixelArrayLength; pixelByteOffset += 4) {
    132         double red = pixelArray->get(pixelByteOffset);
    133         double green = pixelArray->get(pixelByteOffset + 1);
    134         double blue = pixelArray->get(pixelByteOffset + 2);
    135         double alpha = pixelArray->get(pixelByteOffset + 3);
     132        double red = pixelArray->item(pixelByteOffset);
     133        double green = pixelArray->item(pixelByteOffset + 1);
     134        double blue = pixelArray->item(pixelByteOffset + 2);
     135        double alpha = pixelArray->item(pixelByteOffset + 3);
    136136
    137137        switch (filterType) {
     
    168168
    169169    IntRect imageRect(IntPoint(), absolutePaintRect().size());
    170     RefPtr<ByteArray> pixelArray = resultImage->getUnmultipliedImageData(imageRect);
     170    RefPtr<Uint8ClampedArray> pixelArray = resultImage->getUnmultipliedImageData(imageRect);
    171171
    172172    switch (m_type) {
  • trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp

    r97853 r114992  
    3232#include "TextStream.h"
    3333
    34 #include <wtf/ByteArray.h>
    3534#include <wtf/MathExtras.h>
    3635#include <wtf/StdLibExtras.h>
     36#include <wtf/Uint8ClampedArray.h>
    3737
    3838namespace WebCore {
     
    155155    FilterEffect* in = inputEffect(0);
    156156
    157     ByteArray* pixelArray = createUnmultipliedImageResult();
     157    Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
    158158    if (!pixelArray)
    159159        return;
     
    177177    for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
    178178        for (unsigned channel = 0; channel < 4; ++channel) {
    179             unsigned char c = pixelArray->get(pixelOffset + channel);
     179            unsigned char c = pixelArray->item(pixelOffset + channel);
    180180            pixelArray->set(pixelOffset + channel, tables[channel][c]);
    181181        }
  • trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp

    r109820 r114992  
    3333#include "TextStream.h"
    3434
    35 #include <wtf/ByteArray.h>
     35#include <wtf/Uint8ClampedArray.h>
    3636
    3737namespace WebCore {
     
    180180}
    181181
    182 inline void FEComposite::platformArithmeticSoftware(ByteArray* source, ByteArray* destination,
     182inline void FEComposite::platformArithmeticSoftware(Uint8ClampedArray* source, Uint8ClampedArray* destination,
    183183    float k1, float k2, float k3, float k4)
    184184{
     
    222222
    223223    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) {
    224         ByteArray* dstPixelArray = createPremultipliedImageResult();
     224        Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
    225225        if (!dstPixelArray)
    226226            return;
    227227
    228228        IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    229         RefPtr<ByteArray> srcPixelArray = in->asPremultipliedImage(effectADrawingRect);
     229        RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectADrawingRect);
    230230
    231231        IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
  • trunk/Source/WebCore/platform/graphics/filters/FEComposite.h

    r109820 r114992  
    7575    FEComposite(Filter*, const CompositeOperationType&, float, float, float, float);
    7676
    77     inline void platformArithmeticSoftware(ByteArray* source, ByteArray* destination, float k1, float k2, float k3, float k4);
     77    inline void platformArithmeticSoftware(Uint8ClampedArray* source, Uint8ClampedArray* destination, float k1, float k2, float k3, float k4);
    7878    inline void platformArithmeticNeon(unsigned char* source, unsigned  char* destination, unsigned pixelArrayLength, float* kArray);
    7979
  • trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp

    r102132 r114992  
    3131#include "TextStream.h"
    3232
    33 #include <wtf/ByteArray.h>
    3433#include <wtf/ParallelJobs.h>
     34#include <wtf/Uint8ClampedArray.h>
    3535
    3636namespace WebCore {
     
    224224
    225225template<bool preserveAlphaValues>
    226 ALWAYS_INLINE void setDestinationPixels(ByteArray* image, int& pixel, float* totals, float divisor, float bias, ByteArray* src)
     226ALWAYS_INLINE void setDestinationPixels(Uint8ClampedArray* image, int& pixel, float* totals, float divisor, float bias, Uint8ClampedArray* src)
    227227{
    228228    unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3] / divisor + bias);
     
    231231
    232232    if (preserveAlphaValues) {
    233         image->set(pixel, src->get(pixel));
     233        image->set(pixel, src->item(pixel));
    234234        ++pixel;
    235235    } else
     
    268268
    269269            while (kernelValue >= 0) {
    270                 totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
    271                 totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
    272                 totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel++));
     270                totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
     271                totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
     272                totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
    273273                if (!preserveAlphaValues)
    274                     totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(kernelPixel));
     274                    totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel));
    275275                ++kernelPixel;
    276276                --kernelValue;
     
    351351                int pixelIndex = getPixelValue(paintingData, kernelPixelX, kernelPixelY);
    352352                if (pixelIndex >= 0) {
    353                     totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex));
    354                     totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 1));
    355                     totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 2));
     353                    totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex));
     354                    totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 1));
     355                    totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 2));
    356356                }
    357357                if (!preserveAlphaValues && pixelIndex >= 0)
    358                     totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->get(pixelIndex + 3));
     358                    totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 3));
    359359                ++kernelPixelX;
    360360                --kernelValue;
     
    404404    FilterEffect* in = inputEffect(0);
    405405
    406     ByteArray* resultImage;
     406    Uint8ClampedArray* resultImage;
    407407    if (m_preserveAlpha)
    408408        resultImage = createUnmultipliedImageResult();
     
    414414    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    415415
    416     RefPtr<ByteArray> srcPixelArray;
     416    RefPtr<Uint8ClampedArray> srcPixelArray;
    417417    if (m_preserveAlpha)
    418418        srcPixelArray = in->asUnmultipliedImage(effectDrawingRect);
  • trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h

    r102132 r114992  
    8383
    8484    struct PaintingData {
    85         ByteArray* srcPixelArray;
    86         ByteArray* dstPixelArray;
     85        Uint8ClampedArray* srcPixelArray;
     86        Uint8ClampedArray* dstPixelArray;
    8787        int width;
    8888        int height;
  • trunk/Source/WebCore/platform/graphics/filters/FECustomFilter.cpp

    r113493 r114992  
    4747#include "TransformationMatrix.h"
    4848
    49 #include <wtf/ByteArray.h>
     49#include <wtf/Uint8ClampedArray.h>
    5050
    5151namespace WebCore {
     
    9696void FECustomFilter::platformApplySoftware()
    9797{
    98     ByteArray* dstPixelArray = createPremultipliedImageResult();
     98    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
    9999    if (!dstPixelArray)
    100100        return;
     
    102102    FilterEffect* in = inputEffect(0);
    103103    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    104     RefPtr<ByteArray> srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
     104    RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
    105105   
    106106    IntSize newContextSize(effectDrawingRect.size());
     
    130130
    131131    RefPtr<ImageData> imageData = m_context->paintRenderingResultsToImageData(m_drawingBuffer.get());
    132     ByteArray* gpuResult = imageData->data()->data();
     132    Uint8ClampedArray* gpuResult = imageData->data();
    133133    ASSERT(gpuResult->length() == dstPixelArray->length());
    134134    memcpy(dstPixelArray->data(), gpuResult->data(), gpuResult->length());
     
    210210}
    211211
    212 void FECustomFilter::bindProgramAndBuffers(ByteArray* srcPixelArray)
     212void FECustomFilter::bindProgramAndBuffers(Uint8ClampedArray* srcPixelArray)
    213213{
    214214    m_context->useProgram(m_shader->program());
  • trunk/Source/WebCore/platform/graphics/filters/FECustomFilter.h

    r111610 r114992  
    3939
    4040namespace JSC {
    41 class ByteArray;
     41class Uint8ClampedArray;
    4242}
    4343
     
    7676    void bindProgramNumberParameters(int uniformLocation, CustomFilterNumberParameter*);
    7777    void bindProgramParameters();
    78     void bindProgramAndBuffers(ByteArray* srcPixelArray);
     78    void bindProgramAndBuffers(Uint8ClampedArray* srcPixelArray);
    7979   
    8080    HostWindow* m_hostWindow;
  • trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp

    r97853 r114992  
    3232#include "TextStream.h"
    3333
    34 #include <wtf/ByteArray.h>
     34#include <wtf/Uint8ClampedArray.h>
    3535
    3636namespace WebCore {
     
    9797    ASSERT(m_yChannelSelector != CHANNEL_UNKNOWN);
    9898
    99     ByteArray* dstPixelArray = createPremultipliedImageResult();
     99    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
    100100    if (!dstPixelArray)
    101101        return;
    102102
    103103    IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    104     RefPtr<ByteArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
     104    RefPtr<Uint8ClampedArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
    105105
    106106    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
    107     RefPtr<ByteArray> srcPixelArrayB = in2->asUnmultipliedImage(effectBDrawingRect);
     107    RefPtr<Uint8ClampedArray> srcPixelArrayB = in2->asUnmultipliedImage(effectBDrawingRect);
    108108
    109109    ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
     
    120120        for (int x = 0; x < paintSize.width(); ++x) {
    121121            int dstIndex = line + x * 4;
    122             int srcX = x + static_cast<int>(scaleX * srcPixelArrayB->get(dstIndex + m_xChannelSelector - 1) + scaleAdjustmentX);
    123             int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->get(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY);
     122            int srcX = x + static_cast<int>(scaleX * srcPixelArrayB->item(dstIndex + m_xChannelSelector - 1) + scaleAdjustmentX);
     123            int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->item(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY);
    124124            for (unsigned channel = 0; channel < 4; ++channel) {
    125125                if (srcX < 0 || srcX >= paintSize.width() || srcY < 0 || srcY >= paintSize.height())
    126126                    dstPixelArray->set(dstIndex + channel, static_cast<unsigned char>(0));
    127127                else {
    128                     unsigned char pixelValue = srcPixelArrayA->get(srcY * stride + srcX * 4 + channel);
     128                    unsigned char pixelValue = srcPixelArrayA->item(srcY * stride + srcX * 4 + channel);
    129129                    dstPixelArray->set(dstIndex + channel, pixelValue);
    130130                }
  • trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp

    r109016 r114992  
    3030#include "ShadowBlur.h"
    3131#include "TextStream.h"
    32 #include <wtf/ByteArray.h>
    3332#include <wtf/MathExtras.h>
     33#include <wtf/Uint8ClampedArray.h>
    3434
    3535using namespace std;
     
    105105    // TODO: Direct pixel access to ImageBuffer would avoid copying the ImageData.
    106106    IntRect shadowArea(IntPoint(), resultImage->internalSize());
    107     RefPtr<ByteArray> srcPixelArray = resultImage->getPremultipliedImageData(shadowArea);
     107    RefPtr<Uint8ClampedArray> srcPixelArray = resultImage->getPremultipliedImageData(shadowArea);
    108108
    109109    contextShadow.blurLayerImage(srcPixelArray->data(), shadowArea.size(), 4 * shadowArea.size().width());
  • trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp

    r104566 r114992  
    3434#include "TextStream.h"
    3535
    36 #include <wtf/ByteArray.h>
    3736#include <wtf/MathExtras.h>
    3837#include <wtf/ParallelJobs.h>
     38#include <wtf/Uint8ClampedArray.h>
    3939
    4040using namespace std;
     
    8181}
    8282
    83 inline void boxBlur(ByteArray* srcPixelArray, ByteArray* dstPixelArray,
     83inline void boxBlur(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* dstPixelArray,
    8484                    unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
    8585{
     
    9191            int maxKernelSize = min(dxRight, effectWidth);
    9292            for (int i = 0; i < maxKernelSize; ++i)
    93                 sum += srcPixelArray->get(line + i * stride + channel);
     93                sum += srcPixelArray->item(line + i * stride + channel);
    9494
    9595            // Blurring
     
    9898                dstPixelArray->set(pixelByteOffset, static_cast<unsigned char>(sum / dx));
    9999                if (x >= dxLeft)
    100                     sum -= srcPixelArray->get(pixelByteOffset - dxLeft * stride);
     100                    sum -= srcPixelArray->item(pixelByteOffset - dxLeft * stride);
    101101                if (x + dxRight < effectWidth)
    102                     sum += srcPixelArray->get(pixelByteOffset + dxRight * stride);
     102                    sum += srcPixelArray->item(pixelByteOffset + dxRight * stride);
    103103            }
    104104            if (alphaImage) // Source image is black, it just has different alpha values
     
    108108}
    109109
    110 inline void FEGaussianBlur::platformApplyGeneric(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
     110inline void FEGaussianBlur::platformApplyGeneric(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
    111111{
    112112    int stride = 4 * paintSize.width();
     
    115115    int dyLeft = 0;
    116116    int dyRight = 0;
    117     ByteArray* src = srcPixelArray;
    118     ByteArray* dst = tmpPixelArray;
     117    Uint8ClampedArray* src = srcPixelArray;
     118    Uint8ClampedArray* dst = tmpPixelArray;
    119119
    120120    for (int i = 0; i < 3; ++i) {
     
    152152}
    153153
    154 inline void FEGaussianBlur::platformApply(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
     154inline void FEGaussianBlur::platformApply(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
    155155{
    156156    int scanline = 4 * paintSize.width();
     
    186186
    187187                    int blockSize = (endY - startY) * scanline;
    188                     params.srcPixelArray = ByteArray::create(blockSize);
    189                     params.dstPixelArray = ByteArray::create(blockSize);
     188                    params.srcPixelArray = Uint8ClampedArray::createUninitialized(blockSize);
     189                    params.dstPixelArray = Uint8ClampedArray::createUninitialized(blockSize);
    190190                    memcpy(params.srcPixelArray->data(), srcPixelArray->data() + startY * scanline, blockSize);
    191191                }
     
    276276    FilterEffect* in = inputEffect(0);
    277277
    278     ByteArray* srcPixelArray = createPremultipliedImageResult();
     278    Uint8ClampedArray* srcPixelArray = createPremultipliedImageResult();
    279279    if (!srcPixelArray)
    280280        return;
     
    293293
    294294    IntSize paintSize = absolutePaintRect().size();
    295     RefPtr<ByteArray> tmpImageData = ByteArray::create(paintSize.width() * paintSize.height() * 4);
    296     ByteArray* tmpPixelArray = tmpImageData.get();
     295    RefPtr<Uint8ClampedArray> tmpImageData = Uint8ClampedArray::createUninitialized(paintSize.width() * paintSize.height() * 4);
     296    Uint8ClampedArray* tmpPixelArray = tmpImageData.get();
    297297
    298298    platformApply(srcPixelArray, tmpPixelArray, kernelSizeX, kernelSizeY, paintSize);
  • trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h

    r104566 r114992  
    5858    struct PlatformApplyParameters {
    5959        FEGaussianBlur* filter;
    60         RefPtr<ByteArray> srcPixelArray;
    61         RefPtr<ByteArray> dstPixelArray;
     60        RefPtr<Uint8ClampedArray> srcPixelArray;
     61        RefPtr<Uint8ClampedArray> dstPixelArray;
    6262        int width;
    6363        int height;
     
    7171
    7272    static inline void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
    73     inline void platformApply(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
     73    inline void platformApply(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
    7474
    75     inline void platformApplyGeneric(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
    76     inline void platformApplyNeon(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
     75    inline void platformApplyGeneric(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
     76    inline void platformApplyNeon(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
    7777#if USE(SKIA)
    7878    virtual bool platformApplySkia();
  • trunk/Source/WebCore/platform/graphics/filters/FELighting.cpp

    r102132 r114992  
    6262inline void FELighting::LightingData::topLeft(int offset, IntPoint& normalVector)
    6363{
    64     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    65     int right = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     64    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     65    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    6666    offset += widthMultipliedByPixelSize;
    67     int bottom = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    68     int bottomRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     67    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     68    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    6969    normalVector.setX(-(center << 1) + (right << 1) - bottom + bottomRight);
    7070    normalVector.setY(-(center << 1) - right + (bottom << 1) + bottomRight);
     
    7373inline void FELighting::LightingData::topRow(int offset, IntPoint& normalVector)
    7474{
    75     int left = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    76     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    77     int right = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     75    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     76    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     77    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    7878    offset += widthMultipliedByPixelSize;
    79     int bottomLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    80     int bottom = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    81     int bottomRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     79    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     80    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     81    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    8282    normalVector.setX(-(left << 1) + (right << 1) - bottomLeft + bottomRight);
    8383    normalVector.setY(-left - (center << 1) - right + bottomLeft + (bottom << 1) + bottomRight);
     
    8686inline void FELighting::LightingData::topRight(int offset, IntPoint& normalVector)
    8787{
    88     int left = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    89     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
     88    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     89    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
    9090    offset += widthMultipliedByPixelSize;
    91     int bottomLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    92     int bottom = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
     91    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     92    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
    9393    normalVector.setX(-(left << 1) + (center << 1) - bottomLeft + bottom);
    9494    normalVector.setY(-left - (center << 1) + bottomLeft + (bottom << 1));
     
    9797inline void FELighting::LightingData::leftColumn(int offset, IntPoint& normalVector)
    9898{
    99     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    100     int right = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
    101     offset -= widthMultipliedByPixelSize;
    102     int top = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    103     int topRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     99    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     100    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
     101    offset -= widthMultipliedByPixelSize;
     102    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     103    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    104104    offset += widthMultipliedByPixelSize << 1;
    105     int bottom = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    106     int bottomRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     105    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     106    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    107107    normalVector.setX(-top + topRight - (center << 1) + (right << 1) - bottom + bottomRight);
    108108    normalVector.setY(-(top << 1) - topRight + (bottom << 1) + bottomRight);
     
    111111inline void FELighting::LightingData::interior(int offset, IntPoint& normalVector)
    112112{
    113     int left = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    114     int right = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
    115     offset -= widthMultipliedByPixelSize;
    116     int topLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    117     int top = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    118     int topRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     113    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     114    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
     115    offset -= widthMultipliedByPixelSize;
     116    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     117    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     118    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    119119    offset += widthMultipliedByPixelSize << 1;
    120     int bottomLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    121     int bottom = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    122     int bottomRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     120    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     121    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     122    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    123123    normalVector.setX(-topLeft + topRight - (left << 1) + (right << 1) - bottomLeft + bottomRight);
    124124    normalVector.setY(-topLeft - (top << 1) - topRight + bottomLeft + (bottom << 1) + bottomRight);
     
    127127inline void FELighting::LightingData::rightColumn(int offset, IntPoint& normalVector)
    128128{
    129     int left = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    130     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    131     offset -= widthMultipliedByPixelSize;
    132     int topLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    133     int top = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
     129    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     130    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     131    offset -= widthMultipliedByPixelSize;
     132    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     133    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
    134134    offset += widthMultipliedByPixelSize << 1;
    135     int bottomLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    136     int bottom = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
     135    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     136    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
    137137    normalVector.setX(-topLeft + top - (left << 1) + (center << 1) - bottomLeft + bottom);
    138138    normalVector.setY(-topLeft - (top << 1) + bottomLeft + (bottom << 1));
     
    141141inline void FELighting::LightingData::bottomLeft(int offset, IntPoint& normalVector)
    142142{
    143     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    144     int right = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
    145     offset -= widthMultipliedByPixelSize;
    146     int top = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    147     int topRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     143    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     144    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
     145    offset -= widthMultipliedByPixelSize;
     146    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     147    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    148148    normalVector.setX(-top + topRight - (center << 1) + (right << 1));
    149149    normalVector.setY(-(top << 1) - topRight + (center << 1) + right);
     
    152152inline void FELighting::LightingData::bottomRow(int offset, IntPoint& normalVector)
    153153{
    154     int left = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    155     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    156     int right = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
    157     offset -= widthMultipliedByPixelSize;
    158     int topLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    159     int top = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    160     int topRight = static_cast<int>(pixels->get(offset + cPixelSize + cAlphaChannelOffset));
     154    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     155    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     156    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
     157    offset -= widthMultipliedByPixelSize;
     158    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     159    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     160    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
    161161    normalVector.setX(-topLeft + topRight - (left << 1) + (right << 1));
    162162    normalVector.setY(-topLeft - (top << 1) - topRight + left + (center << 1) + right);
     
    165165inline void FELighting::LightingData::bottomRight(int offset, IntPoint& normalVector)
    166166{
    167     int left = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    168     int center = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
    169     offset -= widthMultipliedByPixelSize;
    170     int topLeft = static_cast<int>(pixels->get(offset - cPixelSize + cAlphaChannelOffset));
    171     int top = static_cast<int>(pixels->get(offset + cAlphaChannelOffset));
     167    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     168    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
     169    offset -= widthMultipliedByPixelSize;
     170    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
     171    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
    172172    normalVector.setX(-topLeft + top - (left << 1) + (center << 1));
    173173    normalVector.setY(-topLeft - (top << 1) + left + (center << 1));
     
    177177                                       int lightX, int lightY, float factorX, float factorY, IntPoint& normal2DVector)
    178178{
    179     m_lightSource->updatePaintingData(paintingData, lightX, lightY, static_cast<float>(data.pixels->get(offset + cAlphaChannelOffset)) * data.surfaceScale);
     179    m_lightSource->updatePaintingData(paintingData, lightX, lightY, static_cast<float>(data.pixels->item(offset + cAlphaChannelOffset)) * data.surfaceScale);
    180180
    181181    float lightStrength;
     
    291291}
    292292
    293 bool FELighting::drawLighting(ByteArray* pixels, int width, int height)
     293bool FELighting::drawLighting(Uint8ClampedArray* pixels, int width, int height)
    294294{
    295295    LightSource::PaintingData paintingData;
     
    374374    } else {
    375375        for (int i = 0; i < lastPixel; i += cPixelSize) {
    376             unsigned char a1 = data.pixels->get(i);
    377             unsigned char a2 = data.pixels->get(i + 1);
    378             unsigned char a3 = data.pixels->get(i + 2);
     376            unsigned char a1 = data.pixels->item(i);
     377            unsigned char a2 = data.pixels->item(i + 1);
     378            unsigned char a3 = data.pixels->item(i + 2);
    379379            // alpha set to set to max(a1, a2, a3)
    380380            data.pixels->set(i + 3, a1 >= a2 ? (a1 >= a3 ? a1 : a3) : (a2 >= a3 ? a2 : a3));
     
    389389    FilterEffect* in = inputEffect(0);
    390390
    391     ByteArray* srcPixelArray = createUnmultipliedImageResult();
     391    Uint8ClampedArray* srcPixelArray = createUnmultipliedImageResult();
    392392    if (!srcPixelArray)
    393393        return;
  • trunk/Source/WebCore/platform/graphics/filters/FELighting.h

    r102132 r114992  
    3535#include "PointLightSource.h"
    3636#include "SpotLightSource.h"
    37 #include <wtf/ByteArray.h>
    3837#include <wtf/Platform.h>
     38#include <wtf/Uint8ClampedArray.h>
    3939
    4040// Common base class for FEDiffuseLighting and FESpecularLighting
     
    6060    struct LightingData {
    6161        // This structure contains only read-only (SMP safe) data
    62         ByteArray* pixels;
     62        Uint8ClampedArray* pixels;
    6363        float surfaceScale;
    6464        int widthMultipliedByPixelSize;
     
    9393    FELighting(Filter*, LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
    9494
    95     bool drawLighting(ByteArray*, int, int);
     95    bool drawLighting(Uint8ClampedArray*, int, int);
    9696    inline void inlineSetPixel(int offset, LightingData&, LightSource::PaintingData&,
    9797                               int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector);
  • trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp

    r103076 r114992  
    3131#include "TextStream.h"
    3232
    33 #include <wtf/ByteArray.h>
    3433#include <wtf/ParallelJobs.h>
     34#include <wtf/Uint8ClampedArray.h>
    3535#include <wtf/Vector.h>
    3636
     
    107107void FEMorphology::platformApplyGeneric(PaintingData* paintingData, int yStart, int yEnd)
    108108{
    109     ByteArray* srcPixelArray = paintingData->srcPixelArray;
    110     ByteArray* dstPixelArray = paintingData->dstPixelArray;
     109    Uint8ClampedArray* srcPixelArray = paintingData->srcPixelArray;
     110    Uint8ClampedArray* dstPixelArray = paintingData->dstPixelArray;
    111111    const int width = paintingData->width;
    112112    const int height = paintingData->height;
     
    123123            // Compute extremas for each columns
    124124            for (int x = 0; x <= radiusX; ++x) {
    125                 unsigned char columnExtrema = srcPixelArray->get(extremaStartY * effectWidth + 4 * x + clrChannel);
     125                unsigned char columnExtrema = srcPixelArray->item(extremaStartY * effectWidth + 4 * x + clrChannel);
    126126                for (int eY = extremaStartY + 1; eY < extremaEndY; ++eY) {
    127                     unsigned char pixel = srcPixelArray->get(eY * effectWidth + 4 * x + clrChannel);
     127                    unsigned char pixel = srcPixelArray->item(eY * effectWidth + 4 * x + clrChannel);
    128128                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema)
    129129                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema)) {
     
    138138            for (int x = 0; x < width; ++x) {
    139139                const int endX = min(x + radiusX, width - 1);
    140                 unsigned char columnExtrema = srcPixelArray->get(extremaStartY * effectWidth + endX * 4 + clrChannel);
     140                unsigned char columnExtrema = srcPixelArray->item(extremaStartY * effectWidth + endX * 4 + clrChannel);
    141141                for (int i = extremaStartY + 1; i <= extremaEndY; ++i) {
    142                     unsigned char pixel = srcPixelArray->get(i * effectWidth + endX * 4 + clrChannel);
     142                    unsigned char pixel = srcPixelArray->item(i * effectWidth + endX * 4 + clrChannel);
    143143                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema)
    144144                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
     
    198198    FilterEffect* in = inputEffect(0);
    199199
    200     ByteArray* dstPixelArray = createPremultipliedImageResult();
     200    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
    201201    if (!dstPixelArray)
    202202        return;
     
    204204    setIsAlphaImage(in->isAlphaImage());
    205205    if (m_radiusX <= 0 || m_radiusY <= 0) {
    206         dstPixelArray->clear();
     206        dstPixelArray->zeroFill();
    207207        return;
    208208    }
     
    213213
    214214    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
    215     RefPtr<ByteArray> srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
     215    RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
    216216
    217217    PaintingData paintingData;
  • trunk/Source/WebCore/platform/graphics/filters/FEMorphology.h

    r111922 r114992  
    5858
    5959    struct PaintingData {
    60         ByteArray* srcPixelArray;
    61         ByteArray* dstPixelArray;
     60        Uint8ClampedArray* srcPixelArray;
     61        Uint8ClampedArray* dstPixelArray;
    6262        int width;
    6363        int height;
  • trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp

    r104824 r114992  
    3232#include "TextStream.h"
    3333
    34 #include <wtf/ByteArray.h>
    3534#include <wtf/MathExtras.h>
    3635#include <wtf/ParallelJobs.h>
     36#include <wtf/Uint8ClampedArray.h>
    3737
    3838namespace WebCore {
     
    331331}
    332332
    333 inline void FETurbulence::fillRegion(ByteArray* pixelArray, PaintingData& paintingData, int startY, int endY)
     333inline void FETurbulence::fillRegion(Uint8ClampedArray* pixelArray, PaintingData& paintingData, int startY, int endY)
    334334{
    335335    IntRect filterRegion = absolutePaintRect();
     
    357357void FETurbulence::platformApplySoftware()
    358358{
    359     ByteArray* pixelArray = createUnmultipliedImageResult();
     359    Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
    360360    if (!pixelArray)
    361361        return;
    362362
    363363    if (absolutePaintRect().isEmpty()) {
    364         pixelArray->clear();
     364        pixelArray->zeroFill();
    365365        return;
    366366    }
  • trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h

    r104824 r114992  
    109109    struct FillRegionParameters {
    110110        FETurbulence* filter;
    111         ByteArray* pixelArray;
     111        Uint8ClampedArray* pixelArray;
    112112        PaintingData* paintingData;
    113113        int startY;
     
    122122    float noise2D(int channel, PaintingData&, StitchData&, const FloatPoint&);
    123123    unsigned char calculateTurbulenceValueForPoint(int channel, PaintingData&, StitchData&, const FloatPoint&);
    124     inline void fillRegion(ByteArray*, PaintingData&, int, int);
     124    inline void fillRegion(Uint8ClampedArray*, PaintingData&, int, int);
    125125
    126126    TurbulenceType m_type;
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp

    r114172 r114992  
    2828#include "ImageBuffer.h"
    2929#include "TextStream.h"
    30 #include <wtf/ByteArray.h>
     30#include <wtf/Uint8ClampedArray.h>
    3131
    3232namespace WebCore {
     
    126126        return;
    127127
    128     ByteArray* imageArray = m_premultipliedImageResult.get();
     128    Uint8ClampedArray* imageArray = m_premultipliedImageResult.get();
    129129    unsigned char* pixelData = imageArray->data();
    130130    int pixelArrayLength = imageArray->length();
     
    174174}
    175175
    176 PassRefPtr<ByteArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
     176PassRefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
    177177{
    178178    ASSERT(isFilterSizeValid(rect));
    179     RefPtr<ByteArray> imageData = ByteArray::create(rect.width() * rect.height() * 4);
     179    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    180180    copyUnmultipliedImage(imageData.get(), rect);
    181181    return imageData.release();
    182182}
    183183
    184 PassRefPtr<ByteArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
     184PassRefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
    185185{
    186186    ASSERT(isFilterSizeValid(rect));
    187     RefPtr<ByteArray> imageData = ByteArray::create(rect.width() * rect.height() * 4);
     187    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    188188    copyPremultipliedImage(imageData.get(), rect);
    189189    return imageData.release();
    190190}
    191191
    192 inline void FilterEffect::copyImageBytes(ByteArray* source, ByteArray* destination, const IntRect& rect)
     192inline void FilterEffect::copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect& rect)
    193193{
    194194    // Initialize the destination to transparent black, if not entirely covered by the source.
     
    234234}
    235235
    236 void FilterEffect::copyUnmultipliedImage(ByteArray* destination, const IntRect& rect)
     236void FilterEffect::copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect& rect)
    237237{
    238238    ASSERT(hasResult());
     
    244244        else {
    245245            ASSERT(isFilterSizeValid(m_absolutePaintRect));
    246             m_unmultipliedImageResult = ByteArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
     246            m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
    247247            unsigned char* sourceComponent = m_premultipliedImageResult->data();
    248248            unsigned char* destinationComponent = m_unmultipliedImageResult->data();
     
    268268}
    269269
    270 void FilterEffect::copyPremultipliedImage(ByteArray* destination, const IntRect& rect)
     270void FilterEffect::copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect& rect)
    271271{
    272272    ASSERT(hasResult());
     
    278278        else {
    279279            ASSERT(isFilterSizeValid(m_absolutePaintRect));
    280             m_premultipliedImageResult = ByteArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
     280            m_premultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
    281281            unsigned char* sourceComponent = m_unmultipliedImageResult->data();
    282282            unsigned char* destinationComponent = m_premultipliedImageResult->data();
     
    309309}
    310310
    311 ByteArray* FilterEffect::createUnmultipliedImageResult()
     311Uint8ClampedArray* FilterEffect::createUnmultipliedImageResult()
    312312{
    313313    // Only one result type is allowed.
     
    317317    if (m_absolutePaintRect.isEmpty())
    318318        return 0;
    319     m_unmultipliedImageResult = ByteArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
     319    m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
    320320    return m_unmultipliedImageResult.get();
    321321}
    322322
    323 ByteArray* FilterEffect::createPremultipliedImageResult()
     323Uint8ClampedArray* FilterEffect::createPremultipliedImageResult()
    324324{
    325325    // Only one result type is allowed.
     
    329329    if (m_absolutePaintRect.isEmpty())
    330330        return 0;
    331     m_premultipliedImageResult = ByteArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
     331    m_premultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
    332332    return m_premultipliedImageResult.get();
    333333}
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h

    r109820 r114992  
    2727#include "IntRect.h"
    2828
    29 #include <wtf/ByteArray.h>
    3029#include <wtf/PassOwnPtr.h>
    3130#include <wtf/RefCounted.h>
    3231#include <wtf/RefPtr.h>
     32#include <wtf/Uint8ClampedArray.h>
    3333#include <wtf/Vector.h>
    3434
     
    5757    void clearResult();
    5858    ImageBuffer* asImageBuffer();
    59     PassRefPtr<ByteArray> asUnmultipliedImage(const IntRect&);
    60     PassRefPtr<ByteArray> asPremultipliedImage(const IntRect&);
    61     void copyUnmultipliedImage(ByteArray* destination, const IntRect&);
    62     void copyPremultipliedImage(ByteArray* destination, const IntRect&);
     59    PassRefPtr<Uint8ClampedArray> asUnmultipliedImage(const IntRect&);
     60    PassRefPtr<Uint8ClampedArray> asPremultipliedImage(const IntRect&);
     61    void copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect&);
     62    void copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect&);
    6363
    6464    FilterEffectVector& inputEffects() { return m_inputEffects; }
     
    134134
    135135    ImageBuffer* createImageBufferResult();
    136     ByteArray* createUnmultipliedImageResult();
    137     ByteArray* createPremultipliedImageResult();
     136    Uint8ClampedArray* createUnmultipliedImageResult();
     137    Uint8ClampedArray* createPremultipliedImageResult();
    138138
    139139    // Return true if the filter will only operate correctly on valid RGBA values, with
     
    146146private:
    147147    OwnPtr<ImageBuffer> m_imageBufferResult;
    148     RefPtr<ByteArray> m_unmultipliedImageResult;
    149     RefPtr<ByteArray> m_premultipliedImageResult;
     148    RefPtr<Uint8ClampedArray> m_unmultipliedImageResult;
     149    RefPtr<Uint8ClampedArray> m_premultipliedImageResult;
    150150    FilterEffectVector m_inputEffects;
    151151
     
    160160   
    161161private:
    162     inline void copyImageBytes(ByteArray* source, ByteArray* destination, const IntRect&);
     162    inline void copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect&);
    163163
    164164    // The following member variables are SVG specific and will move to RenderSVGResourceFilterPrimitive.
  • trunk/Source/WebCore/platform/graphics/filters/arm/FEGaussianBlurNEON.h

    r95901 r114992  
    5555}
    5656
    57 inline void FEGaussianBlur::platformApplyNeon(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
     57inline void FEGaussianBlur::platformApplyNeon(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
    5858{
    5959    const int widthMultipliedByFour = 4 * paintSize.width();
     
    9090                neonDrawAllChannelGaussianBlur(srcPixelArray->data(), tmpPixelArray->data(), &argumentsX);
    9191        } else {
    92             ByteArray* auxPixelArray = tmpPixelArray;
     92            Uint8ClampedArray* auxPixelArray = tmpPixelArray;
    9393            tmpPixelArray = srcPixelArray;
    9494            srcPixelArray = auxPixelArray;
     
    103103                neonDrawAllChannelGaussianBlur(tmpPixelArray->data(), srcPixelArray->data(), &argumentsY);
    104104        } else {
    105             ByteArray* auxPixelArray = tmpPixelArray;
     105            Uint8ClampedArray* auxPixelArray = tmpPixelArray;
    106106            tmpPixelArray = srcPixelArray;
    107107            srcPixelArray = auxPixelArray;
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp

    r114268 r114992  
    151151
    152152    RefPtr<ImageData> imageData = ImageData::create(IntSize(m_currentWidth, m_currentHeight));
    153     unsigned char* pixels = imageData->data()->data()->data();
     153    unsigned char* pixels = imageData->data()->data();
    154154    int totalBytes = 4 * m_currentWidth * m_currentHeight;
    155155
  • trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp

    r114150 r114992  
    190190
    191191template <Multiply multiplied>
    192 PassRefPtr<ByteArray> getImageData(const IntRect& rect, const ImageBufferData& imageData, const IntSize& size)
     192PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBufferData& imageData, const IntSize& size)
    193193{
    194194    float area = 4.0f * rect.width() * rect.height();
     
    196196        return 0;
    197197
    198     RefPtr<ByteArray> result = ByteArray::create(rect.width() * rect.height() * 4);
     198    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    199199    unsigned char* data = result->data();
    200200
    201201    if (rect.x() < 0 || rect.y() < 0 || rect.maxX() > size.width() || rect.maxY() > size.height())
    202         memset(data, 0, result->length());
     202        result->zeroFill();
    203203
    204204    int originx = rect.x();
     
    272272}
    273273
    274 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
     274PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    275275{
    276276    return getImageData<Unmultiplied>(rect, m_data, m_size);
    277277}
    278278
    279 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
     279PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    280280{
    281281    return getImageData<Premultiplied>(rect, m_data, m_size);
     
    298298}
    299299
    300 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
     300void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    301301{
    302302    ASSERT(sourceRect.width() > 0);
  • trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r114150 r114992  
    231231
    232232template <Multiply multiplied>
    233 PassRefPtr<ByteArray> getImageData(const IntRect& rect, SkCanvas* canvas,
     233PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, SkCanvas* canvas,
    234234                                   const IntSize& size)
    235235{
     
    238238        return 0;
    239239
    240     RefPtr<ByteArray> result = ByteArray::create(rect.width() * rect.height() * 4);
     240    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    241241
    242242    unsigned char* data = result->data();
     
    246246        || rect.maxX() > size.width()
    247247        || rect.maxY() > size.height())
    248         memset(data, 0, result->length());
     248        result->zeroFill();
    249249
    250250    unsigned destBytesPerRow = 4 * rect.width();
     
    263263}
    264264
    265 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
     265PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    266266{
    267267    return getImageData<Unmultiplied>(rect, context()->platformContext()->canvas(), m_size);
    268268}
    269269
    270 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
     270PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    271271{
    272272    return getImageData<Premultiplied>(rect, context()->platformContext()->canvas(), m_size);
    273273}
    274274
    275 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
     275void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    276276{
    277277    SkCanvas* canvas = context()->platformContext()->canvas();
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

    r114118 r114992  
    4848#include "RefPtrCairo.h"
    4949#include <cairo.h>
    50 #include <wtf/ByteArray.h>
    5150#endif
    5251
  • trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp

    r114150 r114992  
    122122
    123123template <bool premultiplied>
    124 static PassRefPtr<ByteArray> getImageData(const IntRect& rect, const SharedBitmap* bitmap)
    125 {
    126     RefPtr<ByteArray> imageData = ByteArray::create(rect.width() * rect.height() * 4);
     124static PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const SharedBitmap* bitmap)
     125{
     126    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
    127127
    128128    const unsigned char* src = static_cast<const unsigned char*>(bitmap->bytes());
     
    136136
    137137    unsigned char* dst = imageData->data();
    138     memset(dst, 0, imageData->length());
     138    imageData->zeroFill();
    139139    src += (sourceRect.y() * bitmap->width() + sourceRect.x()) * 4;
    140140    dst += ((sourceRect.y() - rect.y()) * rect.width() + sourceRect.x() - rect.x()) * 4;
     
    171171}
    172172
    173 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
     173PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    174174{
    175175    return getImageData<false>(rect, m_data.m_bitmap.get());
    176176}
    177177
    178 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
     178PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    179179{
    180180    return getImageData<true>(rect, m_data.m_bitmap.get());
    181181}
    182182
    183 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
     183void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    184184{
    185185    SharedBitmap* bitmap = m_data.m_bitmap.get();
  • trunk/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp

    r114150 r114992  
    123123}
    124124
    125 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
     125PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    126126{
    127127    notImplemented();
     
    129129}
    130130
    131 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
     131PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    132132{
    133133    notImplemented();
     
    135135}
    136136
    137 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
     137void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    138138{
    139139    notImplemented();
  • trunk/Source/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp

    r113455 r114992  
    196196bool JPEGImageEncoder::encode(const ImageData& imageData, int quality, Vector<unsigned char>* output)
    197197{
    198     return encodePixels(imageData.size(), imageData.data()->data()->data(), false, quality, output);
     198    return encodePixels(imageData.size(), imageData.data()->data(), false, quality, output);
    199199}
    200200
  • trunk/Source/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp

    r96338 r114992  
    127127bool PNGImageEncoder::encode(const ImageData& imageData, Vector<unsigned char>* output)
    128128{
    129     return encodePixels(imageData.size(), imageData.data()->data()->data(), false, output);
     129    return encodePixels(imageData.size(), imageData.data()->data(), false, output);
    130130}
    131131
  • trunk/Source/WebCore/platform/image-encoders/skia/WEBPImageEncoder.cpp

    r105860 r114992  
    131131bool WEBPImageEncoder::encode(const ImageData& imageData, int quality, Vector<unsigned char>* output)
    132132{
    133     return encodePixels(imageData.size(), imageData.data()->data()->data(), false, quality, output);
     133    return encodePixels(imageData.size(), imageData.data()->data(), false, quality, output);
    134134}
    135135
  • trunk/Source/WebKit/chromium/ChangeLog

    r114987 r114992  
     12012-04-23  Kenneth Russell  <kbr@google.com>
     2
     3        Change ImageData to reference Uint8ClampedArray rather than CanvasPixelArray
     4        https://bugs.webkit.org/show_bug.cgi?id=73011
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * src/GraphicsContext3DChromium.cpp:
     9        (WebCore::GraphicsContext3DPrivate::paintRenderingResultsToImageData):
     10        * src/WebViewImpl.cpp:
     11        (WebKit::WebViewImpl::doPixelReadbackToCanvas):
     12
    1132012-04-23  Kent Tamura  <tkent@chromium.org>
    214
  • trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp

    r113092 r114992  
    319319
    320320    RefPtr<ImageData> imageData = ImageData::create(IntSize(width, height));
    321     unsigned char* pixels = imageData->data()->data()->data();
     321    unsigned char* pixels = imageData->data()->data();
    322322    size_t bufferSize = 4 * width * height;
    323323
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r114987 r114992  
    157157#include <public/WebPoint.h>
    158158#include <public/WebRect.h>
    159 #include <wtf/ByteArray.h>
    160159#include <wtf/CurrentTime.h>
    161160#include <wtf/MainThread.h>
    162161#include <wtf/RefPtr.h>
     162#include <wtf/Uint8ClampedArray.h>
    163163
    164164#if ENABLE(GESTURE_EVENTS)
     
    14781478
    14791479    OwnPtr<ImageBuffer> imageBuffer(ImageBuffer::create(rect.size()));
    1480     RefPtr<ByteArray> pixelArray(ByteArray::create(rect.width() * rect.height() * 4));
     1480    RefPtr<Uint8ClampedArray> pixelArray(Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4));
    14811481    if (imageBuffer && pixelArray) {
    14821482        m_layerTreeView.compositeAndReadback(pixelArray->data(), invertRect);
Note: See TracChangeset for help on using the changeset viewer.