Commit c1c62133 authored by Linshizhi's avatar Linshizhi

Add skia svg module.

parent 817dd25e
cc_import(
name = "skia_public",
name = "skia",
hdrs = glob(["**/*.h"]),
shared_library = "out/Shared/libskia.so",
static_library = "out/Static/libskia.a",
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_svg",
hdrs = glob(["**/*.h"]),
static_library = "out/Static/libsvg.a",
deps = [
":skia",
":skia_skshaper",
],
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_skottie",
hdrs = glob(["**/*.h"]),
static_library = "out/Static/libskottie.a",
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_skparagraph",
hdrs = glob(["**/*.h"]),
static_library = "out/Static/libskparagraph.a",
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_sksg",
hdrs = glob(["**/*.h"]),
static_library = "out/Static/libsksg.a",
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_skshaper",
hdrs = glob(["**/*.h"]),
static_library = "out/Static/libskshaper.a",
deps = [
":skia_skunicode",
],
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_sktext",
hdrs = glob(["**/*.h"]),
static_library = "out/Static/libsktext.a",
visibility = ["//visibility:public"],
)
cc_import(
name = "skia_skunicode",
hdrs = glob(["**/*.h"]),
deps = [":skia"],
static_library = "out/Static/libskunicode.a",
visibility = ["//visibility:public"],
)
......@@ -28,10 +28,18 @@ if [ -f "WORKSPACE.bazel" ]; then
fi
fi
COMPILE_ARGS=(
is_official_build=true
skia_use_system_harfbuzz=false
skia_enable_svg=true
skia_use_system_libwebp=false
skia_use_system_icu=false
)
printf -v COMPILE_ARGS_STR '%s ' "${COMPILE_ARGS[@]}"
python3 tools/git-sync-deps
bin/gn gen out/Shared --args='is_official_build=true is_component_build=true skia_use_system_harfbuzz=false skia_enable_svg=true'
ninja -C out/Shared
bin/gn gen out/Static --args="$COMPILE_ARGS_STR"
ninja -C out/Static
# if [ ! -d "${SKIA_BUILD_DIR}" ]; then
......
......@@ -4,14 +4,8 @@ cc_library(
srcs = ["canvas.cc"],
hdrs = ["canvas.h"],
deps = [
"@ffmpeg//:avformat",
"@skia//:skia_public",
"@ffmpeg//:avcodec",
"@ffmpeg//:avdevice",
"@ffmpeg//:avfilter",
"@ffmpeg//:avutil",
"@ffmpeg//:swresample",
"@ffmpeg//:swscale",
"@skia//:skia_svg",
"@skia//:skia",
],
copts = [
"-I./external/ffmpeg/include",
......@@ -20,5 +14,6 @@ cc_library(
visibility = [
"//app:__pkg__",
"//tests:__pkg__"
]
],
linkstatic = True
)
#include <stdio.h>
#include "core/SkCanvas.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkStream.h"
#include "include/core/SkRefCnt.h"
#include "modules/svg/include/SkSVGDOM.h"
extern "C" {
#include "libavformat/avformat.h"
}
int say(void) {
int example(void) {
SkCanvas canvas = SkCanvas();
AVFormatContext *ctx = avformat_alloc_context();
SkFILEStream svgStream("./example");
sk_sp<SkSVGDOM> fDom = SkSVGDOM::MakeFromStream(svgStream);
return 0;
}
int say();
int example();
......@@ -6,11 +6,13 @@ cc_test(
srcs = ["check.cc"],
args = ["/home"],
copts = ["-I./src"],
linkopts = ["-lz", "-llzma"],
linkopts = [
"-lz", "-llzma", "-ljpeg", "-lfreetype",
"-lpng", "-lfontconfig", "-lGLX", "-lexpat -lm"],
deps = [
"//src:render",
"@theft//:theft",
"@gtest//:gtest",
"@gtest//:gtest_main"
"@gtest//:gtest_main",
]
)
......@@ -7,5 +7,5 @@ extern "C" {
// Tests factorial of 0.
TEST(Say, SayNothing) {
EXPECT_EQ(say(), 0);
EXPECT_EQ(example(), 0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment