iOS: add ios.metal.colorSpace build hint for the Metal renderer#4909
Merged
shai-almog merged 1 commit intomasterfrom May 10, 2026
Merged
iOS: add ios.metal.colorSpace build hint for the Metal renderer#4909shai-almog merged 1 commit intomasterfrom
shai-almog merged 1 commit intomasterfrom
Conversation
Issue #4908 surfaces that Metal's hard-coded sRGB layer colour space is not the right pick for every app (wide-gamut content, custom DeviceRGB pipelines, or apps that prefer the system default). METALView.m now selects the CAMetalLayer colorspace from a compile-time CN1_METAL_COLORSPACE_* define and falls back to sRGB so existing builds are unchanged. IPhoneBuilder reads the new ios.metal.colorSpace hint (values: sRGB, displayP3, deviceRGB, linearSRGB, extendedSRGB, extendedLinearSRGB, none) and rewrites a placeholder line in CN1ES2compat.h with the matching define when ios.metal=true. The same change is mirrored in the build server's IPhoneBuilder; the developer guide gets a new section under Working with iOS describing each value. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks:
Unused image preview:
|
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Contributor
Cloudflare Preview
|
Collaborator
Author
|
Compared 90 screenshots: 90 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 90 screenshots: 90 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 90 screenshots: 90 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ios.metal.colorSpacebuild hint that lets apps pick theCAMetalLayercolour space instead of being stuck with the hard-coded sRGB choice (issue partial transparency persists, even to new frame drawing events. #4908).METALView.mnow selects the colorspace from a compile-timeCN1_METAL_COLORSPACE_*define and falls back to sRGB so existing builds are unchanged.IPhoneBuilderreads the hint whenios.metal=trueand rewrites a placeholder line inCN1ES2compat.h. Accepted values:sRGB(default),displayP3,deviceRGB,linearSRGB,extendedSRGB,extendedLinearSRGB,none(leaves the layer's colorspace unset).docs/developer-guide/Working-With-iOS.asciidocdocuments the values.Companion change for the build server: codenameone/BuildDaemon#73.
Test plan
ios.metal=trueand no colour-space hint — visual output unchanged from the previous sRGB-only behaviour.ios.metal=trueandios.metal.colorSpace=displayP3on a P3 device, confirm wide-gamut artwork renders with extended saturation.ios.metal.colorSpace=noneand confirm the layer falls back to the system default without crashing.ios.metal=falseto confirm the new code path is dormant.🤖 Generated with Claude Code