Bug 247036

Summary: IOSurface size limit in the web content process is too small, only 1024x1024
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bfulgham, pvollan, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Simon Fraser (smfr) 2022-10-25 17:41:53 PDT
Sandboxing causes `IOSurfaceGetPropertyMaximum(kIOSurfaceWidth)` to fail, so we fall back to a maximum IOSurface size of 1024x1024 here:

static IntSize computeMaximumSurfaceSize()
{
#if PLATFORM(IOS)
    return maxSurfaceDimensionCA();
#else
    IntSize maxSize(clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth)), clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceHeight)));

    // Protect against maxSize being { 0, 0 }.
    constexpr int maxSurfaceDimensionLowerBound = 1024;

    return maxSize.constrainedBetween({ maxSurfaceDimensionLowerBound, maxSurfaceDimensionLowerBound }, maxSurfaceDimensionCA() );
#endif
}

Not sure why the iOS code is different.
Comment 1 Radar WebKit Bug Importer 2022-10-25 17:42:18 PDT
<rdar://problem/101569224>
Comment 2 Alexey Proskuryakov 2022-10-26 10:22:17 PDT
What is the correct behavior here, is 1024x1024 bad?
Comment 3 Simon Fraser (smfr) 2022-10-26 10:25:52 PDT
1024x1024 is much too small, causing fallback to software buffers. We need to just share the iOS code.
Comment 4 Simon Fraser (smfr) 2022-11-02 16:49:20 PDT
Pull request: https://github.com/WebKit/WebKit/pull/6062
Comment 5 EWS 2022-11-05 11:51:30 PDT
Committed 256359@main (2bce581d4f10): <https://commits.webkit.org/256359@main>

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