Bug 293450

Summary: [HDR] Avoid colorSpace transformation and double caching when sharing an image with GPUProcess
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: ImagesAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: sabouhallawa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Said Abou-Hallawa
Reported 2025-05-22 13:48:43 PDT
Currently ShareableBitmap shares an image with GPUProcess by drawing it to a SharedMemory only if its colorSpace is not sRGB. Otherwise it uses the data provider to copy the pixels to a SharedMemory. In addition to the SharedMemory, the image metadata which is stored in ShareableBitmapConfiguration, GPUProcess can construct the original image. Also NativeImage::draw() does the tone-mapping to SDR in WebProcess before sharing the image with GPUProcess. It does this by drawing the image to an SDR unaccelerated ImageBuffer. But this forces RemoteResourceCacheProxy to double cache the image: one copy for the SDR and the other copy for the HDR. These two steps can be avoided if (1) the data provider approach is used for any colorSpace (2) the system tone-mapping APIs are used to tone-map the HDR image to SDR.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-05-22 13:50:49 PDT
Said Abou-Hallawa
Comment 2 2025-05-22 13:55:09 PDT
Said Abou-Hallawa
Comment 3 2025-06-05 10:04:48 PDT
*** Bug 292679 has been marked as a duplicate of this bug. ***
EWS
Comment 4 2025-06-05 17:43:25 PDT
Committed 295899@main (1cfbc06323c8): <https://commits.webkit.org/295899@main> Reviewed commits have been landed. Closing PR #45787 and removing active labels.
Said Abou-Hallawa
Comment 5 2025-06-13 10:42:52 PDT
*** Bug 288881 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.