Bug 247254

Summary: UI-process mapped IOSurfaces are always tagged as sRGB
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: WebKit Process ModelAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: g_squelart, heycam, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description Simon Fraser (smfr) 2022-10-30 23:12:32 PDT
static void recursivelyMapIOSurfaceBackingStore(CALayer *layer)
{
    if (layer.contents && CFGetTypeID((__bridge CFTypeRef)layer.contents) == CAMachPortGetTypeID()) {
        MachSendRight port = MachSendRight::create(CAMachPortGetPort((__bridge CAMachPortRef)layer.contents));
        auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(port), WebCore::DestinationColorSpace::SRGB());
        layer.contents = surface ? surface->asLayerContents() : nil;
    }


DestinationColorSpace::SRGB!
Comment 1 Simon Fraser (smfr) 2022-10-30 23:19:35 PDT
Also:
                case RemoteLayerBackingStore::LayerContentsType::IOSurface: {
                    auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(machSendRight), DestinationColorSpace::SRGB());
                    contents = surface ? surface->asLayerContents() : nil;
                    break;
Comment 2 Radar WebKit Bug Importer 2022-10-31 09:16:05 PDT
<rdar://problem/101760075>
Comment 3 Simon Fraser (smfr) 2023-04-06 16:47:47 PDT
Fixed in https://bugs.webkit.org/show_bug.cgi?id=247776

*** This bug has been marked as a duplicate of bug 247776 ***