Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d4570c2ebeca6f19cf3016be1679e5f9aa3a74ee
      
https://github.com/WebKit/WebKit/commit/d4570c2ebeca6f19cf3016be1679e5f9aa3a74ee
  Author: Gerald Squelart <[email protected]>
  Date:   2025-02-02 (Sun, 02 Feb 2025)

  Changed paths:
    M LayoutTests/fast/canvas/imagedata-storageformat-enabled-expected.txt
    M LayoutTests/fast/canvas/imagedata-storageformat-enabled.html
    M Source/WebCore/html/ImageData.cpp
    M Source/WebCore/html/ImageData.h
    M Source/WebCore/html/ImageDataArray.cpp
    M Source/WebCore/html/ImageDataArray.h
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp

  Log Message:
  -----------
  CanvasRenderingContext2DBase::getImageData with ImageDataStorageFormat
https://bugs.webkit.org/show_bug.cgi?id=284414
rdar://problem/141249363

Reviewed by Cameron McCormack.

`context.getImageData(..., {storageFormat:"float16"})` now works and
returns a Float16Array, which is currently converted from the canvas'
always-uint8 buffer.

`TypedArrayItemConverter<Float16Array, Uint8ClampedArray>::convert`
tweaked to round towards nearest (so 0.5 gets converted to 128), as
per specs https://github.com/w3c/ColorWeb-CG/blob/main/canvas_float.md

* LayoutTests/fast/canvas/imagedata-storageformat-enabled-expected.txt:
* LayoutTests/fast/canvas/imagedata-storageformat-enabled.html:
* Source/WebCore/html/ImageData.cpp:
(WebCore::ImageData::create):
(WebCore::ImageData::ImageData):
* Source/WebCore/html/ImageData.h:
(WebCore::ImageData::create):
* Source/WebCore/html/ImageDataArray.cpp:
(WebCore::ImageDataArray::ImageDataArray):
(WebCore::ImageDataArray::extractBufferViewWithStorageFormat):
* Source/WebCore/html/ImageDataArray.h:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::getImageData const):

Canonical link: https://commits.webkit.org/289717@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to