Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DjDeveloperr committed Oct 24, 2022
1 parent 06053db commit a15a605
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,37 @@ deno run --allow-ffi --allow-env --unstable <file>
deno run -A --unstable <file>
```

## API

Check the
[API reference here](https://doc.deno.land/https/deno.land/x/[email protected]/mod.ts).

Since this module implements the Canvas Web API, you can also refer to the
[MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D).

For non-standard APIs (such as `Canvas#save`, `Image.load`, `Fonts.*`), refer to
the API docs mentioned above.

## Building

First you need to
[setup depot_tools](https://www.chromium.org/developers/how-tos/install-depot-tools/).

Then, clone the repository with submodules.

And run the following commands:

```sh
deno task build-skia
deno task build
```

By default, the module will download and cache the prebuilt binaries for your
platform. However this is not intended behavior when developing locally. To use
locally built binaries, set `DENO_SKIA_LOCAL` environment variable to `1`. Or
you can also set `DENO_SKIA_PATH` to a complete path to dynamic library built
from the `native` directory.

## License

[Apache-2.0](./LICENSE) licensed.
Expand Down
15 changes: 10 additions & 5 deletions scripts/build_skia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ if (Deno.build.os === "windows") {
BUILD_ARGS["target_cpu"] = `"arm64"`;
BUILD_ARGS["target_os"] = `"mac"`;
BUILD_ARGS["extra_cflags_cc"] += ', "--target=arm64-apple-macos"';
BUILD_ARGS["extra_ldflags"] = '"--target=arm64-apple-macos"';
BUILD_ARGS["extra_asmflags"] = '"--target=arm64-apple-macos"';
BUILD_ARGS["extra_cflags"] = '"--target=arm64-apple-macos"';
BUILD_ARGS["extra_cflags_c"] = '"--target=arm64-apple-macos"';
BUILD_ARGS["extra_ldflags"] = '["--target=arm64-apple-macos"]';
BUILD_ARGS["extra_asmflags"] = '["--target=arm64-apple-macos"]';
BUILD_ARGS["extra_cflags"] = '["--target=arm64-apple-macos"]';
BUILD_ARGS["extra_cflags_c"] = '["--target=arm64-apple-macos"]';
}
}

Expand All @@ -108,7 +108,12 @@ const $ = (cmd: string | URL, ...args: string[]) => {
});
};

if (!Deno.args.includes("fast")) $("python", "./tools/git-sync-deps");
if (!Deno.args.includes("skip-sync-deps")) {
$(
Deno.build.os === "windows" ? "python" : "python3",
"./tools/git-sync-deps",
);
}

if (Deno.build.os === "windows") {
const SkLoadICU = new URL(
Expand Down

0 comments on commit a15a605

Please sign in to comment.