Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7857fde428154dcf9de6646518a5ae5f897df36e
      
https://github.com/WebKit/WebKit/commit/7857fde428154dcf9de6646518a5ae5f897df36e
  Author: Gerald Squelart <g_squel...@apple.com>
  Date:   2024-12-02 (Mon, 02 Dec 2024)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/ByteArrayPixelBuffer.cpp
    M Source/WebCore/platform/graphics/ByteArrayPixelBuffer.h
    A Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.cpp
    A Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.h
    M Source/WebCore/platform/graphics/PixelBuffer.cpp
    M Source/WebCore/platform/graphics/PixelBuffer.h

  Log Message:
  -----------
  Add Float16ArrayPixelBuffer
https://bugs.webkit.org/show_bug.cgi?id=283878
rdar://problem/140761117

Reviewed by Cameron McCormack.

Float16ArrayPixelBuffer is pretty much the same as
ByteArrayPixelBuffer, but obviously handling Float16Array data
instead.
Note: These types could eventually be reimplemented through
a single template, to be done later after they've been used a
bit more...

At this time, Float16ArrayPixelBuffer is not actually used yet,
this will come in upcoming patches, with relevant tests.

Accompanying changes:
- Changed bool isByteArrayPixelBuffer() to a more flexible type()
  function, to be used by isType().
- Fixed safer-cpp warning in ByteArrayPixelBuffer::span().
- Made PixelFormat::RGBA16F officially supported in PixelBuffer.
- Updated PixelBuffer::computeBufferSize to handle more formats.
- Added PixelBuffer::computePixelComponentCount to distinguish
  which value (array size in bytes or color components) is needed
  in callers, since these two can now be different.
  Note: All callers have *not* been checked/updated yet! To be
  done in upcoming patches touching ImageData and 2d context...
  Related note for the future: It would be good to have strong
  types to help distinguish counts of pixels/components/bytes
  everywhere.
- Also added PixelBuffer::computePixelCount.

* Source/WebCore/Headers.cmake:
* Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/ByteArrayPixelBuffer.cpp:
(WebCore::ByteArrayPixelBuffer::create):
(WebCore::ByteArrayPixelBuffer::tryCreate):
(WebCore::ByteArrayPixelBuffer::span const):
* Source/WebCore/platform/graphics/ByteArrayPixelBuffer.h:
(isType):
* Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.cpp: Copied from 
Source/WebCore/platform/graphics/ByteArrayPixelBuffer.cpp.
(WebCore::Float16ArrayPixelBuffer::create):
(WebCore::Float16ArrayPixelBuffer::tryCreate):
(WebCore::Float16ArrayPixelBuffer::Float16ArrayPixelBuffer):
(WebCore::Float16ArrayPixelBuffer::createScratchPixelBuffer const):
(WebCore::Float16ArrayPixelBuffer::span const):
* Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.h: Copied from 
Source/WebCore/platform/graphics/ByteArrayPixelBuffer.h.
(WebCore::Float16ArrayPixelBuffer::data const):
(WebCore::Float16ArrayPixelBuffer::takeData):
(isType):
* Source/WebCore/platform/graphics/PixelBuffer.cpp:
(WebCore::PixelBuffer::supportedPixelFormat):
(WebCore::mustFitInInt32):
(WebCore::computeRawPixelCount):
(WebCore::computeRawPixelComponentCount):
(WebCore::PixelBuffer::computePixelCount):
(WebCore::PixelBuffer::computePixelComponentCount):
(WebCore::PixelBuffer::computeBufferSize):
* Source/WebCore/platform/graphics/PixelBuffer.h:
(WebCore::PixelBuffer::type const):
(WebCore::PixelBuffer::isByteArrayPixelBuffer const): Deleted.

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



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

Reply via email to