@shopify/react-native-skia 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java
CHANGED
|
@@ -12,11 +12,9 @@ package com.facebook.react.viewmanagers;
|
|
|
12
12
|
import android.view.View;
|
|
13
13
|
import androidx.annotation.Nullable;
|
|
14
14
|
|
|
15
|
-
import com.shopify.reactnative.skia.SkiaPictureView;
|
|
16
|
-
|
|
17
15
|
public interface SkiaPictureViewManagerInterface<T extends View> {
|
|
18
16
|
void setDebug(T view, boolean value);
|
|
19
17
|
void setOpaque(T view, boolean value);
|
|
20
|
-
void setColorSpace(
|
|
18
|
+
void setColorSpace(T view, @Nullable String value);
|
|
21
19
|
void setAndroidWarmup(T view, boolean value);
|
|
22
20
|
}
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
|
|
51
51
|
// Convert from UIImage -> CGImage -> SkImage
|
|
52
52
|
CGImageRef cgImage = image.CGImage;
|
|
53
|
+
if (!cgImage) {
|
|
54
|
+
return nullptr;
|
|
55
|
+
}
|
|
53
56
|
|
|
54
57
|
// Get some info about the image
|
|
55
58
|
auto width = CGImageGetWidth(cgImage);
|
|
@@ -59,6 +62,9 @@
|
|
|
59
62
|
// Convert from UIImage -> SkImage, start by getting the pixels directly from
|
|
60
63
|
// the CGImage:
|
|
61
64
|
auto dataRef = CGDataProviderCopyData(CGImageGetDataProvider(cgImage));
|
|
65
|
+
if (!dataRef) {
|
|
66
|
+
return nullptr;
|
|
67
|
+
}
|
|
62
68
|
auto length = CFDataGetLength(dataRef);
|
|
63
69
|
void *data = CFDataGetMutableBytePtr((CFMutableDataRef)dataRef);
|
|
64
70
|
|