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
f7ad5fd6
Commit
f7ad5fd6
authored
Jul 30, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GPU render examples.
parent
79a0d920
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
13 deletions
+50
-13
BUILD.bazel
examples/BUILD.bazel
+32
-0
skia_svg_gpu_render.cc
examples/skia_svg_gpu_render.cc
+13
-0
skia_svg_render.cc
examples/skia_svg_render.cc
+2
-1
prepare.sh
prepare.sh
+3
-0
try.h
src/try.h
+0
-2
check.cc
tests/check.cc
+0
-10
No files found.
examples/BUILD.bazel
0 → 100644
View file @
f7ad5fd6
cc_binary(
name = "skia_svg_render",
srcs = ["skia_svg_render.cc"],
copts = ["-I./src", "-std=c++2a"],
linkopts = [
"-lz", "-llzma", "-ljpeg", "-lfreetype",
"-lpng", "-lfontconfig", "-lGLX", "-lexpat -lm"],
deps = [
"@skia//:skia_svg",
"@skia//:skia",
],
)
cc_binary(
name = "skia_svg_gpu_render",
srcs = ["skia_svg_gpu_render.cc"],
copts = ["-std=c++2a"],
linkopts = [
"-lz",
"-llzma",
"-ljpeg",
"-lfreetype",
"-lpng",
"-lfontconfig",
"-lGLX",
"-lexpat",
"-lm"],
deps = [
"@skia//:skia_svg",
"@skia//:skia",
],
)
examples/skia_svg_gpu_render.cc
0 → 100644
View file @
f7ad5fd6
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/gl/GrGLTypes.h"
#include "include/gpu/GrDirectContext.h"
int
main
(
void
)
{
const
int
width
=
1920
;
const
int
height
=
1080
;
const
int
pixelBytes
=
4
;
sk_sp
<
GrDirectContext
>
context
=
GrDirectContext
::
MakeGL
();
return
0
;
}
src/try
.cc
→
examples/skia_svg_render
.cc
View file @
f7ad5fd6
...
...
@@ -12,8 +12,9 @@
#include "include/core/SkImage.h"
#include "include/core/SkEncodedImageFormat.h"
#include "include/core/SkData.h"
#include "include/gpu/gl/GrGLTypes.h"
int
example
(
void
)
{
int
main
(
void
)
{
const
int
width
=
1920
;
const
int
height
=
1080
;
const
int
pixelBytes
=
4
;
...
...
prepare.sh
View file @
f7ad5fd6
...
...
@@ -34,6 +34,9 @@ COMPILE_ARGS=(
skia_enable_svg
=
true
skia_use_system_libwebp
=
false
skia_use_system_icu
=
false
skia_use_gl
=
true
skia_enable_gpu
=
true
)
printf
-v
COMPILE_ARGS_STR
'%s '
"
${
COMPILE_ARGS
[@]
}
"
...
...
src/try.h
deleted
100644 → 0
View file @
79a0d920
int
example
();
tests/check.cc
View file @
f7ad5fd6
#include "src/try.h"
#include "gtest/gtest.h"
extern
"C"
{
#include "external/theft/inc/theft.h"
}
// Tests factorial of 0.
TEST
(
Say
,
SayNothing
)
{
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