Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] Disable the wide gamut settings flag on iOS simulators #42331

Merged
merged 1 commit into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,15 @@
settings.domain_network_policy = "";

// Whether to enable wide gamut colors.
#if TARGET_OS_SIMULATOR
// As of Xcode 14.1, the wide gamut surface pixel formats are not supported by
// the simulator.
settings.enable_wide_gamut = false;
#else
NSNumber* nsEnableWideGamut = [mainBundle objectForInfoDictionaryKey:@"FLTEnableWideGamut"];
BOOL enableWideGamut = nsEnableWideGamut ? nsEnableWideGamut.boolValue : YES;
settings.enable_wide_gamut = enableWideGamut;
#endif

// TODO(dnfield): We should reverse the order for all these settings so that command line options
// are preferred to plist settings. https://github.com/flutter/flutter/issues/124049
Expand Down
8 changes: 1 addition & 7 deletions shell/platform/darwin/ios/framework/Source/FlutterView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ - (UIScreen*)screen {
}

- (BOOL)isWideGamutSupported {
#if TARGET_OS_SIMULATOR
// As of Xcode 14.1, the wide gamut surface pixel formats are not supported by
// the simulator.
return NO;
#endif

if (![_delegate isUsingImpeller]) {
return NO;
}
Expand All @@ -74,7 +68,7 @@ - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
if (self) {
_delegate = delegate;
_isWideGamutEnabled = isWideGamutEnabled;
if (_isWideGamutEnabled && self.isWideGamutSupported) {
if (_isWideGamutEnabled && !self.isWideGamutSupported) {
FML_DLOG(WARNING) << "Rendering wide gamut colors is turned on but isn't "
"supported, downgrading the color gamut to sRGB.";
}
Expand Down