@hxa-rn/react-native-gcanvas 6.0.24-beta.1 → 6.0.26

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE +203 -21
  3. package/README.md +207 -207
  4. package/harmony/gcanvas/LICENSE +203 -21
  5. package/harmony/gcanvas/NOTICE +32 -32
  6. package/harmony/gcanvas/OAT.xml +37 -37
  7. package/harmony/gcanvas/build-profile.json5 +16 -16
  8. package/harmony/gcanvas/hvigorfile.ts +1 -1
  9. package/harmony/gcanvas/index.ets +1 -1
  10. package/harmony/gcanvas/oh-package.json5 +14 -14
  11. package/harmony/gcanvas/src/main/cpp/CMakeLists.txt +126 -126
  12. package/harmony/gcanvas/src/main/cpp/GCanvasNapi.cpp +485 -485
  13. package/harmony/gcanvas/src/main/cpp/GCanvasXComponent.cpp +106 -106
  14. package/harmony/gcanvas/src/main/cpp/GcanvasPackage.h +24 -24
  15. package/harmony/gcanvas/src/main/ets/GCanvasModuleTurboModule.ts +448 -448
  16. package/harmony/gcanvas/src/main/ets/GCanvasNativeEngine.ts +206 -206
  17. package/harmony/gcanvas/src/main/ets/components/GCanvasView.ets +64 -64
  18. package/harmony/gcanvas/src/main/module.json5 +21 -21
  19. package/harmony/gcanvas/src/main/resources/base/element/string.json +12 -12
  20. package/harmony/gcanvas/src/main/resources/en_US/element/string.json +8 -8
  21. package/harmony/gcanvas/src/main/resources/zh_CN/element/string.json +12 -12
  22. package/harmony/gcanvas.har +0 -0
  23. package/package.json +4 -4
  24. package/packages/gcanvas/.babelrc +4 -4
  25. package/packages/gcanvas/.eslintrc.js +133 -133
  26. package/packages/gcanvas/package.json +19 -19
  27. package/packages/gcanvas/rollup.config.js +13 -13
  28. package/packages/gcanvas/src/bridge/react-native.js +286 -286
  29. package/packages/gcanvas/src/bridge/weex.js +210 -210
  30. package/packages/gcanvas/src/context/2d/FillStyleLinearGradient.js +16 -16
  31. package/packages/gcanvas/src/context/2d/FillStylePattern.js +7 -7
  32. package/packages/gcanvas/src/context/2d/FillStyleRadialGradient.js +16 -16
  33. package/packages/gcanvas/src/context/2d/OffScreenRenderingContext.js +48 -48
  34. package/packages/gcanvas/src/context/2d/RenderingContext.js +787 -787
  35. package/packages/gcanvas/src/context/webgl/ActiveInfo.js +10 -10
  36. package/packages/gcanvas/src/context/webgl/Buffer.js +20 -20
  37. package/packages/gcanvas/src/context/webgl/Framebuffer.js +20 -20
  38. package/packages/gcanvas/src/context/webgl/GLenum.js +300 -300
  39. package/packages/gcanvas/src/context/webgl/GLmethod.js +141 -141
  40. package/packages/gcanvas/src/context/webgl/GLtype.js +22 -22
  41. package/packages/gcanvas/src/context/webgl/Program.js +20 -20
  42. package/packages/gcanvas/src/context/webgl/Renderbuffer.js +20 -20
  43. package/packages/gcanvas/src/context/webgl/RenderingContext.js +1479 -1479
  44. package/packages/gcanvas/src/context/webgl/Shader.js +21 -21
  45. package/packages/gcanvas/src/context/webgl/ShaderPrecisionFormat.js +10 -10
  46. package/packages/gcanvas/src/context/webgl/Texture.js +21 -21
  47. package/packages/gcanvas/src/context/webgl/UniformLocation.js +21 -21
  48. package/packages/gcanvas/src/context/webgl/classUtils.js +2 -2
  49. package/packages/gcanvas/src/env/canvas.js +210 -210
  50. package/packages/gcanvas/src/env/image.js +76 -76
  51. package/packages/gcanvas/src/env/off-screen-canvas.js +74 -74
  52. package/packages/gcanvas/src/index.js +56 -56
  53. package/src/components/CanvasView.js +20 -20
  54. package/src/components/GCanvasComponent.js +408 -408
  55. package/src/index.js +69 -69
  56. package/src/packages/gcanvas/.babelrc +4 -4
  57. package/src/packages/gcanvas/.eslintrc.js +133 -133
  58. package/src/packages/gcanvas/package.json +19 -19
  59. package/src/packages/gcanvas/rollup.config.js +13 -13
  60. package/src/packages/gcanvas/src/bridge/react-native.js +288 -288
  61. package/src/packages/gcanvas/src/bridge/weex.js +210 -210
  62. package/src/packages/gcanvas/src/context/2d/FillStyleLinearGradient.js +16 -16
  63. package/src/packages/gcanvas/src/context/2d/FillStylePattern.js +7 -7
  64. package/src/packages/gcanvas/src/context/2d/FillStyleRadialGradient.js +16 -16
  65. package/src/packages/gcanvas/src/context/2d/OffScreenRenderingContext.js +48 -48
  66. package/src/packages/gcanvas/src/context/2d/RenderingContext.js +801 -801
  67. package/src/packages/gcanvas/src/context/webgl/ActiveInfo.js +10 -10
  68. package/src/packages/gcanvas/src/context/webgl/Buffer.js +20 -20
  69. package/src/packages/gcanvas/src/context/webgl/Framebuffer.js +20 -20
  70. package/src/packages/gcanvas/src/context/webgl/GLenum.js +300 -300
  71. package/src/packages/gcanvas/src/context/webgl/GLmethod.js +141 -141
  72. package/src/packages/gcanvas/src/context/webgl/GLtype.js +22 -22
  73. package/src/packages/gcanvas/src/context/webgl/Program.js +20 -20
  74. package/src/packages/gcanvas/src/context/webgl/Renderbuffer.js +20 -20
  75. package/src/packages/gcanvas/src/context/webgl/RenderingContext.js +1479 -1479
  76. package/src/packages/gcanvas/src/context/webgl/Shader.js +21 -21
  77. package/src/packages/gcanvas/src/context/webgl/ShaderPrecisionFormat.js +10 -10
  78. package/src/packages/gcanvas/src/context/webgl/Texture.js +21 -21
  79. package/src/packages/gcanvas/src/context/webgl/UniformLocation.js +21 -21
  80. package/src/packages/gcanvas/src/context/webgl/classUtils.js +2 -2
  81. package/src/packages/gcanvas/src/env/canvas.js +210 -210
  82. package/src/packages/gcanvas/src/env/image.js +76 -76
  83. package/src/packages/gcanvas/src/env/off-screen-canvas.js +74 -74
  84. package/src/packages/gcanvas/src/index.js +56 -56
  85. package/src/specs/v1/GCanvasViewNativeComponent.ts +42 -42
  86. package/src/specs/v1/NativeGCanvasModule.ts +140 -140
@@ -1,126 +1,126 @@
1
- # GCanvas 鸿蒙 C++ 库构建配置。
2
- cmake_minimum_required(VERSION 3.13)
3
- set(CMAKE_VERBOSE_MAKEFILE on)
4
- project(gcanvas_library)
5
-
6
- # The public NAPI/XComponent entry remains libgcanvas.so. The vendored
7
- # renderer/core is linked into it as a static implementation library.
8
- set(GCANVAS_WEEX ON)
9
-
10
- # RNOH/RN 头文件(ViewProps.h 等)使用 std::optional,要求 C++17。
11
- set(CMAKE_CXX_STANDARD 17)
12
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
13
-
14
- find_package(react-native-openharmony REQUIRED CONFIG)
15
-
16
- if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/core/CMakeLists.txt")
17
- add_subdirectory(core)
18
- set(GCANVAS_CORE_LIB gcanvas_core)
19
- else()
20
- set(GCANVAS_CORE_LIB "")
21
- endif()
22
-
23
- # 从 imported 目标 rnoh_semi 的库位置反推 RNOH 包根目录。Windows 上可由
24
- # -DRNOH_PKG_ROOT=<short-path> 覆盖,避免 ohpm 哈希目录触发 MAX_PATH。
25
- if(NOT DEFINED RNOH_PKG_ROOT)
26
- get_target_property(_rnoh_semi_loc react-native-openharmony::rnoh_semi IMPORTED_LOCATION)
27
- get_filename_component(_rnoh_pkg_libdir "${_rnoh_semi_loc}" DIRECTORY) # .../libs/arm64-v8a
28
- get_filename_component(_rnoh_pkg_libdir "${_rnoh_pkg_libdir}" DIRECTORY) # .../libs
29
- get_filename_component(RNOH_PKG_ROOT "${_rnoh_pkg_libdir}" DIRECTORY) # <pkg_root>
30
- endif()
31
- set(RNOH_CPP_DIR "${RNOH_PKG_ROOT}/src/main/include")
32
- set(REACT_COMMON_PATCH_DIR "${RNOH_CPP_DIR}/patches/react_native_core")
33
-
34
- set(library_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
35
-
36
- # folly F14 链接一致性:FOLLY_MOBILE=1(failure-lessons testing-cmake-004)。
37
- set(folly_compile_options
38
- -DFOLLY_NO_CONFIG=1
39
- -DFOLLY_MOBILE=1
40
- -DFOLLY_USE_LIBCPP=1
41
- -DFOLLY_HAVE_RECVMMSG=1
42
- -DFOLLY_HAVE_PTHREAD=1
43
- -Wno-comma
44
- -Wno-shorten-64-to-32
45
- -faligned-new
46
- )
47
-
48
- include_directories(
49
- ${CMAKE_CURRENT_SOURCE_DIR}
50
- ${library_generated_dir}
51
- ${RNOH_CPP_DIR}
52
- ${REACT_COMMON_PATCH_DIR}
53
- ${RNOH_CPP_DIR}/third-party/folly
54
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon
55
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/nativemodule/core
56
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/jsi
57
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/callinvoker
58
- ${RNOH_CPP_DIR}/third-party/boost/libs/utility/include
59
- ${RNOH_CPP_DIR}/third-party/boost/libs/stacktrace/include
60
- ${RNOH_CPP_DIR}/third-party/boost/libs/predef/include
61
- ${RNOH_CPP_DIR}/third-party/boost/libs/array/include
62
- ${RNOH_CPP_DIR}/third-party/boost/libs/throw_exception/include
63
- ${RNOH_CPP_DIR}/third-party/boost/libs/config/include
64
- ${RNOH_CPP_DIR}/third-party/boost/libs/core/include
65
- ${RNOH_CPP_DIR}/third-party/boost/libs/preprocessor/include
66
- ${RNOH_CPP_DIR}/third-party/double-conversion
67
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/renderer/graphics/platform/cxx
68
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/runtimeexecutor
69
- ${RNOH_CPP_DIR}/third-party/glog/src
70
- ${RNOH_CPP_DIR}/third-party/boost/libs/mpl/include
71
- ${RNOH_CPP_DIR}/third-party/boost/libs/type_traits/include
72
- ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/yoga
73
- ${RNOH_CPP_DIR}/third-party/boost/libs/intrusive/include
74
- ${RNOH_CPP_DIR}/third-party/boost/libs/assert/include
75
- ${RNOH_CPP_DIR}/third-party/boost/libs/move/include
76
- ${RNOH_CPP_DIR}/third-party/boost/libs/static_assert/include
77
- ${RNOH_CPP_DIR}/third-party/boost/libs/container_hash/include
78
- ${RNOH_CPP_DIR}/third-party/boost/libs/describe/include
79
- ${RNOH_CPP_DIR}/third-party/boost/libs/mp11/include
80
- ${RNOH_CPP_DIR}/third-party/boost/libs/iterator/include
81
- ${RNOH_CPP_DIR}/third-party/boost/libs/detail/include
82
- ${RNOH_CPP_DIR}/third-party/boost/libs/regex/include
83
- ${RNOH_CPP_DIR}/patches/react_native_core/react/renderer/textlayoutmanager/platform/harmony
84
- )
85
-
86
- # 不用 **/*.cpp:OHOS CMake 在 Windows 上常匹配不到 → 空列表 → No SOURCES。
87
- # Codegen 的 TurboModule 与 Fabric 组件实现必须都进入插件目标;只保留头文件会让
88
- # Package 虽能注册 descriptor,却在运行/最终链接阶段缺失 Props/EventEmitter vtable。
89
- file(GLOB_RECURSE library_generated_SRC CONFIGURE_DEPENDS "${library_generated_dir}/*.cpp")
90
- file(GLOB library_SRC CONFIGURE_DEPENDS *.cpp)
91
-
92
- add_library(gcanvas SHARED
93
- ${library_SRC}
94
- ${library_generated_SRC}
95
- )
96
-
97
- target_compile_options(gcanvas PUBLIC ${folly_compile_options})
98
- target_compile_options(gcanvas PUBLIC -Wno-unused-command-line-argument)
99
- # RNOH 预编译 Fabric 库以 NDEBUG ABI 构建(Hvigor 的 debug profile 同样带
100
- # -DNDEBUG);显式保持一致,避免独立插件构建误启用 React Native debug-only vtable。
101
- target_compile_definitions(gcanvas PRIVATE OHOS=1 GCANVAS_WEEX=1 NDEBUG)
102
-
103
- # 链接 RNOH 运行时(TurboModule 代理依赖 ArkTSTurboModule/TurboModule 等符号)与 GL/EGL/字体系统库。
104
- target_link_libraries(gcanvas PUBLIC
105
- react-native-openharmony::rnoh_semi
106
- react-native-openharmony::react_nativemodule_core
107
- react-native-openharmony::runtimeexecutor
108
- react-native-openharmony::jsi
109
- react-native-openharmony::react_utils
110
- react-native-openharmony::react_render_core
111
- react-native-openharmony::react_render_graphics
112
- react-native-openharmony::rrc_view
113
- ${GCANVAS_CORE_LIB}
114
- libace_napi.z.so # NAPI / XComponent(OH_NativeXComponent_*)
115
- libace_ndk.z.so # ArkUI NDK
116
- libhilog_ndk.z.so # OH_LOG_Print 日志
117
- libEGL.so # Khronos EGL(eglCreateWindowSurface 等)
118
- libGLESv3.so # OpenGL ES 3.2
119
- libnative_drawing.so # OH_Drawing_RegisterFont / FontMgr 字体
120
- libnative_window.so # OHNativeWindow
121
- libimage_packer.so # toDataURL 图片编码
122
- libimage_source.so # PixelMap/图片数据
123
- libpixelmap.so # OH_PixelmapNative
124
- )
125
-
126
- target_link_options(gcanvas PRIVATE "-Wl,-z,max-page-size=16384")
1
+ # GCanvas 鸿蒙 C++ 库构建配置。
2
+ cmake_minimum_required(VERSION 3.13)
3
+ set(CMAKE_VERBOSE_MAKEFILE on)
4
+ project(gcanvas_library)
5
+
6
+ # The public NAPI/XComponent entry remains libgcanvas.so. The vendored
7
+ # renderer/core is linked into it as a static implementation library.
8
+ set(GCANVAS_WEEX ON)
9
+
10
+ # RNOH/RN 头文件(ViewProps.h 等)使用 std::optional,要求 C++17。
11
+ set(CMAKE_CXX_STANDARD 17)
12
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
13
+
14
+ find_package(react-native-openharmony REQUIRED CONFIG)
15
+
16
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/core/CMakeLists.txt")
17
+ add_subdirectory(core)
18
+ set(GCANVAS_CORE_LIB gcanvas_core)
19
+ else()
20
+ set(GCANVAS_CORE_LIB "")
21
+ endif()
22
+
23
+ # 从 imported 目标 rnoh_semi 的库位置反推 RNOH 包根目录。Windows 上可由
24
+ # -DRNOH_PKG_ROOT=<short-path> 覆盖,避免 ohpm 哈希目录触发 MAX_PATH。
25
+ if(NOT DEFINED RNOH_PKG_ROOT)
26
+ get_target_property(_rnoh_semi_loc react-native-openharmony::rnoh_semi IMPORTED_LOCATION)
27
+ get_filename_component(_rnoh_pkg_libdir "${_rnoh_semi_loc}" DIRECTORY) # .../libs/arm64-v8a
28
+ get_filename_component(_rnoh_pkg_libdir "${_rnoh_pkg_libdir}" DIRECTORY) # .../libs
29
+ get_filename_component(RNOH_PKG_ROOT "${_rnoh_pkg_libdir}" DIRECTORY) # <pkg_root>
30
+ endif()
31
+ set(RNOH_CPP_DIR "${RNOH_PKG_ROOT}/src/main/include")
32
+ set(REACT_COMMON_PATCH_DIR "${RNOH_CPP_DIR}/patches/react_native_core")
33
+
34
+ set(library_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
35
+
36
+ # folly F14 链接一致性:FOLLY_MOBILE=1(failure-lessons testing-cmake-004)。
37
+ set(folly_compile_options
38
+ -DFOLLY_NO_CONFIG=1
39
+ -DFOLLY_MOBILE=1
40
+ -DFOLLY_USE_LIBCPP=1
41
+ -DFOLLY_HAVE_RECVMMSG=1
42
+ -DFOLLY_HAVE_PTHREAD=1
43
+ -Wno-comma
44
+ -Wno-shorten-64-to-32
45
+ -faligned-new
46
+ )
47
+
48
+ include_directories(
49
+ ${CMAKE_CURRENT_SOURCE_DIR}
50
+ ${library_generated_dir}
51
+ ${RNOH_CPP_DIR}
52
+ ${REACT_COMMON_PATCH_DIR}
53
+ ${RNOH_CPP_DIR}/third-party/folly
54
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon
55
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/nativemodule/core
56
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/jsi
57
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/callinvoker
58
+ ${RNOH_CPP_DIR}/third-party/boost/libs/utility/include
59
+ ${RNOH_CPP_DIR}/third-party/boost/libs/stacktrace/include
60
+ ${RNOH_CPP_DIR}/third-party/boost/libs/predef/include
61
+ ${RNOH_CPP_DIR}/third-party/boost/libs/array/include
62
+ ${RNOH_CPP_DIR}/third-party/boost/libs/throw_exception/include
63
+ ${RNOH_CPP_DIR}/third-party/boost/libs/config/include
64
+ ${RNOH_CPP_DIR}/third-party/boost/libs/core/include
65
+ ${RNOH_CPP_DIR}/third-party/boost/libs/preprocessor/include
66
+ ${RNOH_CPP_DIR}/third-party/double-conversion
67
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/renderer/graphics/platform/cxx
68
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/runtimeexecutor
69
+ ${RNOH_CPP_DIR}/third-party/glog/src
70
+ ${RNOH_CPP_DIR}/third-party/boost/libs/mpl/include
71
+ ${RNOH_CPP_DIR}/third-party/boost/libs/type_traits/include
72
+ ${RNOH_CPP_DIR}/third-party/rn/ReactCommon/yoga
73
+ ${RNOH_CPP_DIR}/third-party/boost/libs/intrusive/include
74
+ ${RNOH_CPP_DIR}/third-party/boost/libs/assert/include
75
+ ${RNOH_CPP_DIR}/third-party/boost/libs/move/include
76
+ ${RNOH_CPP_DIR}/third-party/boost/libs/static_assert/include
77
+ ${RNOH_CPP_DIR}/third-party/boost/libs/container_hash/include
78
+ ${RNOH_CPP_DIR}/third-party/boost/libs/describe/include
79
+ ${RNOH_CPP_DIR}/third-party/boost/libs/mp11/include
80
+ ${RNOH_CPP_DIR}/third-party/boost/libs/iterator/include
81
+ ${RNOH_CPP_DIR}/third-party/boost/libs/detail/include
82
+ ${RNOH_CPP_DIR}/third-party/boost/libs/regex/include
83
+ ${RNOH_CPP_DIR}/patches/react_native_core/react/renderer/textlayoutmanager/platform/harmony
84
+ )
85
+
86
+ # 不用 **/*.cpp:OHOS CMake 在 Windows 上常匹配不到 → 空列表 → No SOURCES。
87
+ # Codegen 的 TurboModule 与 Fabric 组件实现必须都进入插件目标;只保留头文件会让
88
+ # Package 虽能注册 descriptor,却在运行/最终链接阶段缺失 Props/EventEmitter vtable。
89
+ file(GLOB_RECURSE library_generated_SRC CONFIGURE_DEPENDS "${library_generated_dir}/*.cpp")
90
+ file(GLOB library_SRC CONFIGURE_DEPENDS *.cpp)
91
+
92
+ add_library(gcanvas SHARED
93
+ ${library_SRC}
94
+ ${library_generated_SRC}
95
+ )
96
+
97
+ target_compile_options(gcanvas PUBLIC ${folly_compile_options})
98
+ target_compile_options(gcanvas PUBLIC -Wno-unused-command-line-argument)
99
+ # RNOH 预编译 Fabric 库以 NDEBUG ABI 构建(Hvigor 的 debug profile 同样带
100
+ # -DNDEBUG);显式保持一致,避免独立插件构建误启用 React Native debug-only vtable。
101
+ target_compile_definitions(gcanvas PRIVATE OHOS=1 GCANVAS_WEEX=1 NDEBUG)
102
+
103
+ # 链接 RNOH 运行时(TurboModule 代理依赖 ArkTSTurboModule/TurboModule 等符号)与 GL/EGL/字体系统库。
104
+ target_link_libraries(gcanvas PUBLIC
105
+ react-native-openharmony::rnoh_semi
106
+ react-native-openharmony::react_nativemodule_core
107
+ react-native-openharmony::runtimeexecutor
108
+ react-native-openharmony::jsi
109
+ react-native-openharmony::react_utils
110
+ react-native-openharmony::react_render_core
111
+ react-native-openharmony::react_render_graphics
112
+ react-native-openharmony::rrc_view
113
+ ${GCANVAS_CORE_LIB}
114
+ libace_napi.z.so # NAPI / XComponent(OH_NativeXComponent_*)
115
+ libace_ndk.z.so # ArkUI NDK
116
+ libhilog_ndk.z.so # OH_LOG_Print 日志
117
+ libEGL.so # Khronos EGL(eglCreateWindowSurface 等)
118
+ libGLESv3.so # OpenGL ES 3.2
119
+ libnative_drawing.so # OH_Drawing_RegisterFont / FontMgr 字体
120
+ libnative_window.so # OHNativeWindow
121
+ libimage_packer.so # toDataURL 图片编码
122
+ libimage_source.so # PixelMap/图片数据
123
+ libpixelmap.so # OH_PixelmapNative
124
+ )
125
+
126
+ target_link_options(gcanvas PRIVATE "-Wl,-z,max-page-size=16384")