Skip to content

Commit 950bca7

Browse files
authored
fix(⬆️): Upgrade to Skia m130 (#2648)
1 parent 32cd6cf commit 950bca7

File tree

481 files changed

+165
-87548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+165
-87548
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ local.properties
5050
.settings/
5151

5252
# Externals
53-
libs
54-
package/cpp/skia/
53+
packages/skia/libs
54+
packages/skia/cpp/skia/
5555

5656
# BUCK
5757
buck-out/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[submodule "externals/skia"]
22
path = externals/skia
33
url = https://chromium.googlesource.com/skia/
4-
branch = chrome/m123
4+
branch = chrome/m130
55
[submodule "externals/depot_tools"]
66
path = externals/depot_tools
77
url = https://chromium.googlesource.com/chromium/tools/depot_tools.git
-1.07 KB
Loading

apps/paper/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ SPEC CHECKSUMS:
19111911
React-Mapbuffer: 1c08607305558666fd16678b85ef135e455d5c96
19121912
React-microtasksnativemodule: 87b8de96f937faefece8afd2cb3a518321b2ef99
19131913
react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a
1914-
react-native-skia: 94c1a75519ba65c8450f21867358739486b1992b
1914+
react-native-skia: b1f33ae82bb728aee1d1602a6adfaee52af43f61
19151915
react-native-slider: 97ce0bd921f40de79cead9754546d5e4e7ba44f8
19161916
React-nativeconfig: 57781b79e11d5af7573e6f77cbf1143b71802a6d
19171917
React-NativeModulesApple: 7ff2e2cfb2e5fa5bdedcecf28ce37e696c6ef1e1

apps/paper/ios/paper.xcodeproj/project.pbxproj

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

apps/paper/ios/paper.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

Lines changed: 0 additions & 8 deletions
This file was deleted.

externals/skia

Submodule skia updated from aeae226 to 0f81dc8

packages/skia/android/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ set (SKIA_LIB "skia")
1010
set (SKIA_SVG_LIB "svg")
1111
set (SKIA_SKSHAPER_LIB "skshaper")
1212
set (SKIA_SKPARAGRAPH_LIB "skparagraph")
13-
set (SKIA_SKUNICODE_LIB "skunicode")
13+
set (SKIA_SKUNICODE_CORE_LIB "skunicode_core")
14+
set (SKIA_SKUNICODE_ICU_LIB "skunicode_icu")
1415

1516
# Clear some variables
1617
unset(LIBRN_DIR CACHE)
@@ -116,8 +117,11 @@ set_property(TARGET skshaper PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libsk
116117
add_library(skparagraph STATIC IMPORTED)
117118
set_property(TARGET skparagraph PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskparagraph.a")
118119

119-
add_library(skunicode STATIC IMPORTED)
120-
set_property(TARGET skunicode PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskunicode.a")
120+
add_library(skunicode_core STATIC IMPORTED)
121+
set_property(TARGET skunicode_core PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskunicode_core.a")
122+
123+
add_library(skunicode_icu STATIC IMPORTED)
124+
set_property(TARGET skunicode_icu PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libskunicode_icu.a")
121125

122126

123127
find_library(
@@ -235,7 +239,8 @@ target_link_libraries(
235239
${SKIA_SVG_LIB}
236240
${SKIA_SKSHAPER_LIB}
237241
${SKIA_SKPARAGRAPH_LIB}
238-
${SKIA_SKUNICODE_LIB}
242+
${SKIA_SKUNICODE_CORE_LIB}
243+
${SKIA_SKUNICODE_ICU_LIB}
239244
${SKIA_LIB}
240245
-ljnigraphics
241246
-lGLESv2

packages/skia/cpp/api/JsiSkPath.h

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "include/pathops/SkPathOps.h"
2828
#include "include/utils/SkParsePath.h"
2929
#include "include/utils/SkTextUtils.h"
30-
#include "src/core/SkPathPriv.h"
3130

3231
#pragma clang diagnostic pop
3332

@@ -510,51 +509,54 @@ class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
510509
return jsi::Object::createFromHostObject(
511510
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(result)));
512511
}
513-
514512
JSI_HOST_FUNCTION(toCmds) {
515513
auto path = *getObject();
516-
auto cmds = jsi::Array(runtime, path.countVerbs());
517-
auto j = 0;
518-
for (auto [verb, pts, w] : SkPathPriv::Iterate(path)) {
514+
std::vector<jsi::Array> cmdList;
515+
SkPoint pts[4];
516+
SkPath::Iter iter(path, false);
517+
SkPath::Verb verb;
518+
519+
while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
519520
switch (verb) {
520-
case SkPathVerb::kMove: {
521+
case SkPath::kMove_Verb: {
521522
auto cmd = jsi::Array(runtime, 3);
522523
cmd.setValueAtIndex(runtime, 0, static_cast<double>(MOVE));
523524
cmd.setValueAtIndex(runtime, 1, static_cast<double>(pts[0].x()));
524525
cmd.setValueAtIndex(runtime, 2, static_cast<double>(pts[0].y()));
525-
cmds.setValueAtIndex(runtime, j, cmd);
526+
cmdList.push_back(std::move(cmd));
526527
break;
527528
}
528-
case SkPathVerb::kLine: {
529+
case SkPath::kLine_Verb: {
529530
auto cmd = jsi::Array(runtime, 3);
530531
cmd.setValueAtIndex(runtime, 0, static_cast<double>(LINE));
531532
cmd.setValueAtIndex(runtime, 1, static_cast<double>(pts[1].x()));
532533
cmd.setValueAtIndex(runtime, 2, static_cast<double>(pts[1].y()));
533-
cmds.setValueAtIndex(runtime, j, cmd);
534+
cmdList.push_back(std::move(cmd));
534535
break;
535536
}
536-
case SkPathVerb::kQuad: {
537+
case SkPath::kQuad_Verb: {
537538
auto cmd = jsi::Array(runtime, 5);
538539
cmd.setValueAtIndex(runtime, 0, static_cast<double>(QUAD));
539540
cmd.setValueAtIndex(runtime, 1, static_cast<double>(pts[1].x()));
540541
cmd.setValueAtIndex(runtime, 2, static_cast<double>(pts[1].y()));
541542
cmd.setValueAtIndex(runtime, 3, static_cast<double>(pts[2].x()));
542543
cmd.setValueAtIndex(runtime, 4, static_cast<double>(pts[2].y()));
543-
cmds.setValueAtIndex(runtime, j, cmd);
544+
cmdList.push_back(std::move(cmd));
544545
break;
545546
}
546-
case SkPathVerb::kConic: {
547+
case SkPath::kConic_Verb: {
547548
auto cmd = jsi::Array(runtime, 6);
548549
cmd.setValueAtIndex(runtime, 0, static_cast<double>(CONIC));
549550
cmd.setValueAtIndex(runtime, 1, static_cast<double>(pts[1].x()));
550551
cmd.setValueAtIndex(runtime, 2, static_cast<double>(pts[1].y()));
551552
cmd.setValueAtIndex(runtime, 3, static_cast<double>(pts[2].x()));
552553
cmd.setValueAtIndex(runtime, 4, static_cast<double>(pts[2].y()));
553-
cmd.setValueAtIndex(runtime, 5, static_cast<double>(*w));
554-
cmds.setValueAtIndex(runtime, j, cmd);
554+
cmd.setValueAtIndex(runtime, 5,
555+
static_cast<double>(iter.conicWeight()));
556+
cmdList.push_back(std::move(cmd));
555557
break;
556558
}
557-
case SkPathVerb::kCubic: {
559+
case SkPath::kCubic_Verb: {
558560
auto cmd = jsi::Array(runtime, 7);
559561
cmd.setValueAtIndex(runtime, 0, static_cast<double>(CUBIC));
560562
cmd.setValueAtIndex(runtime, 1, static_cast<double>(pts[1].x()));
@@ -563,18 +565,26 @@ class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
563565
cmd.setValueAtIndex(runtime, 4, static_cast<double>(pts[2].y()));
564566
cmd.setValueAtIndex(runtime, 5, static_cast<double>(pts[3].x()));
565567
cmd.setValueAtIndex(runtime, 6, static_cast<double>(pts[3].y()));
566-
cmds.setValueAtIndex(runtime, j, cmd);
568+
cmdList.push_back(std::move(cmd));
567569
break;
568570
}
569-
case SkPathVerb::kClose: {
571+
case SkPath::kClose_Verb: {
570572
auto cmd = jsi::Array(runtime, 1);
571573
cmd.setValueAtIndex(runtime, 0, static_cast<double>(CLOSE));
572-
cmds.setValueAtIndex(runtime, j, cmd);
574+
cmdList.push_back(std::move(cmd));
573575
break;
574576
}
577+
default:
578+
break;
575579
}
576-
j++;
577580
}
581+
582+
// Create the jsi::Array with the exact size
583+
auto cmds = jsi::Array(runtime, cmdList.size());
584+
for (size_t i = 0; i < cmdList.size(); ++i) {
585+
cmds.setValueAtIndex(runtime, i, cmdList[i]);
586+
}
587+
578588
return cmds;
579589
}
580590

packages/skia/cpp/api/JsiSkRuntimeEffect.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ namespace RNSkia {
2222

2323
namespace jsi = facebook::jsi;
2424

25+
// Helper to see a bit pattern as a float (w/o aliasing warnings)
26+
static inline float SkBits2Float(uint32_t bits) {
27+
float value;
28+
memcpy(&value, &bits, sizeof(float));
29+
return value;
30+
}
31+
2532
struct RuntimeEffectUniform {
2633
int columns;
2734
int rows;

0 commit comments

Comments
 (0)