Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
I
IMGRender
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
IMGRender
Commits
c1c62133
Commit
c1c62133
authored
Jul 28, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skia svg module.
parent
817dd25e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
25 deletions
+86
-25
BUILD.skia
BUILDS/BUILD.skia
+59
-2
prepare.sh
prepare.sh
+10
-2
BUILD.bazel
src/BUILD.bazel
+4
-9
canvas.cc
src/canvas.cc
+7
-8
canvas.h
src/canvas.h
+1
-1
BUILD.bazel
tests/BUILD.bazel
+4
-2
check.cc
tests/check.cc
+1
-1
No files found.
BUILDS/BUILD.skia
View file @
c1c62133
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"],
)
prepare.sh
View file @
c1c62133
...
...
@@ -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/S
hared
--args
=
'is_official_build=true is_component_build=true skia_use_system_harfbuzz=false skia_enable_svg=true'
ninja
-C
out/S
hared
bin/gn gen out/S
tatic
--args
=
"
$COMPILE_ARGS_STR
"
ninja
-C
out/S
tatic
# if [ ! -d "${SKIA_BUILD_DIR}" ]; then
...
...
src/BUILD.bazel
View file @
c1c62133
...
...
@@ -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
)
src/canvas.cc
View file @
c1c62133
#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
;
}
src/canvas.h
View file @
c1c62133
int
say
();
int
example
();
tests/BUILD.bazel
View file @
c1c62133
...
...
@@ -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"
,
]
)
tests/check.cc
View file @
c1c62133
...
...
@@ -7,5 +7,5 @@ extern "C" {
// Tests factorial of 0.
TEST
(
Say
,
SayNothing
)
{
EXPECT_EQ
(
say
(),
0
);
EXPECT_EQ
(
example
(),
0
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment