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
da259ad4
Commit
da259ad4
authored
Aug 27, 2020
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Readme updates.
parent
bee202e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
16 deletions
+130
-16
README.md
README.md
+64
-13
App.kt
...kijaInjectSample/src/main/kotlin/SkijaInjectSample/App.kt
+18
-3
RELEASE.md
skiko/RELEASE.md
+48
-0
No files found.
README.md
View file @
da259ad4
# Kotlin Multiplatform bindings to Skia
[

](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[

](https://github.com/JetBrains/skiko/releases/latest)
# Kotlin Multiplatform bindings to Skia #
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.
At the moment, Linux x86_64, Windows x86_64 and macOS x86_64 builds for Kotlin/JVM ara 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
)
}
}
```
With the following
`build.gradle`
:
```
groovy
plugins
{
id
'org.jetbrains.kotlin.jvm'
version
'1.3.72'
id
'application'
}
repositories
{
mavenLocal
()
jcenter
()
maven
{
url
'https://packages.jetbrains.team/maven/p/ui/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
platform
(
'org.jetbrains.kotlin:kotlin-bom'
)
implementation
'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation
"org.jetbrains.skiko:skiko-jvm-runtime-$target:0.1.5"
testImplementation
'org.jetbrains.kotlin:kotlin-test'
testImplementation
'org.jetbrains.kotlin:kotlin-test-junit'
}
application
{
mainClassName
=
'SkijaInjectSample.AppKt'
}
```
## Building JVM bindings
## Building JVM bindings
...
@@ -35,15 +97,4 @@ Control Panel|All Control Panel Items|System|Advanced system settings|Environmen
...
@@ -35,15 +97,4 @@ Control Panel|All Control Panel Items|System|Advanced system settings|Environmen
or by running
`cmd`
as administrator:
or by running
`cmd`
as administrator:
```
```
setx /M SKIKO_VSBT_PATH "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
setx /M SKIKO_VSBT_PATH "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
```
```
\ No newline at end of file
#### Releasing new version of Skiko
0.
Check all necessary changes are published to the repository.
1.
Trigger a new deployment in
[
Publish release
](
https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Skija_Skiko_PublishRelease
)
build configuration.
1.
Click "Deploy" button.
2.
Specify the desired version in "Skiko Release Version" text field on the "Parameters" tab.
3.
Choose the desired branch and commit on the "Changes" tab.
4.
Optionally you can check "Put the build to the queue top" option in the "General" tab to speed up a deployment
(please be mindful about it!).
\ No newline at end of file
samples/SkijaInjectSample/src/main/kotlin/SkijaInjectSample/App.kt
View file @
da259ad4
...
@@ -15,10 +15,25 @@ import org.jetbrains.skija.paragraph.ParagraphBuilder
...
@@ -15,10 +15,25 @@ import org.jetbrains.skija.paragraph.ParagraphBuilder
import
org.jetbrains.skija.paragraph.ParagraphStyle
import
org.jetbrains.skija.paragraph.ParagraphStyle
import
org.jetbrains.skija.paragraph.TextStyle
import
org.jetbrains.skija.paragraph.TextStyle
fun
main
(
args
:
Array
<
String
>)
{
fun
main
2
(
args
:
Array
<
String
>)
{
createWindow
(
"First window"
);
createWindow
(
"First window"
);
}
}
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
)
}
}
fun
createWindow
(
title
:
String
)
{
fun
createWindow
(
title
:
String
)
{
var
mouseX
=
0
var
mouseX
=
0
...
@@ -42,9 +57,9 @@ fun createWindow(title: String) {
...
@@ -42,9 +57,9 @@ fun createWindow(title: String) {
}
}
})
})
window
.
setVisible
(
true
)
;
window
.
setVisible
(
true
)
// MANDATORY: set window size after calling setVisible(true)
// MANDATORY: set window size after calling setVisible(true)
window
.
setSize
(
800
,
600
)
;
window
.
setSize
(
800
,
600
)
}
}
class
Renderer
(
val
displayScene
:
(
Renderer
,
Int
,
Int
)
->
Unit
):
SkiaRenderer
{
class
Renderer
(
val
displayScene
:
(
Renderer
,
Int
,
Int
)
->
Unit
):
SkiaRenderer
{
...
...
skiko/RE
ADM
E.md
→
skiko/RE
LEAS
E.md
View file @
da259ad4
# Release processes
## Tagging
```
bash
git tag
-a
v0.X.Y <commit
hash
>
-m
"Version 0.X.Y"
git push origin v0.X.Y
```
## Teamcity
Trigger a new deployment in
[
Publish release
](
https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Skija_Skiko_PublishRelease
)
build configuration.
1.
Click "Deploy" button.
2.
Specify the desired version in "Skiko Release Version" text field on the "Parameters" tab.
3.
Choose the desired branch and commit on the "Changes" tab.
4.
Optionally you can check "Put the build to the queue top" option in the "General" tab to speed up a deployment
(please be mindful about it!).
## Publishing
## Publishing
##### Publish to Maven local
##### Publish to Maven local
...
...
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