Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit fc8d365

Browse files
authored
Turned off wide gamut color pixel format for the simulator since it (#39825)
Turned off wide gamut color pixel format for the simulator
1 parent c0744c3 commit fc8d365

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

shell/platform/darwin/ios/framework/Source/FlutterView.mm

+10
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
#include "third_party/skia/include/utils/mac/SkCGUtils.h"
1818

1919
static BOOL IsWideGamutSupported() {
20+
#if TARGET_OS_SIMULATOR
21+
// As of Xcode 14.1, the wide gamut surface pixel formats are not supported by
22+
// the simulator.
23+
return NO;
24+
#else
2025
// This predicates the decision on the capabilities of the iOS device's
2126
// display. This means external displays will not support wide gamut if the
2227
// device's display doesn't support it. It practice that should be never.
2328
return UIScreen.mainScreen.traitCollection.displayGamut != UIDisplayGamutSRGB;
29+
#endif
2430
}
2531

2632
@implementation FlutterView {
@@ -57,6 +63,10 @@ - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
5763
if (self) {
5864
_delegate = delegate;
5965
_isWideGamutEnabled = isWideGamutEnabled;
66+
if (_isWideGamutEnabled && !IsWideGamutSupported()) {
67+
FML_DLOG(WARNING) << "Rendering wide gamut colors is turned on but isn't "
68+
"supported, downgrading the color gamut to sRGB.";
69+
}
6070
self.layer.opaque = opaque;
6171

6272
// This line is necessary. CoreAnimation(or UIKit) may take this to do

0 commit comments

Comments
 (0)