This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree 1 file changed +10
-0
lines changed
shell/platform/darwin/ios/framework/Source
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 17
17
#include " third_party/skia/include/utils/mac/SkCGUtils.h"
18
18
19
19
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
20
25
// This predicates the decision on the capabilities of the iOS device's
21
26
// display. This means external displays will not support wide gamut if the
22
27
// device's display doesn't support it. It practice that should be never.
23
28
return UIScreen.mainScreen .traitCollection .displayGamut != UIDisplayGamutSRGB;
29
+ #endif
24
30
}
25
31
26
32
@implementation FlutterView {
@@ -57,6 +63,10 @@ - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
57
63
if (self) {
58
64
_delegate = delegate;
59
65
_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
+ }
60
70
self.layer .opaque = opaque;
61
71
62
72
// This line is necessary. CoreAnimation(or UIKit) may take this to do
You can’t perform that action at this time.
0 commit comments