Skip to content

Conversation

weinig
Copy link
Contributor

@weinig weinig commented Feb 3, 2025

742d687

Refactor HDR related macros to be more specific
https://bugs.webkit.org/show_bug.cgi?id=286940

Reviewed by Said Abou-Hallawa.

Replaces big HAVE(HDR_SUPPORT) and IOSurface specific macros
with ENABLE pattern, isolating the choices to the platform
enable code.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUCompositorIntegrationImpl.cpp:
* Source/WebCore/html/ImageDataStorageFormat.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm:
* Source/WebCore/page/PageOverlayController.cpp:
* Source/WebCore/platform/graphics/ContentsFormat.cpp:
* Source/WebCore/platform/graphics/ContentsFormat.h:
* Source/WebCore/platform/graphics/DestinationColorSpace.cpp:
* Source/WebCore/platform/graphics/DestinationColorSpace.h:
* Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.cpp:
* Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.h:
* Source/WebCore/platform/graphics/GraphicsLayer.h:
* Source/WebCore/platform/graphics/GraphicsLayerClient.h:
* Source/WebCore/platform/graphics/ImageBufferPixelFormat.h:
* Source/WebCore/platform/graphics/PixelBuffer.cpp:
* Source/WebCore/platform/graphics/PixelBuffer.h:
* Source/WebCore/platform/graphics/PixelBufferConversion.cpp:
* Source/WebCore/platform/graphics/PixelFormat.cpp:
* Source/WebCore/platform/graphics/PixelFormat.h:
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.mm:
* Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h:
* Source/WebCore/platform/graphics/ca/cocoa/ContentsFormatCocoa.h:
* Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
* Source/WebCore/platform/graphics/cg/NativeImageCG.cpp:
* Source/WebCore/platform/graphics/cocoa/IOSurface.h:
* Source/WebCore/platform/graphics/cocoa/IOSurface.mm:
* Source/WebCore/platform/ios/PlatformScreenIOS.mm:
* Source/WebCore/platform/mac/PlatformScreenMac.mm:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
* Source/WebCore/rendering/RenderLayerCompositor.h:
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:

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

543247e

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac 🧪 api-wpe
✅ 🧪 ios-wk2-wpt 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision 🧪 mac-AS-debug-wk2 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 tv 🛠 mac-safer-cpp ✅ 🛠 jsc-armv7
🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch
🛠 watch-sim

@weinig weinig requested review from cdumez and rniwa as code owners February 3, 2025 19:08
@weinig weinig self-assigned this Feb 3, 2025
@weinig weinig added the Platform Portability improvements and other general platform improvements not driven directly by site bugs. label Feb 3, 2025
@weinig weinig requested a review from shallawa February 3, 2025 19:08
Comment on lines +42 to 43
Copy link
Contributor

@shallawa shallawa Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But ContentsFormat defines RGBA10 when ENABLE(PIXEL_FORMAT_RGB10) is true. This switch statement has to handle RGBA10 anyway when ENABLE(PIXEL_FORMAT_RGB10) is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it would be a compile error if there ever were a combination of ENABLE(PIXEL_FORMAT_RGB10) but not ENABLE(DESTINATION_COLOR_SPACE_EXTENDED_SRGB), so if that ever comes up, someone will have to decide what behavior they want and implement it. For now, there is no reason to do that.

Comment on lines +46 to 47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 4, 2025
@weinig weinig requested a review from shallawa February 4, 2025 01:16
Copy link
Contributor

@shallawa shallawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes the platform parts of the code easier to follow. Thanks Sam!

@weinig weinig added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged merge-queue Applied to send a pull request to merge-queue labels Feb 4, 2025
@weinig weinig added the merge-queue Applied to send a pull request to merge-queue label Feb 4, 2025
https://bugs.webkit.org/show_bug.cgi?id=286940

Reviewed by Said Abou-Hallawa.

Replaces big HAVE(HDR_SUPPORT) and IOSurface specific macros
with ENABLE pattern, isolating the choices to the platform
enable code.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebCore/Modules/WebGPU/Implementation/WebGPUCompositorIntegrationImpl.cpp:
* Source/WebCore/html/ImageDataStorageFormat.h:
* Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm:
* Source/WebCore/page/PageOverlayController.cpp:
* Source/WebCore/platform/graphics/ContentsFormat.cpp:
* Source/WebCore/platform/graphics/ContentsFormat.h:
* Source/WebCore/platform/graphics/DestinationColorSpace.cpp:
* Source/WebCore/platform/graphics/DestinationColorSpace.h:
* Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.cpp:
* Source/WebCore/platform/graphics/Float16ArrayPixelBuffer.h:
* Source/WebCore/platform/graphics/GraphicsLayer.h:
* Source/WebCore/platform/graphics/GraphicsLayerClient.h:
* Source/WebCore/platform/graphics/ImageBufferPixelFormat.h:
* Source/WebCore/platform/graphics/PixelBuffer.cpp:
* Source/WebCore/platform/graphics/PixelBuffer.h:
* Source/WebCore/platform/graphics/PixelBufferConversion.cpp:
* Source/WebCore/platform/graphics/PixelFormat.cpp:
* Source/WebCore/platform/graphics/PixelFormat.h:
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayer.mm:
* Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h:
* Source/WebCore/platform/graphics/ca/cocoa/ContentsFormatCocoa.h:
* Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
* Source/WebCore/platform/graphics/cg/NativeImageCG.cpp:
* Source/WebCore/platform/graphics/cocoa/IOSurface.h:
* Source/WebCore/platform/graphics/cocoa/IOSurface.mm:
* Source/WebCore/platform/ios/PlatformScreenIOS.mm:
* Source/WebCore/platform/mac/PlatformScreenMac.mm:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
* Source/WebCore/rendering/RenderLayerCompositor.h:
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:

Canonical link: https://commits.webkit.org/289827@main
@webkit-commit-queue
Copy link
Collaborator

Committed 289827@main (742d687): https://commits.webkit.org/289827@main

Reviewed commits have been landed. Closing PR #39924 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 742d687 into WebKit:main Feb 4, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform Portability improvements and other general platform improvements not driven directly by site bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants