Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
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
liuqiang
skiko
Commits
a4a1af99
Unverified
Commit
a4a1af99
authored
Mar 19, 2021
by
Nikolay Igotti
Committed by
GitHub
Mar 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
bb735606
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
77 deletions
+1
-77
README.md
README.md
+1
-77
No files found.
README.md
View file @
a4a1af99
...
@@ -4,83 +4,7 @@
...
@@ -4,83 +4,7 @@
Skiko (short for Skia for Kotlin) is the graphical library exposing significant part
Skiko (short for Skia for Kotlin) is the graphical library exposing significant part
of
[
Skia library
](
https://skia.org
)
APIs to Kotlin, along with the gluing code for rendering context.
of
[
Skia library
](
https://skia.org
)
APIs to Kotlin, along with the gluing code for rendering context.
At the moment, Linux(x86_64), Windows(x86_64) and macOS(x86_64) builds for Kotlin/JVM are available.
At the moment, Linux(x86_64), Windows(x86_64) and macOS(x86_64 and arm64) builds for Kotlin/JVM are available.
Using the library from Kotlin is as simple as:
```
kotlin
fun
main
(
args
:
Array
<
String
>)
{
SkiaWindow
().
apply
{
layer
.
renderer
=
Renderer
{
renderer
,
w
,
h
->
val
canvas
=
renderer
.
canvas
!!
val
paint1
=
Paint
().
setColor
(
0
xffff0000
.
toInt
())
// ARGB
canvas
.
drawRRect
(
RRect
.
makeLTRB
(
10f
,
10f
,
w
-
10f
,
h
-
10f
,
5f
),
paint1
)
val
paint2
=
Paint
().
setColor
(
0
xff00ff00
.
toInt
())
// ARGB
canvas
.
drawRRect
(
RRect
.
makeLTRB
(
30f
,
30f
,
w
-
30f
,
h
-
30f
,
10f
),
paint2
)
}
setVisible
(
true
)
setSize
(
800
,
600
)
}
}
class
Renderer
(
val
displayScene
:
(
Renderer
,
Int
,
Int
)
->
Unit
):
SkiaRenderer
{
val
paint
=
Paint
().
apply
{
setColor
(
0
xff9BC730L
.
toInt
())
setMode
(
PaintMode
.
FILL
)
setStrokeWidth
(
1f
)
}
var
canvas
:
Canvas
?
=
null
override
fun
onInit
()
{
}
override
fun
onDispose
()
{
}
override
fun
onReshape
(
width
:
Int
,
height
:
Int
)
{
}
override
fun
onRender
(
canvas
:
Canvas
,
width
:
Int
,
height
:
Int
)
{
this
.
canvas
=
canvas
displayScene
(
this
,
width
,
height
)
}
}
```
With the following
`build.gradle`
:
```
groovy
plugins
{
id
'org.jetbrains.kotlin.jvm'
version
'1.3.72'
id
'application'
}
repositories
{
mavenLocal
()
maven
{
url
'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
}
def
os
=
System
.
getProperty
(
"os.name"
)
def
target
=
""
if
(
os
==
"Mac OS X"
)
{
target
=
"macos"
}
else
if
(
os
.
startsWith
(
"Win"
))
{
target
=
"windows"
}
else
if
(
os
.
startsWith
(
"Linux"
))
{
target
=
"linux"
}
else
{
throw
Error
(
"Unsupported OS: $target"
)
}
dependencies
{
implementation
'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation
"org.jetbrains.skiko:skiko-jvm-runtime-$target-x64:0.2.0"
}
application
{
mainClassName
=
'AppKt'
}
```
## Building JVM bindings
## Building JVM bindings
...
...
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