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
af035822
Unverified
Commit
af035822
authored
Oct 01, 2021
by
Nikolay Igotti
Committed by
GitHub
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup, missing native file (#230)
parent
7120885c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
146 additions
and
127 deletions
+146
-127
InvalidationController.cc
...c/commonMain/cpp/generated/sksg/InvalidationController.cc
+22
-0
TextStyle.kt
...mmonMain/kotlin/org/jetbrains/skia/paragraph/TextStyle.kt
+0
-1
InvalidationController.kt
.../kotlin/org/jetbrains/skia/sksg/InvalidationController.kt
+18
-14
SVGCanvas.kt
...src/commonMain/kotlin/org/jetbrains/skia/svg/SVGCanvas.kt
+2
-3
SVGDOM.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGDOM.kt
+11
-12
SVGNode.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGNode.kt
+2
-3
SVGSVG.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGSVG.kt
+32
-68
InvalidationController.cc
skiko/src/jvmMain/cpp/common/sksg/InvalidationController.cc
+40
-0
SVGDOM.cc
skiko/src/jvmMain/cpp/common/svg/SVGDOM.cc
+4
-4
SVGNode.cc
skiko/src/jvmMain/cpp/common/svg/SVGNode.cc
+1
-1
SVGSVG.cc
skiko/src/jvmMain/cpp/common/svg/SVGSVG.cc
+13
-19
SeveralClassloaders.kt
...jvmTest/kotlin/org/jetbrains/skiko/SeveralClassloaders.kt
+1
-2
No files found.
skiko/src/commonMain/cpp/generated/sksg/InvalidationController.cc
0 → 100644
View file @
af035822
#include "SkSGInvalidationController.h"
#include "common.h"
SKIKO_EXPORT
KNativePointer
org_jetbrains_skia_sksg_InvalidationController_nGetFinalizer
()
{
TODO
(
"implement org_jetbrains_skia_sksg_InvalidationController_nGetFinalizer"
);
}
SKIKO_EXPORT
void
org_jetbrains_skia_sksg_InvalidationController_nMake
()
{
TODO
(
"implement org_jetbrains_skia_sksg_InvalidationController_nMake"
);
}
SKIKO_EXPORT
void
org_jetbrains_skia_sksg_InvalidationController_nInvalidate
()
{
TODO
(
"implement org_jetbrains_skia_sksg_InvalidationController_nInvalidate"
);
}
SKIKO_EXPORT
void
org_jetbrains_skia_sksg_InvalidationController_nGetBounds
()
{
TODO
(
"implement org_jetbrains_skia_sksg_InvalidationController_nGetBounds"
);
}
SKIKO_EXPORT
void
org_jetbrains_skia_sksg_InvalidationController_nReset
()
{
TODO
(
"implement org_jetbrains_skia_sksg_InvalidationController_nReset"
);
}
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/TextStyle.kt
View file @
af035822
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/sksg/InvalidationController.kt
View file @
af035822
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.sksg
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
...
@@ -17,27 +16,20 @@ import kotlin.jvm.JvmStatic
*/
class
InvalidationController
internal
constructor
(
ptr
:
NativePointer
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
@JvmStatic
external
fun
_nGetFinalizer
():
NativePointer
@JvmStatic
external
fun
_nMake
():
NativePointer
@JvmStatic
external
fun
_nInvalidate
(
ptr
:
NativePointer
,
left
:
Float
,
top
:
Float
,
right
:
Float
,
bottom
:
Float
,
matrix
:
FloatArray
?)
@JvmStatic
external
fun
_nGetBounds
(
ptr
:
NativePointer
):
Rect
@JvmStatic
external
fun
_nReset
(
ptr
:
NativePointer
)
init
{
staticLoad
()
}
}
internal
object
_FinalizerHolder
{
val
PTR
=
_nGetFinalizer
()
val
PTR
=
InvalidationController
_nGetFinalizer
()
}
constructor
()
:
this
(
_nMake
())
{}
constructor
()
:
this
(
InvalidationController
_nMake
())
{}
fun
invalidate
(
left
:
Float
,
top
:
Float
,
right
:
Float
,
bottom
:
Float
,
matrix
:
Matrix33
?):
InvalidationController
{
Stats
.
onNativeCall
()
_nInvalidate
(
InvalidationController
_nInvalidate
(
_ptr
,
left
,
top
,
...
...
@@ -51,14 +43,26 @@ class InvalidationController internal constructor(ptr: NativePointer) : Managed(
val
bounds
:
Rect
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetBounds
(
_ptr
)
InvalidationController
_nGetBounds
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
fun
reset
():
InvalidationController
{
Stats
.
onNativeCall
()
_nReset
(
_ptr
)
InvalidationController_nReset
(
_ptr
)
return
this
}
}
\ No newline at end of file
}
@ExternalSymbolName
(
"org_jetbrains_skia_sksg_InvalidationController_nGetFinalizer"
)
private
external
fun
InvalidationController_nGetFinalizer
():
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_sksg_InvalidationController_nMake"
)
private
external
fun
InvalidationController_nMake
():
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_sksg_InvalidationController_nInvalidate"
)
private
external
fun
InvalidationController_nInvalidate
(
ptr
:
NativePointer
,
left
:
Float
,
top
:
Float
,
right
:
Float
,
bottom
:
Float
,
matrix
:
FloatArray
?)
@ExternalSymbolName
(
"org_jetbrains_skia_sksg_InvalidationController_nGetBounds"
)
private
external
fun
InvalidationController_nGetBounds
(
ptr
:
NativePointer
):
Rect
@ExternalSymbolName
(
"org_jetbrains_skia_sksg_InvalidationController_nReset"
)
private
external
fun
InvalidationController_nReset
(
ptr
:
NativePointer
)
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGCanvas.kt
View file @
af035822
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.svg
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
...
@@ -41,7 +40,7 @@ object SVGCanvas {
*/
fun
make
(
bounds
:
Rect
,
out
:
WStream
,
convertTextToPaths
:
Boolean
,
prettyXML
:
Boolean
):
Canvas
{
Stats
.
onNativeCall
()
val
ptr
=
_nMake
(
val
ptr
=
SVGCanvas
_nMake
(
bounds
.
left
,
bounds
.
top
,
bounds
.
right
,
...
...
@@ -58,4 +57,4 @@ object SVGCanvas {
}
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGCanvas__1nMake"
)
private
external
fun
_nMake
(
left
:
Float
,
top
:
Float
,
right
:
Float
,
bottom
:
Float
,
wstreamPtr
:
NativePointer
,
flags
:
Int
):
NativePointer
private
external
fun
SVGCanvas
_nMake
(
left
:
Float
,
top
:
Float
,
right
:
Float
,
bottom
:
Float
,
wstreamPtr
:
NativePointer
,
flags
:
Int
):
NativePointer
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGDOM.kt
View file @
af035822
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.svg
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
...
@@ -17,7 +16,7 @@ class SVGDOM internal constructor(ptr: NativePointer) : RefCnt(ptr) {
}
}
constructor
(
data
:
Data
)
:
this
(
_nMakeFromData
(
getPtr
(
data
)))
{
constructor
(
data
:
Data
)
:
this
(
SVGDOM
_nMakeFromData
(
getPtr
(
data
)))
{
Stats
.
onNativeCall
()
reachabilityBarrier
(
data
)
}
...
...
@@ -25,7 +24,7 @@ class SVGDOM internal constructor(ptr: NativePointer) : RefCnt(ptr) {
val
root
:
SVGSVG
?
get
()
=
try
{
Stats
.
onNativeCall
()
val
ptr
=
_nGetRoot
(
_ptr
)
val
ptr
=
SVGDOM
_nGetRoot
(
_ptr
)
if
(
ptr
==
NullPointer
)
null
else
SVGSVG
(
ptr
)
}
finally
{
reachabilityBarrier
(
this
)
...
...
@@ -37,20 +36,20 @@ class SVGDOM internal constructor(ptr: NativePointer) : RefCnt(ptr) {
@get
:
Deprecated
(
""
)
val
containerSize
:
Point
get
()
=
try
{
_nGetContainerSize
(
_ptr
)
SVGDOM
_nGetContainerSize
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
fun
setContainerSize
(
width
:
Float
,
height
:
Float
):
SVGDOM
{
Stats
.
onNativeCall
()
_nSetContainerSize
(
_ptr
,
width
,
height
)
SVGDOM
_nSetContainerSize
(
_ptr
,
width
,
height
)
return
this
}
fun
setContainerSize
(
size
:
Point
):
SVGDOM
{
Stats
.
onNativeCall
()
_nSetContainerSize
(
_ptr
,
size
.
x
,
size
.
y
)
SVGDOM
_nSetContainerSize
(
_ptr
,
size
.
x
,
size
.
y
)
return
this
}
...
...
@@ -58,7 +57,7 @@ class SVGDOM internal constructor(ptr: NativePointer) : RefCnt(ptr) {
fun
render
(
canvas
:
Canvas
):
SVGDOM
{
return
try
{
Stats
.
onNativeCall
()
_nRender
(
_ptr
,
getPtr
(
canvas
))
SVGDOM
_nRender
(
_ptr
,
getPtr
(
canvas
))
this
}
finally
{
reachabilityBarrier
(
canvas
)
...
...
@@ -68,16 +67,16 @@ class SVGDOM internal constructor(ptr: NativePointer) : RefCnt(ptr) {
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGDOM__1nMakeFromData"
)
private
external
fun
_nMakeFromData
(
dataPtr
:
NativePointer
):
NativePointer
private
external
fun
SVGDOM
_nMakeFromData
(
dataPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGDOM__1nGetRoot"
)
private
external
fun
_nGetRoot
(
ptr
:
NativePointer
):
NativePointer
private
external
fun
SVGDOM
_nGetRoot
(
ptr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGDOM__1nGetContainerSize"
)
private
external
fun
_nGetContainerSize
(
ptr
:
NativePointer
):
Point
private
external
fun
SVGDOM
_nGetContainerSize
(
ptr
:
NativePointer
):
Point
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGDOM__1nSetContainerSize"
)
private
external
fun
_nSetContainerSize
(
ptr
:
NativePointer
,
width
:
Float
,
height
:
Float
)
private
external
fun
SVGDOM
_nSetContainerSize
(
ptr
:
NativePointer
,
width
:
Float
,
height
:
Float
)
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGDOM__1nRender"
)
private
external
fun
_nRender
(
ptr
:
NativePointer
,
canvasPtr
:
NativePointer
)
private
external
fun
SVGDOM
_nRender
(
ptr
:
NativePointer
,
canvasPtr
:
NativePointer
)
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGNode.kt
View file @
af035822
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.svg
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
...
@@ -18,11 +17,11 @@ abstract class SVGNode internal constructor(ptr: NativePointer) : RefCnt(ptr) {
val
tag
:
SVGTag
get
()
=
try
{
Stats
.
onNativeCall
()
SVGTag
.
values
()
.
get
(
_nGetTag
(
_ptr
))
SVGTag
.
values
()
[
SVGNode_nGetTag
(
_ptr
)]
}
finally
{
reachabilityBarrier
(
this
)
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGNode__1nGetTag"
)
private
external
fun
_nGetTag
(
ptr
:
NativePointer
):
Int
private
external
fun
SVGNode
_nGetTag
(
ptr
:
NativePointer
):
Int
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGSVG.kt
View file @
af035822
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.svg
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
...
@@ -18,28 +17,21 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
var
x
:
SVGLength
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetX
(
_ptr
)
SVGSVG
_nGetX
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
set
(
value
)
{
setX
(
value
)
}
fun
setX
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
set
(
value
)
=
try
{
Stats
.
onNativeCall
()
_nSetX
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
SVGSVG_nSetX
(
_ptr
,
value
.
value
,
value
.
unit
.
ordinal
)
}
finally
{
reachabilityBarrier
(
this
)
}
}
var
y
:
SVGLength
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetY
(
_ptr
)
SVGSVG
_nGetY
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
...
...
@@ -50,7 +42,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun
setY
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
Stats
.
onNativeCall
()
_nSetY
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
SVGSVG
_nSetY
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
}
finally
{
reachabilityBarrier
(
this
)
...
...
@@ -60,92 +52,64 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
var
width
:
SVGLength
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetWidth
(
_ptr
)
SVGSVG
_nGetWidth
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
set
(
value
)
{
setWidth
(
value
)
}
fun
setWidth
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
set
(
value
)
=
try
{
Stats
.
onNativeCall
()
_nSetWidth
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
SVGSVG_nSetWidth
(
_ptr
,
value
.
value
,
value
.
unit
.
ordinal
)
}
finally
{
reachabilityBarrier
(
this
)
}
}
var
height
:
SVGLength
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetHeight
(
_ptr
)
SVGSVG
_nGetHeight
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
set
(
value
)
{
setHeight
(
value
)
}
fun
setHeight
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
set
(
value
)
=
try
{
Stats
.
onNativeCall
()
_nSetHeight
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
SVGSVG_nSetHeight
(
_ptr
,
value
.
value
,
value
.
unit
.
ordinal
)
}
finally
{
reachabilityBarrier
(
this
)
}
}
var
preserveAspectRatio
:
SVGPreserveAspectRatio
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetPreserveAspectRatio
(
_ptr
)
SVGSVG
_nGetPreserveAspectRatio
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
set
(
value
)
{
setPreserveAspectRatio
(
value
)
}
fun
setPreserveAspectRatio
(
ratio
:
SVGPreserveAspectRatio
):
SVGSVG
{
return
try
{
set
(
value
)
=
try
{
Stats
.
onNativeCall
()
_nSetPreserveAspectRatio
(
_ptr
,
ratio
.
_align
.
_value
,
ratio
.
_scale
.
ordinal
)
this
SVGSVG_nSetPreserveAspectRatio
(
_ptr
,
value
.
_align
.
_value
,
value
.
_scale
.
ordinal
)
}
finally
{
reachabilityBarrier
(
this
)
}
}
var
viewBox
:
Rect
?
get
()
=
try
{
Stats
.
onNativeCall
()
_nGetViewBox
(
_ptr
)
SVGSVG
_nGetViewBox
(
_ptr
)
}
finally
{
reachabilityBarrier
(
this
)
}
set
(
value
)
{
require
(
value
!=
null
)
{
"Can't set viewBox with value == null"
}
setViewBox
(
value
)
}
fun
setViewBox
(
viewBox
:
Rect
):
SVGSVG
{
return
try
{
set
(
value
)
=
try
{
Stats
.
onNativeCall
()
_nSetViewBox
(
_ptr
,
viewBox
.
left
,
viewBox
.
top
,
viewBox
.
right
,
viewBox
.
bottom
)
this
SVGSVG_nSetViewBox
(
_ptr
,
value
!!
.
left
,
value
.
top
,
value
.
right
,
viewBox
!!
.
bottom
)
}
finally
{
reachabilityBarrier
(
this
)
}
}
fun
getIntrinsicSize
(
lc
:
SVGLengthContext
):
Point
{
return
try
{
Stats
.
onNativeCall
()
_nGetIntrinsicSize
(
_ptr
,
lc
.
width
,
lc
.
height
,
lc
.
dpi
)
SVGSVG
_nGetIntrinsicSize
(
_ptr
,
lc
.
width
,
lc
.
height
,
lc
.
dpi
)
}
finally
{
reachabilityBarrier
(
this
)
}
...
...
@@ -154,40 +118,40 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetX"
)
private
external
fun
_nGetX
(
ptr
:
NativePointer
):
SVGLength
private
external
fun
SVGSVG
_nGetX
(
ptr
:
NativePointer
):
SVGLength
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetY"
)
private
external
fun
_nGetY
(
ptr
:
NativePointer
):
SVGLength
private
external
fun
SVGSVG
_nGetY
(
ptr
:
NativePointer
):
SVGLength
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetWidth"
)
private
external
fun
_nGetWidth
(
ptr
:
NativePointer
):
SVGLength
private
external
fun
SVGSVG
_nGetWidth
(
ptr
:
NativePointer
):
SVGLength
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetHeight"
)
private
external
fun
_nGetHeight
(
ptr
:
NativePointer
):
SVGLength
private
external
fun
SVGSVG
_nGetHeight
(
ptr
:
NativePointer
):
SVGLength
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetPreserveAspectRatio"
)
private
external
fun
_nGetPreserveAspectRatio
(
ptr
:
NativePointer
):
SVGPreserveAspectRatio
private
external
fun
SVGSVG
_nGetPreserveAspectRatio
(
ptr
:
NativePointer
):
SVGPreserveAspectRatio
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetViewBox"
)
private
external
fun
_nGetViewBox
(
ptr
:
NativePointer
):
Rect
?
private
external
fun
SVGSVG
_nGetViewBox
(
ptr
:
NativePointer
):
Rect
?
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nGetIntrinsicSize"
)
private
external
fun
_nGetIntrinsicSize
(
ptr
:
NativePointer
,
width
:
Float
,
height
:
Float
,
dpi
:
Float
):
Point
private
external
fun
SVGSVG
_nGetIntrinsicSize
(
ptr
:
NativePointer
,
width
:
Float
,
height
:
Float
,
dpi
:
Float
):
Point
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nSetX"
)
private
external
fun
_nSetX
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
private
external
fun
SVGSVG
_nSetX
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nSetY"
)
private
external
fun
_nSetY
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
private
external
fun
SVGSVG
_nSetY
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nSetWidth"
)
private
external
fun
_nSetWidth
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
private
external
fun
SVGSVG
_nSetWidth
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nSetHeight"
)
private
external
fun
_nSetHeight
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
private
external
fun
SVGSVG
_nSetHeight
(
ptr
:
NativePointer
,
value
:
Float
,
unit
:
Int
)
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nSetPreserveAspectRatio"
)
private
external
fun
_nSetPreserveAspectRatio
(
ptr
:
NativePointer
,
align
:
Int
,
scale
:
Int
)
private
external
fun
SVGSVG
_nSetPreserveAspectRatio
(
ptr
:
NativePointer
,
align
:
Int
,
scale
:
Int
)
@ExternalSymbolName
(
"org_jetbrains_skia_svg_SVGSVG__1nSetViewBox"
)
private
external
fun
_nSetViewBox
(
ptr
:
NativePointer
,
l
:
Float
,
t
:
Float
,
r
:
Float
,
b
:
Float
)
private
external
fun
SVGSVG
_nSetViewBox
(
ptr
:
NativePointer
,
l
:
Float
,
t
:
Float
,
r
:
Float
,
b
:
Float
)
skiko/src/jvmMain/cpp/common/sksg/InvalidationController.cc
0 → 100644
View file @
af035822
#include <jni.h>
#include "../interop.hh"
#include "SkSGInvalidationController.h"
using
namespace
sksg
;
static
void
deleteInvalidationController
(
InvalidationController
*
controller
)
{
delete
controller
;
}
extern
"C"
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skia_sksg_InvalidationControllerKt_InvalidationController_1nGetFinalizer
(
JNIEnv
*
env
,
jclass
jclass
)
{
return
static_cast
<
jlong
>
(
reinterpret_cast
<
uintptr_t
>
(
&
deleteInvalidationController
));
}
extern
"C"
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skia_sksg_InvalidationControllerKt_InvalidationController_1nMake
(
JNIEnv
*
env
,
jclass
jclass
)
{
InvalidationController
*
instance
=
new
InvalidationController
();
return
reinterpret_cast
<
jlong
>
(
instance
);
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_sksg_InvalidationControllerKt_InvalidationController_1nInvalidate
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
jfloat
left
,
jfloat
top
,
jfloat
right
,
jfloat
bottom
,
jfloatArray
matrixArr
)
{
InvalidationController
*
instance
=
reinterpret_cast
<
InvalidationController
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkRect
bounds
{
left
,
top
,
right
,
bottom
};
std
::
unique_ptr
<
SkMatrix
>
matrix
=
skMatrix
(
env
,
matrixArr
);
instance
->
inval
(
bounds
,
*
matrix
.
get
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_sksg_InvalidationControllerKt_InvalidationController_1nGetBounds
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
InvalidationController
*
instance
=
reinterpret_cast
<
InvalidationController
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
skija
::
Rect
::
fromSkRect
(
env
,
instance
->
bounds
());
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_sksg_InvalidationControllerKt_InvalidationController_1nReset
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
InvalidationController
*
instance
=
reinterpret_cast
<
InvalidationController
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
instance
->
reset
();
}
skiko/src/jvmMain/cpp/common/svg/SVGDOM.cc
View file @
af035822
...
...
@@ -6,7 +6,7 @@
#include "SkSVGDOM.h"
#include "SkSVGSVG.h"
extern
"C"
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
_1
nMakeFromData
extern
"C"
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
SVGDOM_
nMakeFromData
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
dataPtr
)
{
SkData
*
data
=
reinterpret_cast
<
SkData
*>
(
static_cast
<
uintptr_t
>
(
dataPtr
));
SkMemoryStream
stream
(
sk_ref_sp
(
data
));
...
...
@@ -14,7 +14,7 @@ extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skia_svg_SVGDOMKt__1nMakeF
return
reinterpret_cast
<
jlong
>
(
instance
.
release
());
}
extern
"C"
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
_1
nGetRoot
extern
"C"
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
SVGDOM_
nGetRoot
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGDOM
*
instance
=
reinterpret_cast
<
SkSVGDOM
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkSVGSVG
*
root
=
instance
->
getRoot
();
...
...
@@ -22,7 +22,7 @@ extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skia_svg_SVGDOMKt__1nGetRo
return
reinterpret_cast
<
jlong
>
(
root
);
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
_1
nGetContainerSize
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
SVGDOM_
nGetContainerSize
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGDOM
*
instance
=
reinterpret_cast
<
SkSVGDOM
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
const
SkSize
&
size
=
instance
->
containerSize
();
...
...
@@ -35,7 +35,7 @@ extern "C" JNIEXPORT void JNICALL Java_org_jetbrains_skia_svg_SVGDOMKt__1nSetCon
instance
->
setContainerSize
(
SkSize
{
width
,
height
});
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
_1
nRender
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGDOMKt_
SVGDOM_
nRender
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
jlong
canvasPtr
)
{
SkSVGDOM
*
instance
=
reinterpret_cast
<
SkSVGDOM
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkCanvas
*
canvas
=
reinterpret_cast
<
SkCanvas
*>
(
static_cast
<
uintptr_t
>
(
canvasPtr
));
...
...
skiko/src/jvmMain/cpp/common/svg/SVGNode.cc
View file @
af035822
...
...
@@ -2,7 +2,7 @@
#include "../interop.hh"
#include "SkSVGNode.h"
extern
"C"
JNIEXPORT
jint
JNICALL
Java_org_jetbrains_skia_svg_SVGNodeKt_
_1
nGetTag
extern
"C"
JNIEXPORT
jint
JNICALL
Java_org_jetbrains_skia_svg_SVGNodeKt_
SVGNode_
nGetTag
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGNode
*
instance
=
reinterpret_cast
<
SkSVGNode
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
static_cast
<
jint
>
(
instance
->
tag
());
...
...
skiko/src/jvmMain/cpp/common/svg/SVGSVG.cc
View file @
af035822
...
...
@@ -4,50 +4,44 @@
#include "SkSVGSVG.h"
#include "SkSVGRenderContext.h"
extern
"C"
JNIEXPORT
jint
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt__1nGetTag
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGNode
*
instance
=
reinterpret_cast
<
SkSVGNode
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
static_cast
<
jint
>
(
instance
->
tag
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt__1nGetX
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_SVGSVG_nGetX
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
skija
::
svg
::
SVGLength
::
toJava
(
env
,
instance
->
getX
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nGetY
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nGetY
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
skija
::
svg
::
SVGLength
::
toJava
(
env
,
instance
->
getY
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nGetWidth
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nGetWidth
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
skija
::
svg
::
SVGLength
::
toJava
(
env
,
instance
->
getWidth
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nGetHeight
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nGetHeight
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
skija
::
svg
::
SVGLength
::
toJava
(
env
,
instance
->
getHeight
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nGetPreserveAspectRatio
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nGetPreserveAspectRatio
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
return
skija
::
svg
::
SVGPreserveAspectRatio
::
toJava
(
env
,
instance
->
getPreserveAspectRatio
());
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nGetViewBox
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nGetViewBox
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkTLazy
<
SkSVGViewBoxType
>
viewBox
=
instance
->
getViewBox
();
return
viewBox
.
isValid
()
?
skija
::
Rect
::
fromSkRect
(
env
,
*
viewBox
.
get
())
:
nullptr
;
}
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nGetIntrinsicSize
extern
"C"
JNIEXPORT
jobject
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nGetIntrinsicSize
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
float
width
,
float
height
,
float
dpi
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkSVGLengthContext
lc
({
width
,
height
},
dpi
);
...
...
@@ -55,42 +49,42 @@ extern "C" JNIEXPORT jobject JNICALL Java_org_jetbrains_skia_svg_SVGSVGKt__1nGet
return
skija
::
Point
::
fromSkPoint
(
env
,
{
size
.
width
(),
size
.
height
()});
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nSetX
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nSetX
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
float
value
,
int
unit
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkSVGLength
lenght
(
value
,
static_cast
<
SkSVGLength
::
Unit
>
(
unit
));
instance
->
setX
(
lenght
);
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nSetY
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nSetY
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
float
value
,
int
unit
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkSVGLength
lenght
(
value
,
static_cast
<
SkSVGLength
::
Unit
>
(
unit
));
instance
->
setY
(
lenght
);
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nSetWidth
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nSetWidth
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
float
value
,
int
unit
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkSVGLength
lenght
(
value
,
static_cast
<
SkSVGLength
::
Unit
>
(
unit
));
instance
->
setWidth
(
lenght
);
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nSetHeight
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nSetHeight
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
float
value
,
int
unit
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
SkSVGLength
lenght
(
value
,
static_cast
<
SkSVGLength
::
Unit
>
(
unit
));
instance
->
setHeight
(
lenght
);
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nSetPreserveAspectRatio
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nSetPreserveAspectRatio
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
jint
align
,
jint
scale
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
instance
->
setPreserveAspectRatio
(
SkSVGPreserveAspectRatio
{
static_cast
<
SkSVGPreserveAspectRatio
::
Align
>
(
align
),
static_cast
<
SkSVGPreserveAspectRatio
::
Scale
>
(
scale
)
});
}
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
_1
nSetViewBox
extern
"C"
JNIEXPORT
void
JNICALL
Java_org_jetbrains_skia_svg_SVGSVGKt_
SVGSVG_
nSetViewBox
(
JNIEnv
*
env
,
jclass
jclass
,
jlong
ptr
,
float
l
,
float
t
,
float
r
,
float
b
)
{
SkSVGSVG
*
instance
=
reinterpret_cast
<
SkSVGSVG
*>
(
static_cast
<
uintptr_t
>
(
ptr
));
instance
->
setViewBox
(
SkRect
::
MakeLTRB
(
l
,
t
,
r
,
b
));
...
...
skiko/src/jvmTest/kotlin/org/jetbrains/skiko/
util/
SeveralClassloaders.kt
→
skiko/src/jvmTest/kotlin/org/jetbrains/skiko/SeveralClassloaders.kt
View file @
af035822
package
org.jetbrains.skiko
.util
package
org.jetbrains.skiko
import
org.jetbrains.skiko.Library
import
org.junit.Test
import
java.net.URL
import
java.net.URLClassLoader
...
...
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