Bug 247036 - IOSurface size limit in the web content process is too small, only 1024x1024
Summary: IOSurface size limit in the web content process is too small, only 1024x1024
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-25 17:41 PDT by Simon Fraser (smfr)
Modified: 2022-11-05 11:51 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.