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
711c728b
Commit
711c728b
authored
Sep 02, 2021
by
Roman Sedaikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added [ColorSpace.sRGBLinear], refactored [Path] and [Paint].
parent
000e45b8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
ColorSpace.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorSpace.kt
+1
-0
Paint.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skia/Paint.kt
+30
-9
Path.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skia/Path.kt
+4
-1
No files found.
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorSpace.kt
View file @
711c728b
...
...
@@ -22,6 +22,7 @@ class ColorSpace : Managed {
}
val
sRGB
=
ColorSpace
(
_nMakeSRGB
(),
false
)
val
sRGBLinear
=
ColorSpace
(
_nMakeSRGBLinear
(),
false
)
val
displayP3
=
ColorSpace
(
_nMakeDisplayP3
(),
false
)
}
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skia/Paint.kt
View file @
711c728b
...
...
@@ -438,13 +438,16 @@ class Paint : Managed {
*
* @return zero and greater miter limit
*/
va
l
strokeMiter
:
Float
va
r
strokeMiter
:
Float
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetStrokeMiter
(
_ptr
)
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setStrokeMiter
(
value
)
}
/**
* Sets the limit at which a sharp corner is drawn beveled.
...
...
@@ -465,13 +468,16 @@ class Paint : Managed {
/**
* @return the geometry drawn at the beginning and end of strokes.
*/
va
l
strokeCap
:
PaintStrokeCap
va
r
strokeCap
:
PaintStrokeCap
get
()
=
try
{
Stats
.
onNativeCall
()
PaintStrokeCap
.
values
().
get
(
_nGetStrokeCap
(
_ptr
))
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setStrokeCap
(
value
)
}
/**
* Sets the geometry drawn at the beginning and end of strokes.
...
...
@@ -492,13 +498,16 @@ class Paint : Managed {
/**
* @return the geometry drawn at the corners of strokes.
*/
va
l
strokeJoin
:
PaintStrokeJoin
va
r
strokeJoin
:
PaintStrokeJoin
get
()
=
try
{
Stats
.
onNativeCall
()
PaintStrokeJoin
.
values
().
get
(
_nGetStrokeJoin
(
_ptr
))
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setStrokeJoin
(
value
)
}
/**
* Sets the geometry drawn at the corners of strokes.
...
...
@@ -564,7 +573,7 @@ class Paint : Managed {
* @return [Shader] or null
* @see [https://fiddle.skia.org/c/@Paint_refShader](https://fiddle.skia.org/c/@Paint_refShader)
*/
va
l
shader
:
Shader
?
va
r
shader
:
Shader
?
get
()
=
try
{
Stats
.
onNativeCall
()
val
shaderPtr
=
_nGetShader
(
_ptr
)
...
...
@@ -572,6 +581,9 @@ class Paint : Managed {
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setShader
(
value
)
}
/**
* @param shader how geometry is filled with color; if null, color is used instead
...
...
@@ -594,7 +606,7 @@ class Paint : Managed {
* @return [ColorFilter] or null
* @see [https://fiddle.skia.org/c/@Paint_refColorFilter](https://fiddle.skia.org/c/@Paint_refColorFilter)
*/
va
l
colorFilter
:
ColorFilter
?
va
r
colorFilter
:
ColorFilter
?
get
()
=
try
{
Stats
.
onNativeCall
()
val
colorFilterPtr
=
_nGetColorFilter
(
_ptr
)
...
...
@@ -602,6 +614,9 @@ class Paint : Managed {
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setColorFilter
(
value
)
}
/**
* @param colorFilter [ColorFilter] to apply to subsequent draw
...
...
@@ -628,13 +643,16 @@ class Paint : Managed {
*
* @return mode used to combine source color with destination color
*/
va
l
blendMode
:
BlendMode
?
va
r
blendMode
:
BlendMode
?
get
()
=
try
{
Stats
.
onNativeCall
()
BlendMode
.
values
().
get
(
_nGetBlendMode
(
_ptr
))
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setBlendMode
(
value
)
}
/**
* @return true if BlendMode is BlendMode.SRC_OVER, the default.
...
...
@@ -648,10 +666,10 @@ class Paint : Managed {
* @param mode BlendMode used to combine source color and destination
* @return this
*/
fun
setBlendMode
(
mode
:
BlendMode
):
Paint
{
fun
setBlendMode
(
mode
:
BlendMode
?
):
Paint
{
assert
(
mode
!=
null
)
{
"Paint::setBlendMode expected mode != null"
}
Stats
.
onNativeCall
()
_nSetBlendMode
(
_ptr
,
mode
.
ordinal
)
_nSetBlendMode
(
_ptr
,
mode
!!
.
ordinal
)
return
this
}
...
...
@@ -659,7 +677,7 @@ class Paint : Managed {
* @return [PathEffect] or null
* @see [https://fiddle.skia.org/c/@Paint_refPathEffect](https://fiddle.skia.org/c/@Paint_refPathEffect)
*/
va
l
pathEffect
:
PathEffect
?
va
r
pathEffect
:
PathEffect
?
get
()
=
try
{
Stats
.
onNativeCall
()
val
pathEffectPtr
=
_nGetPathEffect
(
_ptr
)
...
...
@@ -667,6 +685,9 @@ class Paint : Managed {
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setPathEffect
(
value
)
}
/**
* @param p replace [Path] with a modification when drawn
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skia/Path.kt
View file @
711c728b
...
...
@@ -447,13 +447,16 @@ class Path internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR),
}
}
va
l
fillMode
:
PathFillMode
va
r
fillMode
:
PathFillMode
get
()
=
try
{
Stats
.
onNativeCall
()
PathFillMode
.
values
().
get
(
_nGetFillMode
(
_ptr
))
}
finally
{
Reference
.
reachabilityFence
(
this
)
}
set
(
value
)
{
setFillMode
(
value
)
}
fun
setFillMode
(
fillMode
:
PathFillMode
):
Path
{
Stats
.
onNativeCall
()
...
...
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