@ohos-ports/canvas 3.2.3-beta.2 → 3.2.3-beta.3
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/Readme.md +657 -0
- package/browser.js +31 -0
- package/build/Release/canvas.node +0 -0
- package/index.d.ts +507 -0
- package/index.js +91 -9
- package/lib/DOMMatrix.js +678 -0
- package/lib/bindings.js +43 -0
- package/lib/canvas.js +113 -0
- package/lib/context2d.js +11 -0
- package/lib/image.js +97 -0
- package/lib/jpegstream.js +41 -0
- package/lib/pattern.js +15 -0
- package/lib/pdfstream.js +35 -0
- package/lib/pngstream.js +42 -0
- package/package.json +76 -11
- package/src/Backends.h +9 -0
- package/src/Canvas.cc +1026 -0
- package/src/Canvas.h +128 -0
- package/src/CanvasError.h +37 -0
- package/src/CanvasGradient.cc +113 -0
- package/src/CanvasGradient.h +20 -0
- package/src/CanvasPattern.cc +129 -0
- package/src/CanvasPattern.h +33 -0
- package/src/CanvasRenderingContext2d.cc +3527 -0
- package/src/CanvasRenderingContext2d.h +238 -0
- package/src/CharData.h +233 -0
- package/src/FontParser.cc +605 -0
- package/src/FontParser.h +115 -0
- package/src/Image.cc +1719 -0
- package/src/Image.h +146 -0
- package/src/ImageData.cc +138 -0
- package/src/ImageData.h +26 -0
- package/src/InstanceData.h +12 -0
- package/src/JPEGStream.h +157 -0
- package/src/PNG.h +292 -0
- package/src/Point.h +11 -0
- package/src/Util.h +9 -0
- package/src/bmp/BMPParser.cc +459 -0
- package/src/bmp/BMPParser.h +60 -0
- package/src/bmp/LICENSE.md +24 -0
- package/src/closure.cc +52 -0
- package/src/closure.h +98 -0
- package/src/color.cc +796 -0
- package/src/color.h +30 -0
- package/src/dll_visibility.h +20 -0
- package/src/init.cc +114 -0
- package/src/register_font.cc +352 -0
- package/src/register_font.h +7 -0
- package/util/has_lib.js +119 -0
- package/util/win_jpeg_lookup.js +21 -0
- package/build/Release/libcairo.so.2.11802.2 +0 -0
- package/build/Release/libexpat.so +0 -0
- package/build/Release/libffi.so.8.1.3 +0 -0
- package/build/Release/libfontconfig.so.1.15.0 +0 -0
- package/build/Release/libfribidi.so.0.4.0 +0 -0
- package/build/Release/libjpeg.so +0 -0
- package/build/Release/liblibpng16.so +0 -0
- package/build/Release/libpango-1.0.so.0.5000.14 +0 -0
- package/build/Release/libpangocairo-1.0.so.0.5000.14 +0 -0
- package/build/Release/libpangoft2-1.0.so.0.5000.14 +0 -0
- package/build/Release/libpcre2-8.so.0.11.0 +0 -0
- package/build/Release/libpixman-1.so.0.46.4 +0 -0
- package/build/Release/libpng16.so.16 +0 -0
- package/install.js +0 -64
package/install.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const { execSync } = require("child_process");
|
|
6
|
-
|
|
7
|
-
const releaseDir = path.join(__dirname, "build", "Release");
|
|
8
|
-
|
|
9
|
-
// 从 ELF 文件中提取所有 NEEDED soname
|
|
10
|
-
function getNeededSonames(elfPath) {
|
|
11
|
-
try {
|
|
12
|
-
const output = execSync(`readelf -d "${elfPath}" 2>/dev/null`, {
|
|
13
|
-
encoding: "utf8",
|
|
14
|
-
});
|
|
15
|
-
const needed = [];
|
|
16
|
-
for (const line of output.split("\n")) {
|
|
17
|
-
const match = line.match(/\(NEEDED\).*\[(.+?)\]/);
|
|
18
|
-
if (match) needed.push(match[1]);
|
|
19
|
-
}
|
|
20
|
-
return needed;
|
|
21
|
-
} catch {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function run() {
|
|
27
|
-
// 1. 列出目录下所有实际 .so 文件
|
|
28
|
-
const allFiles = fs.readdirSync(releaseDir);
|
|
29
|
-
const soFiles = allFiles.filter(
|
|
30
|
-
(f) => f.endsWith(".so") || /\.so\.\d/.test(f)
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
// 2. 收集所有 ELF 文件的 NEEDED(不只是 canvas.node,还包括所有 .so 的级联依赖)
|
|
34
|
-
const elfFiles = allFiles.filter(
|
|
35
|
-
(f) => f.endsWith(".node") || f.endsWith(".so") || /\.so\.\d/.test(f)
|
|
36
|
-
);
|
|
37
|
-
const allNeeded = new Set();
|
|
38
|
-
for (const f of elfFiles) {
|
|
39
|
-
for (const soname of getNeededSonames(path.join(releaseDir, f))) {
|
|
40
|
-
allNeeded.add(soname);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 3. 为每个缺失的 soname 找到匹配的实际文件并创建符号链接
|
|
45
|
-
let created = 0;
|
|
46
|
-
for (const soname of allNeeded) {
|
|
47
|
-
if (fs.existsSync(path.join(releaseDir, soname))) continue;
|
|
48
|
-
const match = soFiles.find((f) => f.startsWith(soname) && f !== soname);
|
|
49
|
-
if (!match) continue;
|
|
50
|
-
fs.symlinkSync(match, path.join(releaseDir, soname));
|
|
51
|
-
console.log(` ${soname} -> ${match}`);
|
|
52
|
-
created++;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (created > 0) {
|
|
56
|
-
console.log(`Created ${created} soname symlink(s)`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
run();
|
|
62
|
-
} catch (e) {
|
|
63
|
-
console.warn("Warning: failed to create soname symlinks:", e.message);
|
|
64
|
-
}
|