Skip to content

liyipengwps/SkiaDemo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkiaDemo

  • Skia 官方示例demo可运行
  • skottie_ios_app iOS端使用Skia渲染Lottie
  • skottie2movieSkia渲染Lottie生成视频文件

编译Skia

cd skia
mkdir -p out/ios_arm64
cat << EOF > out/ios_arm64/args.gn
cc="clang"
cxx="clang++"
target_os="ios"
target_cpu="arm64"
is_debug=false
is_official_build=true
skia_enable_pdf=false
skia_use_icu=false
skia_use_libpng_decode=false
skia_use_libpng_encode=false
skia_use_libwebp_decode=false
skia_use_libwebp_encode=false
skia_use_libjpeg_turbo_decode=false
skia_use_libjpeg_turbo_encode=false
extra_cflags=["-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include","-I/usr/local/include"]
extra_cflags_cc=["-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include","-I/usr/local/include"]
skia_enable_gpu=true
skia_use_vulkan=false
skia_use_gl=false
skia_use_metal=true
EOF

bin/gn gen out/ios_arm64
ninja -C out/ios_arm64 skia
# 或者编译全部
# ninja -C out/ios_arm64
  • 编译 macOS M1 需要将 x64 改为 arm64
cd skia
mkdir -p out/macosx
cat << EOF > out/macosx/args.gn
cc="clang"
cxx="clang++"
target_os="mac"
target_cpu="x64"
is_debug=false
is_official_build=true
skia_enable_pdf=false
skia_use_icu=false
skia_use_libpng_decode=false
skia_use_libpng_encode=false
skia_use_libwebp_decode=false
skia_use_libwebp_encode=false
skia_use_libjpeg_turbo_decode=false
skia_use_libjpeg_turbo_encode=false
extra_cflags=["-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include","-I/usr/local/include"]
extra_cflags_cc=["-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include","-I/usr/local/include"]
skia_enable_gpu=true
skia_use_vulkan=false
skia_use_gl=false
skia_use_metal=true
EOF

bin/gn gen out/macosx
ninja -C out/macosx skia
# 或者编译全部
# ninja -C out/macosx

效果

About

Skia 官方示例demo,可运行

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 91.9%
  • C 6.9%
  • Other 1.2%