[webkit-reviews] review granted: [Bug 225554] Factor out pixel buffer from DOM specific ImageData class : [Attachment 428090] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 8 12:46:36 PDT 2021


Darin Adler <darin at apple.com> has granted Sam Weinig <sam at webkit.org>'s request
for review:
Bug 225554: Factor out pixel buffer from DOM specific ImageData class
https://bugs.webkit.org/show_bug.cgi?id=225554

Attachment 428090: Patch

https://bugs.webkit.org/attachment.cgi?id=428090&action=review




--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 428090
  --> https://bugs.webkit.org/attachment.cgi?id=428090
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=428090&action=review

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:1085
> +	   RefPtr<ArrayBuffer> arrayBuffer =
imageData->data().possiblySharedBuffer();

We could either do auto/makeRefPtr, or just say RefPtr instead of
RefPtr<ArrayBuffer>, adding deduction guides to RefPtr if needed. The future of
RefPtr is now!

> Source/WebCore/html/ImageData.h:56
> +    ImageData(PixelBuffer&&);

explicit

> Source/WebCore/platform/graphics/PixelBuffer.h:31
> +#include <JavaScriptCore/Uint8ClampedArray.h>

Do we really need to include this header? Can we do a forward-declaration
instead?

> Source/WebCore/platform/graphics/PixelBuffer.h:39
> +    ~PixelBuffer();

If the only thing this does is decrement the Uint8ClampedArray reference count,
then maybe we can just use the default and not write this at all.

> Source/WebCore/platform/graphics/ShadowBlur.cpp:912
> +    auto& blurPixelArray = layerData->data();
> +    blurLayerImage(blurPixelArray.data(), blurRect.size(), blurRect.width()
* 4);

Seems like we don’t need the local at all.

> Source/WebCore/platform/graphics/filters/FELighting.cpp:482
> +    auto& resutPixelArray = resultImage->data();

Existing typo, "resut", that you should fix.

> Source/WebCore/platform/graphics/filters/FEMorphology.cpp:250
> +    auto& dstPixelArray = resultImage->data();

Do we have to do the "dst" thing? Maybe write out the whole destination word.

> Source/WebCore/platform/graphics/filters/FilterEffect.cpp:204
> +    Uint8ClampedArray& imageArray = m_premultipliedImageResult->data();

auto&


More information about the webkit-reviews mailing list