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
cbb2e83a
Commit
cbb2e83a
authored
Jul 27, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skia.
parent
d0c3154b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
20 deletions
+56
-20
.gitmodules
.gitmodules
+3
-0
BUILD.skia
BUILDS/BUILD.skia
+7
-0
WORKSPACE.bazel
WORKSPACE.bazel
+6
-6
skia
external/skia
+1
-0
prepare.sh
prepare.sh
+32
-2
BUILD.bazel
src/BUILD.bazel
+2
-1
canvas.cc
src/canvas.cc
+2
-1
BUILD.bazel
tests/BUILD.bazel
+1
-0
check.cc
tests/check.cc
+2
-10
No files found.
.gitmodules
View file @
cbb2e83a
...
@@ -4,3 +4,6 @@
...
@@ -4,3 +4,6 @@
[submodule "external/googletest"]
[submodule "external/googletest"]
path = external/googletest
path = external/googletest
url = https://github.com/google/googletest.git
url = https://github.com/google/googletest.git
[submodule "external/skia"]
path = external/skia
url = https://skia.googlesource.com/skia.git
BUILDS/BUILD.skia
0 → 100644
View file @
cbb2e83a
cc_import(
name = "skia_public",
hdrs = glob(["include/**/*.h"]),
shared_library = "lib/libskia.so",
visibility = ["//visibility:public"],
)
WORKSPACE.bazel
View file @
cbb2e83a
workspace(name = "IMGRender")
workspace(name = "IMGRender")
local_repository(
name = "skia",
path = "./external/skia"
)
# Google test for unittest purposes
# Google test for unittest purposes
local_repository(
local_repository(
name = "gtest",
name = "gtest",
...
@@ -18,4 +13,9 @@ new_local_repository(
...
@@ -18,4 +13,9 @@ new_local_repository(
build_file = "BUILDS/BUILD.theft"
build_file = "BUILDS/BUILD.theft"
)
)
# Skia library
new_local_repository(
name = "skia",
path = "./external/build/skia",
build_file = "BUILDS/BUILD.skia"
)
skia
@
f905f5fd
Subproject commit f905f5fd8a0634968ed2cf148366cb4f9d47d187
prepare.sh
View file @
cbb2e83a
...
@@ -3,9 +3,39 @@
...
@@ -3,9 +3,39 @@
set
-euxo
pipefail
set
-euxo
pipefail
WORKPATH
=
$(
cd
$(
dirname
$0
)
;
pwd
)
WORKPATH
=
$(
cd
$(
dirname
$0
)
;
pwd
)
EXTERNAL_DIR
=
${
WORKPATH
}
/external
SKIA_PATH
=
${
WORKPATH
}
/external/skia
SKIA_PATH
=
${
EXTERNAL_DIR
}
/skia
EXTERNAL_BUILD_DIR
=
${
EXTERNAL_DIR
}
/build
if
[
!
-d
"
${
EXTERNAL_BUILD_DIR
}
"
]
;
then
mkdir
${
EXTERNAL_BUILD_DIR
}
fi
# Build skia
# Build skia
SKIA_BUILD_DIR
=
${
EXTERNAL_BUILD_DIR
}
/skia
cd
$SKIA_PATH
cd
$SKIA_PATH
bazel build //:skia_public
python3 tools/git-sync-deps
bin/gn gen out/Shared
--args
=
'is_official_build=true is_component_build=true skia_use_system_harfbuzz=false'
ninja
-C
out/Shared
if
[
!
-d
"
${
SKIA_BUILD_DIR
}
"
]
;
then
mkdir
${
SKIA_BUILD_DIR
}
mkdir
${
SKIA_BUILD_DIR
}
/include
mkdir
${
SKIA_BUILD_DIR
}
/lib
else
rm
-rf
${
SKIA_BUILD_DIR
}
/include/
*
rm
-rf
${
SKIA_BUILD_DIR
}
/lib/
*
fi
cp
out/Shared/
*
.so
${
SKIA_BUILD_DIR
}
/lib
cp
-r
include
${
SKIA_BUILD_DIR
}
/
cd
$SKIA_BUILD_DIR
builds
=
$(
find
.
|
grep
bazel | xargs
)
if
[
!
-z
"
$builds
"
]
;
then
rm
$builds
fi
src/BUILD.bazel
View file @
cbb2e83a
...
@@ -3,7 +3,8 @@ cc_library(
...
@@ -3,7 +3,8 @@ cc_library(
name = "render",
name = "render",
srcs = ["canvas.cc"],
srcs = ["canvas.cc"],
hdrs = ["canvas.h"],
hdrs = ["canvas.h"],
#deps = ["@skia//:skia_public"],
deps = ["@skia//:skia_public"],
copts = ["-I./external/build/skia/", "-std=c++2a"],
visibility = [
visibility = [
"//app:__pkg__",
"//app:__pkg__",
"//tests:__pkg__"
"//tests:__pkg__"
...
...
src/canvas.cc
View file @
cbb2e83a
#include <stdio.h>
#include <stdio.h>
#include "include/core/SkCanvas.h"
int
say
(
void
)
{
int
say
(
void
)
{
printf
(
"Hello,World
\n
"
);
SkCanvas
canvas
=
SkCanvas
(
);
return
0
;
return
0
;
}
}
tests/BUILD.bazel
View file @
cbb2e83a
...
@@ -5,6 +5,7 @@ cc_test(
...
@@ -5,6 +5,7 @@ cc_test(
name = "check",
name = "check",
srcs = ["check.cc"],
srcs = ["check.cc"],
args = ["/home"],
args = ["/home"],
copts = ["-I./src"],
deps = [
deps = [
"//src:render",
"//src:render",
"@theft//:theft",
"@theft//:theft",
...
...
tests/check.cc
View file @
cbb2e83a
...
@@ -6,14 +6,6 @@ extern "C" {
...
@@ -6,14 +6,6 @@ extern "C" {
}
}
// Tests factorial of 0.
// Tests factorial of 0.
TEST
(
FactorialTest
,
HandlesZeroInput
)
{
TEST
(
Say
,
SayNothing
)
{
EXPECT_EQ
(
1
,
1
);
EXPECT_EQ
(
say
(),
0
);
}
// Tests factorial of positive numbers.
TEST
(
FactorialTest
,
HandlesPositiveInput
)
{
EXPECT_EQ
(
1
,
1
);
EXPECT_EQ
(
2
,
2
);
EXPECT_EQ
(
6
,
6
);
EXPECT_EQ
(
40320
,
40320
);
}
}
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