Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7e26d8f90916c854c742b7b1ce80a2e649093d42
      
https://github.com/WebKit/WebKit/commit/7e26d8f90916c854c742b7b1ce80a2e649093d42
  Author: Simon Fraser <simon.fra...@apple.com>
  Date:   2025-07-28 (Mon, 28 Jul 2025)

  Changed paths:
    M Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h
    M Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp
    M Source/WebCore/platform/cocoa/CoreVideoSoftLink.h
    M Source/WebCore/platform/graphics/cocoa/IOSurface.mm
    M Source/WebGPU/WebGPU/BindGroup.mm

  Log Message:
  -----------
  Add support for allocation of IOSurfaces using lossless compression formats
https://bugs.webkit.org/show_bug.cgi?id=296552
rdar://156881478

Reviewed by Tim Horton and Mike Wyrzykowski.

Add support for allocating IOSurfaces using the formats 
kCVPixelFormatType_Lossless_32BGRA,
kCVPixelFormatType_AGX_30RGBLEPackedWideGamut, 
kCVPixelFormatType_AGX_30RGBLE_8A_BiPlanar and
kCVPixelFormatType_Lossless_64RGBAHalf (those "AGX" variants will use the 
"Lossless" values
when they become available).

We go through `CVPixelBufferCreate()` for these formats, since CoreVideo knows 
how to
construct the complex dictionary argument to IOSurfaceCreate(); in future, we 
can transition
other formats to allocate via `CVPixelBufferCreate()` too. There are some 
hardware and size
limitations on using the compressed formats; if `createSurfaceViaCoreVideo()` 
detects one
of these it returns nullptr, and we fall back to the non-compressed format 
version, taking
care to update IOSurface::m_format.

On platforms that don't support compressed formats (tvOS, watchOS), 
UseLosslessCompression
is forced to No.

* Source/WebCore/PAL/pal/spi/cf/CoreVideoSPI.h: Remove the #if 
HAVE(COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES);
we use the #ifdef at use time instead to reduce the amount of #ifdeffing.
CVIsCompressedPixelFormatAvailable() does right thing on platforms that don't 
support these formats.
* Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp:
* Source/WebCore/platform/cocoa/CoreVideoSoftLink.h: Expose 
CVIsCompressedPixelFormatAvailable.
* Source/WebCore/platform/graphics/cocoa/IOSurface.mm:
(WebCore::coreVideoFormatFromIOSurfaceFormat):
(WebCore::createSurfaceViaCoreVideo):
(WebCore::m_name):
(WebCore::formatFromSurface):
* Source/WebGPU/WebGPU/BindGroup.mm: Comment.

Canonical link: https://commits.webkit.org/297947@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