Skip to content

Commit

Permalink
feat: skia m89
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 20, 2021
1 parent 1d7874a commit e9c1cc9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ jobs:
pip install certifi
if: matrix.os == 'windows-latest'

- name: Install tools on Linux
run: |
sudo apt-get install -y ninja-build
if: matrix.os == 'ubuntu-latest'

- name: Install
uses: actions-rs/toolchain@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "skia"]
path = skia
url = https://github.com/google/skia.git
branch = chrome/m87
branch = chrome/m89
[submodule "depot_tools"]
path = depot_tools
url = https://github.com/rust-skia/depot_tools.git
12 changes: 6 additions & 6 deletions scripts/build-skia.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ function exec(command) {

exec('python ./tools/git-sync-deps')

const CC = platformName === 'win32' ? '\\"clang-cl\\"' : '"clang"'
const CXX = platformName === 'win32' ? '\\"clang-cl\\"' : '"clang++"'
const CC = platformName === 'win32' ? '\\"clang-cl\\"' : platformName === 'linux' ? '"clang-9"' : '"clang"'
const CXX = platformName === 'win32' ? '\\"clang-cl\\"' : platformName === 'linux' ? '"clang++-9"' : '"clang++"'
let ExtraCflagsCC = ''
let ExtraSkiaBuildFlag = ''
switch (platformName) {
case 'win32':
ExtraCflagsCC = `\\"/std:c++17\\", \\"/MT\\"`
ExtraCflagsCC = `\\"/std:c++17\\", \\"/MT\\", \\"-DSK_FORCE_RASTER_PIPELINE_BLITTER\\"`
ExtraSkiaBuildFlag = 'clang_win=\\"C:\\\\Program Files\\\\LLVM\\"'
break
case 'linux':
ExtraCflagsCC = '"-stdlib=libstdc++", "-std=c++17", "-fno-rtti", "-fno-exceptions"'
ExtraSkiaBuildFlag = ['skia_use_system_freetype2=false', 'skia_use_fontconfig=false'].join('\n')
ExtraCflagsCC = '"-std=c++17", "-fno-rtti", "-fno-exceptions", "-DSK_FORCE_RASTER_PIPELINE_BLITTER"'
ExtraSkiaBuildFlag = ['skia_use_system_freetype2=false', 'skia_use_fontconfig=false'].join(' ')
break
case 'darwin':
ExtraCflagsCC = '"-std=c++17", "-fno-rtti", "-fno-exceptions"'
ExtraCflagsCC = '"-std=c++17", "-fno-rtti", "-fno-exceptions", "-DSK_FORCE_RASTER_PIPELINE_BLITTER"'
break
default:
throw new TypeError(`Don't support ${platformName} for now`)
Expand Down
2 changes: 1 addition & 1 deletion skia
Submodule skia updated 2606 files
7 changes: 4 additions & 3 deletions skia-c/skia_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,15 @@ extern "C"
skiac_transform c_ts,
int filter_quality)
{
const auto skia_tile_mode = SkTileMode::kRepeat;
auto skia_tile_mode = SkTileMode::kRepeat;
const auto ts = conv_from_transform(c_ts);
const auto sampling_options = new SkSamplingOptions((SkFilterQuality)filter_quality);
sk_sp<SkImage> image = SURFACE_CAST->makeImageSnapshot();
auto shader = image->makeShader(
skia_tile_mode,
skia_tile_mode,
&ts,
(SkFilterQuality)filter_quality)
*sampling_options,
&ts)
.release();

if (shader)
Expand Down

1 comment on commit e9c1cc9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: e9c1cc9 Previous: 1d7874a Ratio
Draw house#@napi-rs/skia 25 ops/sec (±0.96%) 25 ops/sec (±0.16%) 1
Draw house#node-canvas 22 ops/sec (±0.99%) 24 ops/sec (±0.45%) 1.09
Draw gradient#@napi-rs/skia 24 ops/sec (±0.97%) 24 ops/sec (±0.05%) 1
Draw gradient#node-canvas 21 ops/sec (±0.99%) 23 ops/sec (±0.78%) 1.10

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.