Bug 253275 - REGRESSION(260512@main): HDR images should be drawn directly if the destination context has HDR color space
Summary: REGRESSION(260512@main): HDR images should be drawn directly if the destinati...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-02 15:36 PST by Said Abou-Hallawa
Modified: 2023-03-03 17:28 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2023-03-02 15:36:15 PST
When playing some HDR videos, RemoteMediaPlayerManagerProxy::bitmapImageForCurrentTime() may create a ShareableBitmap with HDR colorSpace which it gets it from MediaPlayer. In this case, the workaround in NativeImage::draw() will cause recursion.

The workaround draws the HDR NativeImage to a temporary ImageBuffer. This temporary ImageBuffer will have HDR colorSpace also because it will match the colorSpace of destinationContext which is the colorSpace of MediaPlayer. When we call ImageBuffer::draw(), a temporary NativeImage will be created from this ImageBuffer. This NativeImage will have HDR colorSpace also. So when NativeImage::draw() is called from ImageBuffer::draw(), it will go through the workaround code path again. This will cause an infinite recursion.
Comment 1 Said Abou-Hallawa 2023-03-02 15:37:34 PST
rdar://106055782
Comment 2 Said Abou-Hallawa 2023-03-02 15:50:49 PST
Pull request: https://github.com/WebKit/WebKit/pull/10970
Comment 3 Said Abou-Hallawa 2023-03-02 18:02:15 PST
rdar://106017462
Comment 4 EWS 2023-03-03 09:13:23 PST
Committed 261149@main (9180e60fc30a): <https://commits.webkit.org/261149@main>

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