Skip to content

Commit 4766ee9

Browse files
authored
Merge pull request #519 from Shopify/feature/491-upgrade-skia-m103
Upgrade skia to Release M103
2 parents c7fe708 + 436a40d commit 4766ee9

File tree

7 files changed

+13
-22
lines changed

7 files changed

+13
-22
lines changed

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ SPEC CHECKSUMS:
571571
React-jsinspector: 90f0bfd5d04e0b066c29216a110ffb9a6c34f23f
572572
React-logger: 8474fefa09d05f573a13c044cb0dfd751d4e52e3
573573
react-native-safe-area-context: f98b0b16d1546d208fc293b4661e3f81a895afd9
574-
react-native-skia: 36624327c4ecaf4412a5907ff1e8412aa9b4eb76
574+
react-native-skia: 57f0f077c9acde81e26caa35d7d8958439762d14
575575
React-perflogger: 15cb741d6c2379f4d3fc8f9e4d4e1110ef3020cb
576576
React-RCTActionSheet: ea9099db0597bd769430db1e2d011fd5fdb7fc5e
577577
React-RCTAnimation: 252df4749866f2654f37612f839522cac91c1165

externals/skia

Submodule skia updated from 51988d0 to b301ff0

package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "include/gpu/GrDirectContext.h"
1717
#include "include/gpu/gl/GrGLInterface.h"
18+
#include <SkColorSpace.h>
1819
#include <SkCanvas.h>
1920
#include <SkSurface.h>
2021
#include <SkPicture.h>

package/cpp/api/JsiSkRuntimeEffect.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ namespace RNSkia
4444
JSI_HOST_FUNCTION(makeShader)
4545
{
4646
auto uniforms = castUniforms(runtime, arguments[0]);
47-
auto isOpaque = count >= 2 && arguments[1].isBool() ? arguments[1].getBool() : false;
48-
auto matrix = count >= 3 && !arguments[2].isUndefined() && !arguments[2].isNull() ? JsiSkMatrix::fromValue(runtime, arguments[2]).get() : nullptr;
47+
48+
auto matrix = count >= 2 && !arguments[1].isUndefined() && !arguments[1].isNull() ? JsiSkMatrix::fromValue(runtime, arguments[1]).get() : nullptr;
4949

5050
// Create and return shader as host object
51-
auto shader = getObject()->makeShader(std::move(uniforms), nullptr,
52-
0, matrix, isOpaque);
51+
auto shader = getObject()->makeShader(std::move(uniforms), nullptr, 0, matrix);
5352

5453
return jsi::Object::createFromHostObject(
5554
runtime, std::make_shared<JsiSkShader>(getContext(), std::move(shader)));
@@ -58,11 +57,10 @@ namespace RNSkia
5857
JSI_HOST_FUNCTION(makeShaderWithChildren)
5958
{
6059
auto uniforms = castUniforms(runtime, arguments[0]);
61-
auto isOpaque = count >= 2 && arguments[1].isBool() ? arguments[1].getBool() : false;
62-
60+
6361
// Children
6462
std::vector<sk_sp<SkShader>> children;
65-
auto jsiChildren = arguments[2].asObject(runtime).asArray(runtime);
63+
auto jsiChildren = arguments[1].asObject(runtime).asArray(runtime);
6664
auto jsiChildCount = jsiChildren.size(runtime);
6765
children.reserve(jsiChildCount);
6866
for (int i = 0; i < jsiChildCount; i++)
@@ -74,11 +72,11 @@ namespace RNSkia
7472
children.push_back(shader);
7573
}
7674

77-
auto matrix = count >= 4 && !arguments[3].isUndefined() && !arguments[3].isNull() ? JsiSkMatrix::fromValue(runtime, arguments[3]).get() : nullptr;
75+
auto matrix = count >= 3 && !arguments[2].isUndefined() && !arguments[2].isNull() ? JsiSkMatrix::fromValue(runtime, arguments[2]).get() : nullptr;
7876

7977
// Create and return shader as host object
8078
auto shader = getObject()->makeShader(std::move(uniforms), children.data(),
81-
children.size(), matrix, isOpaque);
79+
children.size(), matrix);
8280

8381
return jsi::Object::createFromHostObject(
8482
runtime, std::make_shared<JsiSkShader>(getContext(), std::move(shader)));

package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#pragma clang diagnostic push
44
#pragma clang diagnostic ignored "-Wdocumentation"
55

6+
#import <SkColorSpace.h>
67
#import <SkSurface.h>
78
#import <SkCanvas.h>
89

package/src/renderer/components/shaders/Shader.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ const processValue = (value: UniformValue): number | readonly number[] => {
3030
export interface ShaderProps extends TransformProps {
3131
source: SkRuntimeEffect;
3232
uniforms: Uniforms;
33-
opaque?: boolean;
3433
children?: ReactNode | ReactNode[];
3534
}
3635

3736
const onDeclare = createDeclaration<ShaderProps>(
38-
({ uniforms, source, opaque, ...transform }, children) => {
37+
({ uniforms, source, ...transform }, children) => {
3938
const processedUniforms = new Array(source.getUniformCount())
4039
.fill(0)
4140
.flatMap((_, i) => {
@@ -68,7 +67,6 @@ const onDeclare = createDeclaration<ShaderProps>(
6867
}
6968
return source.makeShaderWithChildren(
7069
processedUniforms,
71-
opaque,
7270
children.filter(isShader),
7371
localMatrix(transform)
7472
);

package/src/skia/types/RuntimeEffect/RuntimeEffect.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,18 @@ export interface SkRuntimeEffect extends SkJSIInstance<"RuntimeEffect"> {
1616
/**
1717
* Returns a shader executed using the given uniform data.
1818
* @param uniforms
19-
* @param isOpaque
2019
* @param localMatrix
2120
*/
22-
makeShader(
23-
uniforms: number[],
24-
isOpaque?: boolean,
25-
localMatrix?: SkMatrix
26-
): SkShader;
21+
makeShader(uniforms: number[], localMatrix?: SkMatrix): SkShader;
2722

2823
/**
2924
* Returns a shader executed using the given uniform data and the children as inputs.
3025
* @param uniforms
31-
* @param isOpaque
3226
* @param children
3327
* @param localMatrix
3428
*/
3529
makeShaderWithChildren(
3630
uniforms: number[],
37-
isOpaque?: boolean,
3831
children?: SkShader[],
3932
localMatrix?: SkMatrix
4033
): SkShader;

0 commit comments

Comments
 (0)