diff --git a/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm b/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm index b26df26ca9a8c..a4abff98d5fb7 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm @@ -4,6 +4,7 @@ #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.h" +#include #include #include #include @@ -316,9 +317,9 @@ - (IOSurface*)createIOSurface { if (self.colorspace != nil) { CFStringRef name = CGColorSpaceGetName(self.colorspace); - IOSurfaceSetValue(res, CFSTR("IOSurfaceColorSpace"), name); + IOSurfaceSetValue(res, kIOSurfaceColorSpace, name); } else { - IOSurfaceSetValue(res, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB); + IOSurfaceSetValue(res, kIOSurfaceColorSpace, kCGColorSpaceSRGB); } return (__bridge_transfer IOSurface*)res; } diff --git a/shell/platform/darwin/ios/framework/Source/IOKit.h b/shell/platform/darwin/ios/framework/Source/IOKit.h index 53e8fe1b35eb4..4b1e8446af4b6 100644 --- a/shell/platform/darwin/ios/framework/Source/IOKit.h +++ b/shell/platform/darwin/ios/framework/Source/IOKit.h @@ -25,7 +25,7 @@ extern "C" { #define IOKIT #include -static const char* kIOServicePlane = "IOService"; +constexpr const char* kIOServicePlane = "IOService"; typedef io_object_t io_registry_entry_t; typedef io_object_t io_service_t; diff --git a/shell/platform/darwin/macos/framework/Source/FlutterSurface.mm b/shell/platform/darwin/macos/framework/Source/FlutterSurface.mm index 109740942621d..83c4ea2f8ebb6 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterSurface.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterSurface.mm @@ -4,6 +4,7 @@ #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterSurface.h" +#import #import #import "flutter/fml/platform/darwin/cf_utils.h" @@ -74,7 +75,7 @@ + (FlutterSurface*)fromFlutterMetalTexture:(const FlutterMetalTexture*)texture { } + (IOSurfaceRef)createIOSurfaceWithSize:(CGSize)size { - unsigned pixelFormat = 'BGRA'; + unsigned pixelFormat = kCVPixelFormatType_32BGRA; unsigned bytesPerElement = 4; size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, size.width * bytesPerElement); @@ -89,7 +90,7 @@ + (IOSurfaceRef)createIOSurfaceWithSize:(CGSize)size { }; IOSurfaceRef res = IOSurfaceCreate((CFDictionaryRef)options); - IOSurfaceSetValue(res, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB); + IOSurfaceSetValue(res, kIOSurfaceColorSpace, kCGColorSpaceSRGB); return res; }