File tree Expand file tree Collapse file tree
packages/react-native-nitro-image/ios Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,19 +55,19 @@ class HybridImageFactory: HybridImageFactorySpec {
5555 /**
5656 * Load Image from the given raw ArrayBuffer data
5757 */
58- func loadFromRawPixelData( data: RawPixelData ) throws -> any HybridImageSpec {
58+ func loadFromRawPixelData( data: RawPixelData , allowGpu _ : Bool ? ) throws -> any HybridImageSpec {
5959 let uiImage = try UIImage ( fromRawPixelData: data)
6060 return HybridImage ( uiImage: uiImage)
6161 }
6262
63- func loadFromRawPixelDataAsync( data: RawPixelData ) throws -> Promise < any HybridImageSpec > {
63+ func loadFromRawPixelDataAsync( data: RawPixelData , allowGpu : Bool ? ) throws -> Promise < any HybridImageSpec > {
6464 let dataCopy = data. buffer. isOwner ? data. buffer : ArrayBuffer . copy ( of: data. buffer)
6565 let newData = RawPixelData ( buffer: dataCopy,
6666 width: data. width,
6767 height: data. height,
6868 pixelFormat: data. pixelFormat)
6969 return Promise . async {
70- return try self . loadFromRawPixelData ( data: newData)
70+ return try self . loadFromRawPixelData ( data: newData, allowGpu : allowGpu )
7171 }
7272 }
7373
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class HybridImageLoaderFactory: HybridImageLoaderFactorySpec {
3131
3232 func createRawPixelDataImageLoader( data: RawPixelData ) throws -> any HybridImageLoaderSpec {
3333 return HybridImageLoader ( load: {
34- try self . imageFactory. loadFromRawPixelDataAsync ( data: data)
34+ try self . imageFactory. loadFromRawPixelDataAsync ( data: data, allowGpu : false )
3535 } )
3636 }
3737
You can’t perform that action at this time.
0 commit comments