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
5c256dcf
Unverified
Commit
5c256dcf
authored
Sep 03, 2021
by
Nikolay Igotti
Committed by
GitHub
Sep 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Roughly complete commonization (#161)
parent
fc166bd6
Changes
36
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
352 additions
and
377 deletions
+352
-377
Codec.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Codec.kt
+20
-22
Expects.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Expects.kt
+2
-0
FontExtents.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/FontExtents.kt
+10
-8
OutputWStream.kt
...src/commonMain/kotlin/org/jetbrains/skia/OutputWStream.kt
+2
-1
PaintFilterCanvas.kt
...commonMain/kotlin/org/jetbrains/skia/PaintFilterCanvas.kt
+4
-4
PathMeasure.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/PathMeasure.kt
+18
-18
PictureRecorder.kt
...c/commonMain/kotlin/org/jetbrains/skia/PictureRecorder.kt
+7
-5
RuntimeEffect.kt
...src/commonMain/kotlin/org/jetbrains/skia/RuntimeEffect.kt
+2
-0
ShadowUtils.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/ShadowUtils.kt
+4
-2
Surface.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Surface.kt
+66
-119
TextBlobBuilder.kt
...c/commonMain/kotlin/org/jetbrains/skia/TextBlobBuilder.kt
+15
-16
Managed.kt
.../src/commonMain/kotlin/org/jetbrains/skia/impl/Managed.kt
+2
-1
DecorationStyle.kt
...in/kotlin/org/jetbrains/skia/paragraph/DecorationStyle.kt
+2
-2
FontCollection.kt
...ain/kotlin/org/jetbrains/skia/paragraph/FontCollection.kt
+17
-16
LineMetrics.kt
...onMain/kotlin/org/jetbrains/skia/paragraph/LineMetrics.kt
+16
-16
Paragraph.kt
...mmonMain/kotlin/org/jetbrains/skia/paragraph/Paragraph.kt
+32
-31
ParagraphBuilder.kt
...n/kotlin/org/jetbrains/skia/paragraph/ParagraphBuilder.kt
+11
-10
ParagraphCache.kt
...ain/kotlin/org/jetbrains/skia/paragraph/ParagraphCache.kt
+15
-13
ParagraphStyle.kt
...ain/kotlin/org/jetbrains/skia/paragraph/ParagraphStyle.kt
+20
-18
PlaceholderStyle.kt
...n/kotlin/org/jetbrains/skia/paragraph/PlaceholderStyle.kt
+11
-11
PositionWithAffinity.kt
...tlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
+3
-3
Shadow.kt
.../commonMain/kotlin/org/jetbrains/skia/paragraph/Shadow.kt
+7
-7
StrutStyle.kt
...monMain/kotlin/org/jetbrains/skia/paragraph/StrutStyle.kt
+14
-12
TextBox.kt
...commonMain/kotlin/org/jetbrains/skia/paragraph/TextBox.kt
+0
-0
TextStyle.kt
...mmonMain/kotlin/org/jetbrains/skia/paragraph/TextStyle.kt
+32
-30
TypefaceFontProvider.kt
...tlin/org/jetbrains/skia/paragraph/TypefaceFontProvider.kt
+5
-5
TextBlobBuilderRunHandler.kt
...in/org/jetbrains/skia/shaper/TextBlobBuilderRunHandler.kt
+6
-6
TrivialBidiRunIterator.kt
...otlin/org/jetbrains/skia/shaper/TrivialBidiRunIterator.kt
+0
-0
TrivialFontRunIterator.kt
...otlin/org/jetbrains/skia/shaper/TrivialFontRunIterator.kt
+0
-0
TrivialScriptRunIterator.kt
...lin/org/jetbrains/skia/shaper/TrivialScriptRunIterator.kt
+0
-0
Actuals.js.kt
skiko/src/jsMain/kotlin/org/jetbrains/skia/Actuals.js.kt
+1
-0
Managed.js.kt
...o/src/jsMain/kotlin/org/jetbrains/skia/impl/Managed.js.kt
+3
-0
Actuals.jvm.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skia/Actuals.jvm.kt
+1
-0
Managed.jvm.kt
...src/jvmMain/kotlin/org/jetbrains/skia/impl/Managed.jvm.kt
+1
-1
Actuals.native.kt
.../macosX64Main/kotlin/org/jetbrains/skia/Actuals.native.kt
+1
-0
Managed.native.kt
...sX64Main/kotlin/org/jetbrains/skia/impl/Managed.native.kt
+2
-0
No files found.
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/Codec.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/Codec.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.IllegalArgumentException
import
org.jetbrains.skia.impl.reachabilityBarrier
import
java.lang.RuntimeException
import
kotlin.jvm.JvmStatic
import
java.lang.UnsupportedOperationException
import
java.lang.ref.Reference
class
Codec
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
),
IHasImageInfo
{
class
Codec
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
),
IHasImageInfo
{
companion
object
{
companion
object
{
...
@@ -19,11 +17,11 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -19,11 +17,11 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
val
ptr
=
_nMakeFromData
(
Native
.
getPtr
(
data
))
_nMakeFromData
(
getPtr
(
data
))
require
(
ptr
!=
0L
)
{
"Unsupported format"
}
require
(
ptr
!=
0L
)
{
"Unsupported format"
}
Codec
(
ptr
)
Codec
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
data
)
reachabilityBarrier
(
data
)
}
}
}
}
...
@@ -67,29 +65,29 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -67,29 +65,29 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
}
}
_imageInfo
!!
_imageInfo
!!
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
size
:
IPoint
val
size
:
IPoint
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
IPoint
.
Companion
.
_makeFromLong
(
_nGetSize
(
_ptr
))
IPoint
.
_makeFromLong
(
_nGetSize
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
encodedOrigin
:
EncodedOrigin
val
encodedOrigin
:
EncodedOrigin
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
EncodedOrigin
.
values
().
get
(
_nGetEncodedOrigin
(
_ptr
))
EncodedOrigin
.
values
().
get
(
_nGetEncodedOrigin
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
encodedImageFormat
:
EncodedImageFormat
val
encodedImageFormat
:
EncodedImageFormat
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
EncodedImageFormat
.
values
().
get
(
_nGetEncodedImageFormat
(
_ptr
))
EncodedImageFormat
.
values
().
get
(
_nGetEncodedImageFormat
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -150,14 +148,14 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -150,14 +148,14 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
_validateResult
(
_validateResult
(
_nReadPixels
(
_nReadPixels
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
bitmap
),
getPtr
(
bitmap
),
0
,
0
,
-
1
-
1
)
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
bitmap
)
reachabilityBarrier
(
bitmap
)
}
}
}
}
...
@@ -207,14 +205,14 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -207,14 +205,14 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
_validateResult
(
_validateResult
(
_nReadPixels
(
_nReadPixels
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
bitmap
),
getPtr
(
bitmap
),
frame
,
frame
,
-
1
-
1
)
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
bitmap
)
reachabilityBarrier
(
bitmap
)
}
}
}
}
...
@@ -265,14 +263,14 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -265,14 +263,14 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
_validateResult
(
_validateResult
(
_nReadPixels
(
_nReadPixels
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
bitmap
),
getPtr
(
bitmap
),
frame
,
frame
,
priorFrame
priorFrame
)
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
bitmap
)
reachabilityBarrier
(
bitmap
)
}
}
}
}
...
@@ -288,7 +286,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -288,7 +286,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFrameCount
(
_ptr
)
_nGetFrameCount
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -305,7 +303,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -305,7 +303,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFrameInfo
(
_ptr
,
frame
)
_nGetFrameInfo
(
_ptr
,
frame
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -328,7 +326,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -328,7 +326,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFramesInfo
(
_ptr
)
_nGetFramesInfo
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -355,7 +353,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
...
@@ -355,7 +353,7 @@ class Codec internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.PTR)
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetRepetitionCount
(
_ptr
)
_nGetRepetitionCount
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
internal
object
_FinalizerHolder
{
internal
object
_FinalizerHolder
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Expects.kt
View file @
5c256dcf
...
@@ -8,6 +8,8 @@ expect fun String.intCodePoints(): IntArray
...
@@ -8,6 +8,8 @@ expect fun String.intCodePoints(): IntArray
expect
fun
defaultLanguageTag
():
String
expect
fun
defaultLanguageTag
():
String
expect
abstract
class
OutputStream
expect
class
Pattern
{
expect
class
Pattern
{
fun
split
(
input
:
CharSequence
):
Array
<
String
?
>?
fun
split
(
input
:
CharSequence
):
Array
<
String
?
>?
fun
matcher
(
input
:
CharSequence
):
Matcher
fun
matcher
(
input
:
CharSequence
):
Matcher
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/FontExtents.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/FontExtents.kt
View file @
5c256dcf
package
org.jetbrains.skia
package
org.jetbrains.skia
import
kotlin.math.abs
class
FontExtents
(
val
ascender
:
Float
,
val
descender
:
Float
,
val
lineGap
:
Float
)
{
class
FontExtents
(
val
ascender
:
Float
,
val
descender
:
Float
,
val
lineGap
:
Float
)
{
val
ascenderAbs
:
Float
val
ascenderAbs
:
Float
get
()
=
Math
.
abs
(
ascender
)
get
()
=
abs
(
ascender
)
val
lineHeight
:
Float
val
lineHeight
:
Float
get
()
=
-
ascender
+
descender
+
lineGap
get
()
=
-
ascender
+
descender
+
lineGap
...
@@ -11,9 +13,9 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float)
...
@@ -11,9 +13,9 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float)
if
(
o
!
is
FontExtents
)
return
false
if
(
o
!
is
FontExtents
)
return
false
val
other
=
o
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(
java
.
lang
.
Float
.
compare
(
ascender
,
other
.
ascender
)
!=
0
)
return
false
if
(
ascender
.
compareTo
(
other
.
ascender
)
!=
0
)
return
false
if
(
java
.
lang
.
Float
.
compare
(
descender
,
other
.
descender
)
!=
0
)
return
false
if
(
descender
.
compareTo
(
other
.
descender
)
!=
0
)
return
false
return
if
(
java
.
lang
.
Float
.
compare
(
lineGap
,
other
.
lineGap
)
!=
0
)
false
else
true
return
lineGap
.
compareTo
(
other
.
lineGap
)
==
0
}
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
@@ -23,13 +25,13 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float)
...
@@ -23,13 +25,13 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float)
override
fun
hashCode
():
Int
{
override
fun
hashCode
():
Int
{
val
PRIME
=
59
val
PRIME
=
59
var
result
=
1
var
result
=
1
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
ascender
)
result
=
result
*
PRIME
+
ascender
.
toBits
(
)
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
descender
)
result
=
result
*
PRIME
+
descender
.
toBits
(
)
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
lineGap
)
result
=
result
*
PRIME
+
lineGap
.
toBits
(
)
return
result
return
result
}
}
override
fun
toString
():
String
{
override
fun
toString
():
String
{
return
"FontExtents(_ascender=
"
+
ascender
+
", _descender="
+
descender
+
", _lineGap="
+
lineGap
+
"
)"
return
"FontExtents(_ascender=
$ascender, _descender=$descender, _lineGap=$lineGap
)"
}
}
}
}
\ No newline at end of file
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/OutputWStream.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/OutputWStream.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.io.OutputStream
import
kotlin.jvm.JvmStatic
class
OutputWStream
(
out
:
OutputStream
?)
:
WStream
(
_nMake
(
out
),
_FinalizerHolder
.
PTR
)
{
class
OutputWStream
(
out
:
OutputStream
?)
:
WStream
(
_nMake
(
out
),
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/PaintFilterCanvas.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/PaintFilterCanvas.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
/**
/**
* A utility proxy base class for implementing draw/paint filters.
* A utility proxy base class for implementing draw/paint filters.
*/
*/
abstract
class
PaintFilterCanvas
(
canvas
:
Canvas
,
unrollDrawable
:
Boolean
)
:
abstract
class
PaintFilterCanvas
(
canvas
:
Canvas
,
unrollDrawable
:
Boolean
)
:
Canvas
(
_nMake
(
Native
.
Companion
.
getPtr
(
canvas
),
unrollDrawable
),
true
,
canvas
)
{
Canvas
(
_nMake
(
getPtr
(
canvas
),
unrollDrawable
),
true
,
canvas
)
{
companion
object
{
companion
object
{
external
fun
_nMake
(
canvasPtr
:
Long
,
unrollDrawable
:
Boolean
):
Long
external
fun
_nMake
(
canvasPtr
:
Long
,
unrollDrawable
:
Boolean
):
Long
...
@@ -42,6 +42,6 @@ abstract class PaintFilterCanvas(canvas: Canvas, unrollDrawable: Boolean) :
...
@@ -42,6 +42,6 @@ abstract class PaintFilterCanvas(canvas: Canvas, unrollDrawable: Boolean) :
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nAttachToJava
(
_ptr
)
_nAttachToJava
(
_ptr
)
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Reference
.
reachabilityFence
(
canvas
)
reachabilityBarrier
(
canvas
)
}
}
}
}
\ No newline at end of file
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/PathMeasure.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/PathMeasure.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
PathMeasure
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
class
PathMeasure
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -53,14 +54,13 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -53,14 +54,13 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
* Initialize the pathmeasure with the specified path. The parts of the path that are needed
* Initialize the pathmeasure with the specified path. The parts of the path that are needed
* are copied, so the client is free to modify/delete the path after this call.
* are copied, so the client is free to modify/delete the path after this call.
*/
*/
@JvmOverloads
constructor
(
constructor
(
path
:
Path
?,
path
:
Path
?,
forceClosed
:
Boolean
=
false
,
forceClosed
:
Boolean
=
false
,
resScale
:
Float
=
1f
resScale
:
Float
=
1f
)
:
this
(
_nMakePath
(
Native
.
Companion
.
getPtr
(
path
),
forceClosed
,
resScale
))
{
)
:
this
(
_nMakePath
(
getPtr
(
path
),
forceClosed
,
resScale
))
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Reference
.
reachabilityFence
(
path
)
reachabilityBarrier
(
path
)
}
}
/**
/**
...
@@ -70,10 +70,10 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -70,10 +70,10 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
fun
setPath
(
path
:
Path
?,
forceClosed
:
Boolean
):
PathMeasure
{
fun
setPath
(
path
:
Path
?,
forceClosed
:
Boolean
):
PathMeasure
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetPath
(
_ptr
,
Native
.
Companion
.
getPtr
(
path
),
forceClosed
)
_nSetPath
(
_ptr
,
getPtr
(
path
),
forceClosed
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
path
)
reachabilityBarrier
(
path
)
}
}
}
}
...
@@ -86,7 +86,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -86,7 +86,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLength
(
_ptr
)
_nGetLength
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -100,7 +100,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -100,7 +100,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetPosition
(
_ptr
,
distance
)
_nGetPosition
(
_ptr
,
distance
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -115,7 +115,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -115,7 +115,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetTangent
(
_ptr
,
distance
)
_nGetTangent
(
_ptr
,
distance
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -130,7 +130,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -130,7 +130,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetRSXform
(
_ptr
,
distance
)
_nGetRSXform
(
_ptr
,
distance
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -144,9 +144,9 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -144,9 +144,9 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
mat
=
_nGetMatrix
(
_ptr
,
distance
,
getPosition
,
getTangent
)
val
mat
=
_nGetMatrix
(
_ptr
,
distance
,
getPosition
,
getTangent
)
mat
?.
let
{
Matrix33
(*
it
.
c
lone
())
}
mat
?.
let
{
Matrix33
(*
it
.
c
opyOf
())
}
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -164,12 +164,12 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -164,12 +164,12 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
_ptr
,
_ptr
,
startD
,
startD
,
endD
,
endD
,
Native
.
Companion
.
getPtr
(
dst
),
getPtr
(
dst
),
startWithMoveTo
startWithMoveTo
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
dst
)
reachabilityBarrier
(
dst
)
}
}
}
}
...
@@ -181,7 +181,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -181,7 +181,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nIsClosed
(
_ptr
)
_nIsClosed
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -193,7 +193,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
...
@@ -193,7 +193,7 @@ class PathMeasure internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolde
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nNextContour
(
_ptr
)
_nNextContour
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/PictureRecorder.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/PictureRecorder.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
PictureRecorder
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
class
PictureRecorder
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -72,7 +74,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -72,7 +74,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
),
false
,
this
),
false
,
this
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -85,7 +87,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -85,7 +87,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
val
ptr
=
_nGetRecordingCanvas
(
_ptr
)
val
ptr
=
_nGetRecordingCanvas
(
_ptr
)
if
(
ptr
==
0L
)
null
else
Canvas
(
ptr
,
false
,
this
)
if
(
ptr
==
0L
)
null
else
Canvas
(
ptr
,
false
,
this
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -104,7 +106,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -104,7 +106,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Picture
(
_nFinishRecordingAsPicture
(
_ptr
))
Picture
(
_nFinishRecordingAsPicture
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -131,7 +133,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -131,7 +133,7 @@ class PictureRecorder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
)
)
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
}
}
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/RuntimeEffect.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/RuntimeEffect.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.RefCnt
import
org.jetbrains.skia.impl.RefCnt
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
kotlin.jvm.JvmStatic
class
RuntimeEffect
internal
constructor
(
ptr
:
Long
)
:
RefCnt
(
ptr
)
{
class
RuntimeEffect
internal
constructor
(
ptr
:
Long
)
:
RefCnt
(
ptr
)
{
companion
object
{
companion
object
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/ShadowUtils.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/ShadowUtils.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
kotlin.jvm.JvmStatic
object
ShadowUtils
{
object
ShadowUtils
{
/**
/**
...
@@ -39,8 +41,8 @@ object ShadowUtils {
...
@@ -39,8 +41,8 @@ object ShadowUtils {
if
(
transparentOccluder
)
flags
=
flags
or
1
if
(
transparentOccluder
)
flags
=
flags
or
1
if
(
geometricOnly
)
flags
=
flags
or
2
if
(
geometricOnly
)
flags
=
flags
or
2
_nDrawShadow
(
_nDrawShadow
(
Native
.
Companion
.
getPtr
(
canvas
),
Native
.
getPtr
(
canvas
),
Native
.
Companion
.
getPtr
(
path
),
Native
.
getPtr
(
path
),
zPlaneParams
.
x
,
zPlaneParams
.
x
,
zPlaneParams
.
y
,
zPlaneParams
.
y
,
zPlaneParams
.
z
,
zPlaneParams
.
z
,
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/Surface.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/Surface.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.RefCnt
import
org.jetbrains.skia.impl.RefCnt
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.IllegalArgumentException
import
org.jetbrains.skia.impl.reachabilityBarrier
import
java.lang.ref.Reference
import
kotlin.jvm.JvmStatic
class
Surface
:
RefCnt
{
class
Surface
:
RefCnt
{
companion
object
{
companion
object
{
...
@@ -53,21 +53,16 @@ class Surface : RefCnt {
...
@@ -53,21 +53,16 @@ class Surface : RefCnt {
surfaceProps
:
SurfaceProps
?
surfaceProps
:
SurfaceProps
?
):
Surface
{
):
Surface
{
return
try
{
return
try
{
assert
(
pixmap
!=
null
)
{
"Can’t makeRasterDirect with pixmap == null"
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeRasterDirectWithPixmap
(
val
ptr
=
_nMakeRasterDirectWithPixmap
(
Native
.
Companion
.
getPtr
(
pixmap
),
surfaceProps
getPtr
(
pixmap
),
surfaceProps
)
)
require
(
ptr
!=
0L
)
{
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeRasterDirect($pixmap, $surfaceProps)"
"Failed Surface.makeRasterDirect(%s, %s)"
,
pixmap
,
surfaceProps
)
}
}
Surface
(
ptr
)
Surface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
pixmap
)
reachabilityBarrier
(
pixmap
)
}
}
}
}
...
@@ -107,30 +102,23 @@ class Surface : RefCnt {
...
@@ -107,30 +102,23 @@ class Surface : RefCnt {
surfaceProps
:
SurfaceProps
?
surfaceProps
:
SurfaceProps
?
):
Surface
{
):
Surface
{
return
try
{
return
try
{
assert
(
imageInfo
!=
null
)
{
"Can’t makeRasterDirect with imageInfo == null"
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeRasterDirect
(
val
ptr
=
_nMakeRasterDirect
(
imageInfo
.
width
,
imageInfo
.
width
,
imageInfo
.
height
,
imageInfo
.
height
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
Native
.
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
),
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
),
pixelsPtr
,
pixelsPtr
,
rowBytes
,
rowBytes
,
surfaceProps
surfaceProps
)
)
require
(
ptr
!=
0L
)
{
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeRasterDirect($imageInfo, $pixelsPtr, $rowBytes, $surfaceProps)"
"Failed Surface.makeRasterDirect(%s, %d, %d, %s)"
,
imageInfo
,
pixelsPtr
,
rowBytes
,
surfaceProps
)
}
}
Surface
(
ptr
)
Surface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
imageInfo
.
colorInfo
.
colorSpace
)
reachabilityBarrier
(
imageInfo
.
colorInfo
.
colorSpace
)
}
}
}
}
...
@@ -213,28 +201,22 @@ class Surface : RefCnt {
...
@@ -213,28 +201,22 @@ class Surface : RefCnt {
surfaceProps
:
SurfaceProps
?
surfaceProps
:
SurfaceProps
?
):
Surface
{
):
Surface
{
return
try
{
return
try
{
assert
(
imageInfo
!=
null
)
{
"Can’t makeRaster with imageInfo == null"
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeRaster
(
val
ptr
=
_nMakeRaster
(
imageInfo
.
width
,
imageInfo
.
width
,
imageInfo
.
height
,
imageInfo
.
height
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
Native
.
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
),
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
),
rowBytes
,
rowBytes
,
surfaceProps
surfaceProps
)
)
require
(
ptr
!=
0L
)
{
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeRaster($imageInfo, $rowBytes, $surfaceProps)"
"Failed Surface.makeRaster(%s, %d, %s)"
,
imageInfo
,
rowBytes
,
surfaceProps
)
}
}
Surface
(
ptr
)
Surface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
imageInfo
.
colorInfo
.
colorSpace
)
reachabilityBarrier
(
imageInfo
.
colorInfo
.
colorSpace
)
}
}
}
}
/**
/**
...
@@ -282,7 +264,6 @@ class Surface : RefCnt {
...
@@ -282,7 +264,6 @@ class Surface : RefCnt {
* @return Surface if all parameters are valid; otherwise, null
* @return Surface if all parameters are valid; otherwise, null
* @see [https://fiddle.skia.org/c/@Surface_MakeFromBackendTexture](https://fiddle.skia.org/c/@Surface_MakeFromBackendTexture)
* @see [https://fiddle.skia.org/c/@Surface_MakeFromBackendTexture](https://fiddle.skia.org/c/@Surface_MakeFromBackendTexture)
*/
*/
@JvmOverloads
fun
makeFromBackendRenderTarget
(
fun
makeFromBackendRenderTarget
(
context
:
DirectContext
,
context
:
DirectContext
,
rt
:
BackendRenderTarget
,
rt
:
BackendRenderTarget
,
...
@@ -292,34 +273,23 @@ class Surface : RefCnt {
...
@@ -292,34 +273,23 @@ class Surface : RefCnt {
surfaceProps
:
SurfaceProps
?
=
null
surfaceProps
:
SurfaceProps
?
=
null
):
Surface
{
):
Surface
{
return
try
{
return
try
{
assert
(
context
!=
null
)
{
"Can’t makeFromBackendRenderTarget with context == null"
}
assert
(
rt
!=
null
)
{
"Can’t makeFromBackendRenderTarget with rt == null"
}
assert
(
origin
!=
null
)
{
"Can’t makeFromBackendRenderTarget with origin == null"
}
assert
(
colorFormat
!=
null
)
{
"Can’t makeFromBackendRenderTarget with colorFormat == null"
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeFromBackendRenderTarget
(
val
ptr
=
_nMakeFromBackendRenderTarget
(
Native
.
Companion
.
getPtr
(
context
),
getPtr
(
context
),
Native
.
Companion
.
getPtr
(
rt
),
getPtr
(
rt
),
origin
.
ordinal
,
origin
.
ordinal
,
colorFormat
.
ordinal
,
colorFormat
.
ordinal
,
Native
.
Companion
.
getPtr
(
colorSpace
),
getPtr
(
colorSpace
),
surfaceProps
surfaceProps
)
)
require
(
ptr
!=
0L
)
{
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeFromBackendRenderTarget($context, $rt, $origin, $colorFormat, $colorSpace)"
"Failed Surface.makeFromBackendRenderTarget(%s, %s, %s, %s, %s)"
,
context
,
rt
,
origin
,
colorFormat
,
colorSpace
)
}
}
Surface
(
ptr
,
context
,
rt
)
Surface
(
ptr
,
context
,
rt
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
context
)
reachabilityBarrier
(
context
)
Reference
.
reachabilityFence
(
rt
)
reachabilityBarrier
(
rt
)
Reference
.
reachabilityFence
(
colorSpace
)
reachabilityBarrier
(
colorSpace
)
}
}
}
}
...
@@ -333,34 +303,23 @@ class Surface : RefCnt {
...
@@ -333,34 +303,23 @@ class Surface : RefCnt {
surfaceProps
:
SurfaceProps
?
surfaceProps
:
SurfaceProps
?
):
Surface
{
):
Surface
{
return
try
{
return
try
{
assert
(
context
!=
null
)
{
"Can’t makeFromBackendRenderTarget with context == null"
}
assert
(
origin
!=
null
)
{
"Can’t makeFromBackendRenderTarget with origin == null"
}
assert
(
colorFormat
!=
null
)
{
"Can’t makeFromBackendRenderTarget with colorFormat == null"
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeFromMTKView
(
val
ptr
=
_nMakeFromMTKView
(
Native
.
Companion
.
getPtr
(
context
),
getPtr
(
context
),
mtkViewPtr
,
mtkViewPtr
,
origin
.
ordinal
,
origin
.
ordinal
,
sampleCount
,
sampleCount
,
colorFormat
.
ordinal
,
colorFormat
.
ordinal
,
Native
.
Companion
.
getPtr
(
colorSpace
),
getPtr
(
colorSpace
),
surfaceProps
surfaceProps
)
)
require
(
ptr
!=
0L
)
{
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeFromMTKView($context, $mtkViewPtr $origin, $colorFormat, $surfaceProps)"
"Failed Surface.makeFromMTKView(%s, %s, %s, %s, %s, %s)"
,
context
,
mtkViewPtr
,
origin
,
colorFormat
,
colorSpace
,
surfaceProps
)
}
}
Surface
(
ptr
,
context
)
Surface
(
ptr
,
context
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
context
)
reachabilityBarrier
(
context
)
Reference
.
reachabilityFence
(
colorSpace
)
reachabilityBarrier
(
colorSpace
)
}
}
}
}
...
@@ -390,7 +349,7 @@ class Surface : RefCnt {
...
@@ -390,7 +349,7 @@ class Surface : RefCnt {
fun
makeRasterN32Premul
(
width
:
Int
,
height
:
Int
):
Surface
{
fun
makeRasterN32Premul
(
width
:
Int
,
height
:
Int
):
Surface
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeRasterN32Premul
(
width
,
height
)
val
ptr
=
_nMakeRasterN32Premul
(
width
,
height
)
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeRasterN32Premul(%d, %d)"
,
width
,
height
)
}
require
(
ptr
!=
0L
)
{
"Failed Surface.makeRasterN32Premul($width, $height)"
}
return
Surface
(
ptr
)
return
Surface
(
ptr
)
}
}
...
@@ -526,39 +485,27 @@ class Surface : RefCnt {
...
@@ -526,39 +485,27 @@ class Surface : RefCnt {
shouldCreateWithMips
:
Boolean
shouldCreateWithMips
:
Boolean
):
Surface
{
):
Surface
{
return
try
{
return
try
{
assert
(
context
!=
null
)
{
"Can’t makeFromBackendRenderTarget with context == null"
}
assert
(
imageInfo
!=
null
)
{
"Can’t makeFromBackendRenderTarget with imageInfo == null"
}
assert
(
origin
!=
null
)
{
"Can’t makeFromBackendRenderTarget with origin == null"
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeRenderTarget
(
val
ptr
=
_nMakeRenderTarget
(
Native
.
getPtr
(
context
),
getPtr
(
context
),
budgeted
,
budgeted
,
imageInfo
.
width
,
imageInfo
.
width
,
imageInfo
.
height
,
imageInfo
.
height
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
Native
.
Companion
.
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
),
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
),
sampleCount
,
sampleCount
,
origin
.
ordinal
,
origin
.
ordinal
,
surfaceProps
,
surfaceProps
,
shouldCreateWithMips
shouldCreateWithMips
)
)
require
(
ptr
!=
0L
)
{
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeRenderTarget($context, $budgeted, $imageInfo, $sampleCount, $origin, $surfaceProps, $shouldCreateWithMips)"
"Failed Surface.makeRenderTarget(%s, %b, %s, %d, %s, %s, %b)"
,
context
,
budgeted
,
imageInfo
,
sampleCount
,
origin
,
surfaceProps
,
shouldCreateWithMips
)
}
}
Surface
(
ptr
,
context
)
Surface
(
ptr
,
context
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
context
)
reachabilityBarrier
(
context
)
Reference
.
reachabilityFence
(
imageInfo
.
colorInfo
.
colorSpace
)
reachabilityBarrier
(
imageInfo
.
colorInfo
.
colorSpace
)
}
}
}
}
...
@@ -575,7 +522,7 @@ class Surface : RefCnt {
...
@@ -575,7 +522,7 @@ class Surface : RefCnt {
fun
makeNull
(
width
:
Int
,
height
:
Int
):
Surface
{
fun
makeNull
(
width
:
Int
,
height
:
Int
):
Surface
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
val
ptr
=
_nMakeNull
(
width
,
height
)
val
ptr
=
_nMakeNull
(
width
,
height
)
require
(
ptr
!=
0L
)
{
String
.
format
(
"Failed Surface.makeNull(%d, %d)"
,
width
,
height
)
}
require
(
ptr
!=
0L
)
{
"Failed Surface.makeNull($width, $height)"
}
return
Surface
(
ptr
)
return
Surface
(
ptr
)
}
}
...
@@ -686,7 +633,7 @@ class Surface : RefCnt {
...
@@ -686,7 +633,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetWidth
(
_ptr
)
_nGetWidth
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -701,7 +648,7 @@ class Surface : RefCnt {
...
@@ -701,7 +648,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetHeight
(
_ptr
)
_nGetHeight
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -715,7 +662,7 @@ class Surface : RefCnt {
...
@@ -715,7 +662,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetImageInfo
(
_ptr
)
_nGetImageInfo
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -733,7 +680,7 @@ class Surface : RefCnt {
...
@@ -733,7 +680,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGenerationId
(
_ptr
)
_nGenerationId
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -750,7 +697,7 @@ class Surface : RefCnt {
...
@@ -750,7 +697,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nNotifyContentWillChange
(
_ptr
,
mode
.
ordinal
)
_nNotifyContentWillChange
(
_ptr
,
mode
.
ordinal
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -766,7 +713,7 @@ class Surface : RefCnt {
...
@@ -766,7 +713,7 @@ class Surface : RefCnt {
val
ptr
=
_nGetRecordingContext
(
_ptr
)
val
ptr
=
_nGetRecordingContext
(
_ptr
)
if
(
ptr
==
0L
)
null
else
DirectContext
(
ptr
)
if
(
ptr
==
0L
)
null
else
DirectContext
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -785,7 +732,7 @@ class Surface : RefCnt {
...
@@ -785,7 +732,7 @@ class Surface : RefCnt {
val
ptr
=
_nGetCanvas
(
_ptr
)
val
ptr
=
_nGetCanvas
(
_ptr
)
if
(
ptr
==
0L
)
throw
IllegalArgumentException
()
else
Canvas
(
ptr
,
false
,
this
)
if
(
ptr
==
0L
)
throw
IllegalArgumentException
()
else
Canvas
(
ptr
,
false
,
this
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
/**
/**
...
@@ -812,11 +759,11 @@ class Surface : RefCnt {
...
@@ -812,11 +759,11 @@ class Surface : RefCnt {
imageInfo
.
height
,
imageInfo
.
height
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
colorType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
imageInfo
.
colorInfo
.
alphaType
.
ordinal
,
Native
.
Companion
.
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
)
getPtr
(
imageInfo
.
colorInfo
.
colorSpace
)
)
)
Surface
(
ptr
)
Surface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -842,7 +789,7 @@ class Surface : RefCnt {
...
@@ -842,7 +789,7 @@ class Surface : RefCnt {
val
ptr
=
_nMakeSurface
(
_ptr
,
width
,
height
)
val
ptr
=
_nMakeSurface
(
_ptr
,
width
,
height
)
Surface
(
ptr
)
Surface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -862,7 +809,7 @@ class Surface : RefCnt {
...
@@ -862,7 +809,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Image
(
_nMakeImageSnapshot
(
_ptr
))
Image
(
_nMakeImageSnapshot
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -896,7 +843,7 @@ class Surface : RefCnt {
...
@@ -896,7 +843,7 @@ class Surface : RefCnt {
)
)
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -916,11 +863,11 @@ class Surface : RefCnt {
...
@@ -916,11 +863,11 @@ class Surface : RefCnt {
fun
draw
(
canvas
:
Canvas
?,
x
:
Int
,
y
:
Int
,
paint
:
Paint
?)
{
fun
draw
(
canvas
:
Canvas
?,
x
:
Int
,
y
:
Int
,
paint
:
Paint
?)
{
try
{
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nDraw
(
_ptr
,
Native
.
Companion
.
getPtr
(
canvas
),
x
.
toFloat
(),
y
.
toFloat
(),
Native
.
Companion
.
getPtr
(
paint
))
_nDraw
(
_ptr
,
getPtr
(
canvas
),
x
.
toFloat
(),
y
.
toFloat
(),
getPtr
(
paint
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
canvas
)
reachabilityBarrier
(
canvas
)
Reference
.
reachabilityFence
(
paint
)
reachabilityBarrier
(
paint
)
}
}
}
}
...
@@ -929,11 +876,11 @@ class Surface : RefCnt {
...
@@ -929,11 +876,11 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nPeekPixels
(
_nPeekPixels
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
pixmap
)
getPtr
(
pixmap
)
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
pixmap
)
reachabilityBarrier
(
pixmap
)
}
}
}
}
...
@@ -942,13 +889,13 @@ class Surface : RefCnt {
...
@@ -942,13 +889,13 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nReadPixelsToPixmap
(
_nReadPixelsToPixmap
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
pixmap
),
getPtr
(
pixmap
),
srcX
,
srcX
,
srcY
srcY
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
pixmap
)
reachabilityBarrier
(
pixmap
)
}
}
}
}
...
@@ -997,23 +944,23 @@ class Surface : RefCnt {
...
@@ -997,23 +944,23 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nReadPixels
(
_nReadPixels
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
bitmap
),
getPtr
(
bitmap
),
srcX
,
srcX
,
srcY
srcY
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
bitmap
)
reachabilityBarrier
(
bitmap
)
}
}
}
}
fun
writePixels
(
pixmap
:
Pixmap
?,
x
:
Int
,
y
:
Int
)
{
fun
writePixels
(
pixmap
:
Pixmap
?,
x
:
Int
,
y
:
Int
)
{
try
{
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nWritePixelsFromPixmap
(
_ptr
,
Native
.
Companion
.
getPtr
(
pixmap
),
x
,
y
)
_nWritePixelsFromPixmap
(
_ptr
,
getPtr
(
pixmap
),
x
,
y
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
pixmap
)
reachabilityBarrier
(
pixmap
)
}
}
}
}
...
@@ -1037,10 +984,10 @@ class Surface : RefCnt {
...
@@ -1037,10 +984,10 @@ class Surface : RefCnt {
fun
writePixels
(
bitmap
:
Bitmap
?,
x
:
Int
,
y
:
Int
)
{
fun
writePixels
(
bitmap
:
Bitmap
?,
x
:
Int
,
y
:
Int
)
{
try
{
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nWritePixels
(
_ptr
,
Native
.
Companion
.
getPtr
(
bitmap
),
x
,
y
)
_nWritePixels
(
_ptr
,
getPtr
(
bitmap
),
x
,
y
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
bitmap
)
reachabilityBarrier
(
bitmap
)
}
}
}
}
...
@@ -1060,7 +1007,7 @@ class Surface : RefCnt {
...
@@ -1060,7 +1007,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nFlushAndSubmit
(
_ptr
,
false
)
_nFlushAndSubmit
(
_ptr
,
false
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -1082,7 +1029,7 @@ class Surface : RefCnt {
...
@@ -1082,7 +1029,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nFlushAndSubmit
(
_ptr
,
syncCpu
)
_nFlushAndSubmit
(
_ptr
,
syncCpu
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -1091,7 +1038,7 @@ class Surface : RefCnt {
...
@@ -1091,7 +1038,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nFlush
(
_ptr
)
_nFlush
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -1107,7 +1054,7 @@ class Surface : RefCnt {
...
@@ -1107,7 +1054,7 @@ class Surface : RefCnt {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nUnique
(
_ptr
)
_nUnique
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
internal
constructor
(
ptr
:
Long
)
:
super
(
ptr
)
{
internal
constructor
(
ptr
:
Long
)
:
super
(
ptr
)
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/TextBlobBuilder.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/TextBlobBuilder.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
TextBlobBuilder
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
class
TextBlobBuilder
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -58,7 +59,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -58,7 +59,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
val
ptr
=
_nBuild
(
_ptr
)
val
ptr
=
_nBuild
(
_ptr
)
if
(
ptr
==
0L
)
null
else
TextBlob
(
ptr
)
if
(
ptr
==
0L
)
null
else
TextBlob
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -119,7 +120,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -119,7 +120,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nAppendRun
(
_nAppendRun
(
_ptr
,
_ptr
,
Native
.
getPtr
(
font
),
getPtr
(
font
),
glyphs
,
glyphs
,
x
,
x
,
y
,
y
,
...
@@ -127,7 +128,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -127,7 +128,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
font
)
reachabilityBarrier
(
font
)
}
}
}
}
/**
/**
...
@@ -156,7 +157,6 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -156,7 +157,6 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
* @param y vertical offset within the blob
* @param y vertical offset within the blob
* @return this
* @return this
*/
*/
@JvmOverloads
fun
appendRunPosH
(
fun
appendRunPosH
(
font
:
Font
?,
font
:
Font
?,
glyphs
:
ShortArray
,
glyphs
:
ShortArray
,
...
@@ -165,11 +165,11 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -165,11 +165,11 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
bounds
:
Rect
?
=
null
bounds
:
Rect
?
=
null
):
TextBlobBuilder
{
):
TextBlobBuilder
{
return
try
{
return
try
{
assert
(
glyphs
.
size
==
xs
.
size
)
{
"glyphs.length "
+
glyphs
.
size
+
" != xs.length "
+
xs
.
size
}
require
(
glyphs
.
size
==
xs
.
size
)
{
"glyphs.length "
+
glyphs
.
size
+
" != xs.length "
+
xs
.
size
}
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nAppendRunPosH
(
_nAppendRunPosH
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
font
),
getPtr
(
font
),
glyphs
,
glyphs
,
xs
,
xs
,
y
,
y
,
...
@@ -177,7 +177,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -177,7 +177,7 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
font
)
reachabilityBarrier
(
font
)
}
}
}
}
/**
/**
...
@@ -204,10 +204,9 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -204,10 +204,9 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
* @param pos positions of glyphs within the blob
* @param pos positions of glyphs within the blob
* @return this
* @return this
*/
*/
@JvmOverloads
fun
appendRunPos
(
font
:
Font
?,
glyphs
:
ShortArray
,
pos
:
Array
<
Point
>,
bounds
:
Rect
?
=
null
):
TextBlobBuilder
{
fun
appendRunPos
(
font
:
Font
?,
glyphs
:
ShortArray
,
pos
:
Array
<
Point
>,
bounds
:
Rect
?
=
null
):
TextBlobBuilder
{
return
try
{
return
try
{
assert
(
glyphs
.
size
==
pos
.
size
)
{
"glyphs.length "
+
glyphs
.
size
+
" != pos.length "
+
pos
.
size
}
require
(
glyphs
.
size
==
pos
.
size
)
{
"glyphs.length "
+
glyphs
.
size
+
" != pos.length "
+
pos
.
size
}
val
floatPos
=
FloatArray
(
pos
.
size
*
2
)
val
floatPos
=
FloatArray
(
pos
.
size
*
2
)
for
(
i
in
pos
.
indices
)
{
for
(
i
in
pos
.
indices
)
{
floatPos
[
i
*
2
]
=
pos
[
i
].
x
floatPos
[
i
*
2
]
=
pos
[
i
].
x
...
@@ -216,20 +215,20 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -216,20 +215,20 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nAppendRunPos
(
_nAppendRunPos
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
font
),
getPtr
(
font
),
glyphs
,
glyphs
,
floatPos
,
floatPos
,
bounds
bounds
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
font
)
reachabilityBarrier
(
font
)
}
}
}
}
fun
appendRunRSXform
(
font
:
Font
?,
glyphs
:
ShortArray
,
xform
:
Array
<
RSXform
>):
TextBlobBuilder
{
fun
appendRunRSXform
(
font
:
Font
?,
glyphs
:
ShortArray
,
xform
:
Array
<
RSXform
>):
TextBlobBuilder
{
return
try
{
return
try
{
assert
(
glyphs
.
size
==
xform
.
size
)
{
"glyphs.length "
+
glyphs
.
size
+
" != xform.length "
+
xform
.
size
}
require
(
glyphs
.
size
==
xform
.
size
)
{
"glyphs.length "
+
glyphs
.
size
+
" != xform.length "
+
xform
.
size
}
val
floatXform
=
FloatArray
(
xform
.
size
*
4
)
val
floatXform
=
FloatArray
(
xform
.
size
*
4
)
for
(
i
in
xform
.
indices
)
{
for
(
i
in
xform
.
indices
)
{
floatXform
[
i
*
4
]
=
xform
[
i
].
scos
floatXform
[
i
*
4
]
=
xform
[
i
].
scos
...
@@ -240,13 +239,13 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
...
@@ -240,13 +239,13 @@ class TextBlobBuilder internal constructor(ptr: Long) : Managed(ptr, _FinalizerH
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nAppendRunRSXform
(
_nAppendRunRSXform
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
font
),
getPtr
(
font
),
glyphs
,
glyphs
,
floatXform
floatXform
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
font
)
reachabilityBarrier
(
font
)
}
}
}
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/impl/Managed.kt
View file @
5c256dcf
package
org.jetbrains.skia.impl
package
org.jetbrains.skia.impl
expect
abstract
class
Managed
(
ptr
:
Long
,
finalizer
:
Long
,
managed
:
Boolean
=
true
)
:
Native
{
expect
abstract
class
Managed
(
ptr
:
Long
,
finalizer
:
Long
,
managed
:
Boolean
=
true
)
:
Native
{
open
fun
close
():
Unit
open
fun
close
()
open
val
isClosed
:
Boolean
}
}
inline
fun
<
T
:
Managed
,
R
>
T
.
use
(
block
:
(
T
)
->
R
):
R
{
inline
fun
<
T
:
Managed
,
R
>
T
.
use
(
block
:
(
T
)
->
R
):
R
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/DecorationStyle.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/DecorationStyle.kt
View file @
5c256dcf
...
@@ -60,7 +60,7 @@ class DecorationStyle(
...
@@ -60,7 +60,7 @@ class DecorationStyle(
if
(
_lineThrough
!=
other
.
_lineThrough
)
return
false
if
(
_lineThrough
!=
other
.
_lineThrough
)
return
false
if
(
_gaps
!=
other
.
_gaps
)
return
false
if
(
_gaps
!=
other
.
_gaps
)
return
false
if
(
color
!=
other
.
color
)
return
false
if
(
color
!=
other
.
color
)
return
false
if
(
java
.
lang
.
Float
.
compare
(
thicknessMultiplier
,
other
.
thicknessMultiplier
)
!=
0
)
return
false
if
(
thicknessMultiplier
.
compareTo
(
other
.
thicknessMultiplier
)
!=
0
)
return
false
val
`
this
$
_lineStyle
`
:
Any
=
lineStyle
val
`
this
$
_lineStyle
`
:
Any
=
lineStyle
val
`
other
$
_lineStyle
`
:
Any
=
other
.
lineStyle
val
`
other
$
_lineStyle
`
:
Any
=
other
.
lineStyle
return
`
this
$
_lineStyle
`
==
`
other
$
_lineStyle
`
return
`
this
$
_lineStyle
`
==
`
other
$
_lineStyle
`
...
@@ -78,7 +78,7 @@ class DecorationStyle(
...
@@ -78,7 +78,7 @@ class DecorationStyle(
result
=
result
*
PRIME
+
if
(
_lineThrough
)
79
else
97
result
=
result
*
PRIME
+
if
(
_lineThrough
)
79
else
97
result
=
result
*
PRIME
+
if
(
_gaps
)
79
else
97
result
=
result
*
PRIME
+
if
(
_gaps
)
79
else
97
result
=
result
*
PRIME
+
color
result
=
result
*
PRIME
+
color
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
thicknessMultiplier
)
result
=
result
*
PRIME
+
thicknessMultiplier
.
toBits
(
)
val
`$
_lineStyle
`
:
Any
=
lineStyle
val
`$
_lineStyle
`
:
Any
=
lineStyle
result
=
result
*
PRIME
+
(
`$
_lineStyle
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
(
`$
_lineStyle
`
?.
hashCode
()
?:
43
)
return
result
return
result
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/FontCollection.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/FontCollection.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.RefCnt
import
org.jetbrains.skia.impl.RefCnt
import
org.jetbrains.skia.*
import
org.jetbrains.skia.*
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
FontCollection
internal
constructor
(
ptr
:
Long
)
:
RefCnt
(
ptr
)
{
class
FontCollection
internal
constructor
(
ptr
:
Long
)
:
RefCnt
(
ptr
)
{
companion
object
{
companion
object
{
...
@@ -36,16 +37,16 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -36,16 +37,16 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontManagersCount
(
_ptr
)
_nGetFontManagersCount
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setAssetFontManager
(
fontMgr
:
FontMgr
?):
FontCollection
{
fun
setAssetFontManager
(
fontMgr
:
FontMgr
?):
FontCollection
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetAssetFontManager
(
_ptr
,
Native
.
Companion
.
getPtr
(
fontMgr
))
_nSetAssetFontManager
(
_ptr
,
getPtr
(
fontMgr
))
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
fontMgr
)
reachabilityBarrier
(
fontMgr
)
}
}
}
}
...
@@ -54,21 +55,21 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -54,21 +55,21 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetDynamicFontManager
(
_nSetDynamicFontManager
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
fontMgr
)
getPtr
(
fontMgr
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
fontMgr
)
reachabilityBarrier
(
fontMgr
)
}
}
}
}
fun
setTestFontManager
(
fontMgr
:
FontMgr
?):
FontCollection
{
fun
setTestFontManager
(
fontMgr
:
FontMgr
?):
FontCollection
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetTestFontManager
(
_ptr
,
Native
.
Companion
.
getPtr
(
fontMgr
))
_nSetTestFontManager
(
_ptr
,
getPtr
(
fontMgr
))
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
fontMgr
)
reachabilityBarrier
(
fontMgr
)
}
}
}
}
...
@@ -81,12 +82,12 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -81,12 +82,12 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetDefaultFontManager
(
_nSetDefaultFontManager
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
fontMgr
),
getPtr
(
fontMgr
),
defaultFamilyName
defaultFamilyName
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
fontMgr
)
reachabilityBarrier
(
fontMgr
)
}
}
}
}
...
@@ -96,7 +97,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -96,7 +97,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
val
ptr
=
_nGetFallbackManager
(
_ptr
)
val
ptr
=
_nGetFallbackManager
(
_ptr
)
if
(
ptr
==
0L
)
null
else
FontMgr
(
ptr
)
if
(
ptr
==
0L
)
null
else
FontMgr
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
findTypefaces
(
familyNames
:
Array
<
String
?
>?,
style
:
FontStyle
):
Array
<
Typeface
?
>
{
fun
findTypefaces
(
familyNames
:
Array
<
String
?
>?,
style
:
FontStyle
):
Array
<
Typeface
?
>
{
...
@@ -107,7 +108,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -107,7 +108,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
for
(
i
in
ptrs
.
indices
)
res
[
i
]
=
Typeface
(
ptrs
[
i
])
for
(
i
in
ptrs
.
indices
)
res
[
i
]
=
Typeface
(
ptrs
[
i
])
res
res
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -117,7 +118,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -117,7 +118,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
val
ptr
=
_nDefaultFallbackChar
(
_ptr
,
unicode
,
style
.
_value
,
locale
)
val
ptr
=
_nDefaultFallbackChar
(
_ptr
,
unicode
,
style
.
_value
,
locale
)
if
(
ptr
==
0L
)
null
else
Typeface
(
ptr
)
if
(
ptr
==
0L
)
null
else
Typeface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -127,7 +128,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -127,7 +128,7 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
val
ptr
=
_nDefaultFallback
(
_ptr
)
val
ptr
=
_nDefaultFallback
(
_ptr
)
if
(
ptr
==
0L
)
null
else
Typeface
(
ptr
)
if
(
ptr
==
0L
)
null
else
Typeface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -142,6 +143,6 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
...
@@ -142,6 +143,6 @@ class FontCollection internal constructor(ptr: Long) : RefCnt(ptr) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
ParagraphCache
(
this
,
_nGetParagraphCache
(
_ptr
))
ParagraphCache
(
this
,
_nGetParagraphCache
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
\ No newline at end of file
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/LineMetrics.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/LineMetrics.kt
View file @
5c256dcf
...
@@ -103,14 +103,14 @@ class LineMetrics(
...
@@ -103,14 +103,14 @@ class LineMetrics(
if
(
endExcludingWhitespaces
!=
other
.
endExcludingWhitespaces
)
return
false
if
(
endExcludingWhitespaces
!=
other
.
endExcludingWhitespaces
)
return
false
if
(
endIncludingNewline
!=
other
.
endIncludingNewline
)
return
false
if
(
endIncludingNewline
!=
other
.
endIncludingNewline
)
return
false
if
(
isHardBreak
!=
other
.
isHardBreak
)
return
false
if
(
isHardBreak
!=
other
.
isHardBreak
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
ascent
,
other
.
ascent
)
!=
0
)
return
false
if
(
ascent
.
compareTo
(
other
.
ascent
)
!=
0
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
descent
,
other
.
descent
)
!=
0
)
return
false
if
(
descent
.
compareTo
(
other
.
descent
)
!=
0
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
unscaledAscent
,
other
.
unscaledAscent
)
!=
0
)
return
false
if
(
unscaledAscent
.
compareTo
(
other
.
unscaledAscent
)
!=
0
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
height
,
other
.
height
)
!=
0
)
return
false
if
(
height
.
compareTo
(
other
.
height
)
!=
0
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
width
,
other
.
width
)
!=
0
)
return
false
if
(
width
.
compareTo
(
other
.
width
)
!=
0
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
left
,
other
.
left
)
!=
0
)
return
false
if
(
left
.
compareTo
(
other
.
left
)
!=
0
)
return
false
if
(
java
.
lang
.
Double
.
compare
(
baseline
,
other
.
baseline
)
!=
0
)
return
false
if
(
baseline
.
compareTo
(
other
.
baseline
)
!=
0
)
return
false
return
if
(
lineNumber
!=
other
.
lineNumber
)
false
else
true
return
lineNumber
==
other
.
lineNumber
}
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
@@ -129,19 +129,19 @@ class LineMetrics(
...
@@ -129,19 +129,19 @@ class LineMetrics(
val
`$
_endIncludingNewline
`
=
endIncludingNewline
val
`$
_endIncludingNewline
`
=
endIncludingNewline
result
=
result
*
PRIME
+
(
`$
_endIncludingNewline
`
ushr
32
xor
`$
_endIncludingNewline
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_endIncludingNewline
`
ushr
32
xor
`$
_endIncludingNewline
`
).
toInt
()
result
=
result
*
PRIME
+
if
(
isHardBreak
)
79
else
97
result
=
result
*
PRIME
+
if
(
isHardBreak
)
79
else
97
val
`$
_ascent
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
ascent
)
val
`$
_ascent
`
=
ascent
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_ascent
`
ushr
32
xor
`$
_ascent
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_ascent
`
ushr
32
xor
`$
_ascent
`
).
toInt
()
val
`$
_descent
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
descent
)
val
`$
_descent
`
=
descent
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_descent
`
ushr
32
xor
`$
_descent
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_descent
`
ushr
32
xor
`$
_descent
`
).
toInt
()
val
`$
_unscaledAscent
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
unscaledAscent
)
val
`$
_unscaledAscent
`
=
unscaledAscent
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_unscaledAscent
`
ushr
32
xor
`$
_unscaledAscent
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_unscaledAscent
`
ushr
32
xor
`$
_unscaledAscent
`
).
toInt
()
val
`$
_height
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
height
)
val
`$
_height
`
=
height
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_height
`
ushr
32
xor
`$
_height
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_height
`
ushr
32
xor
`$
_height
`
).
toInt
()
val
`$
_width
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
width
)
val
`$
_width
`
=
width
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_width
`
ushr
32
xor
`$
_width
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_width
`
ushr
32
xor
`$
_width
`
).
toInt
()
val
`$
_left
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
left
)
val
`$
_left
`
=
left
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_left
`
ushr
32
xor
`$
_left
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_left
`
ushr
32
xor
`$
_left
`
).
toInt
()
val
`$
_baseline
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
baseline
)
val
`$
_baseline
`
=
baseline
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_baseline
`
ushr
32
xor
`$
_baseline
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_baseline
`
ushr
32
xor
`$
_baseline
`
).
toInt
()
val
`$
_lineNumber
`
=
lineNumber
val
`$
_lineNumber
`
=
lineNumber
result
=
result
*
PRIME
+
(
`$
_lineNumber
`
ushr
32
xor
`$
_lineNumber
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_lineNumber
`
ushr
32
xor
`$
_lineNumber
`
).
toInt
()
...
@@ -149,6 +149,6 @@ class LineMetrics(
...
@@ -149,6 +149,6 @@ class LineMetrics(
}
}
override
fun
toString
():
String
{
override
fun
toString
():
String
{
return
"LineMetrics(_startIndex=
"
+
startIndex
+
", _endIndex="
+
endIndex
+
", _endExcludingWhitespaces="
+
endExcludingWhitespaces
+
", _endIncludingNewline="
+
endIncludingNewline
+
", _hardBreak="
+
isHardBreak
+
", _ascent="
+
ascent
+
", _descent="
+
descent
+
", _unscaledAscent="
+
unscaledAscent
+
", _height="
+
height
+
", _width="
+
width
+
", _left="
+
left
+
", _baseline="
+
baseline
+
", _lineNumber="
+
lineNumber
+
"
)"
return
"LineMetrics(_startIndex=
$startIndex, _endIndex=$endIndex, _endExcludingWhitespaces=$endExcludingWhitespaces, _endIncludingNewline=$endIncludingNewline, _hardBreak=$isHardBreak, _ascent=$ascent, _descent=$descent, _unscaledAscent=$unscaledAscent, _height=$height, _width=$width, _left=$left, _baseline=$baseline, _lineNumber=$lineNumber
)"
}
}
}
}
\ No newline at end of file
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/Paragraph.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/Paragraph.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.*
import
org.jetbrains.skia.*
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
Paragraph
internal
constructor
(
ptr
:
Long
,
text
:
ManagedString
?)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
class
Paragraph
internal
constructor
(
ptr
:
Long
,
text
:
ManagedString
?)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -60,49 +61,49 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -60,49 +61,49 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetMaxWidth
(
_ptr
)
_nGetMaxWidth
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
height
:
Float
val
height
:
Float
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetHeight
(
_ptr
)
_nGetHeight
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
minIntrinsicWidth
:
Float
val
minIntrinsicWidth
:
Float
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetMinIntrinsicWidth
(
_ptr
)
_nGetMinIntrinsicWidth
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
maxIntrinsicWidth
:
Float
val
maxIntrinsicWidth
:
Float
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetMaxIntrinsicWidth
(
_ptr
)
_nGetMaxIntrinsicWidth
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
alphabeticBaseline
:
Float
val
alphabeticBaseline
:
Float
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetAlphabeticBaseline
(
_ptr
)
_nGetAlphabeticBaseline
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
ideographicBaseline
:
Float
val
ideographicBaseline
:
Float
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetIdeographicBaseline
(
_ptr
)
_nGetIdeographicBaseline
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
longestLine
:
Float
val
longestLine
:
Float
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLongestLine
(
_ptr
)
_nGetLongestLine
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
didExceedMaxLines
():
Boolean
{
fun
didExceedMaxLines
():
Boolean
{
...
@@ -110,7 +111,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -110,7 +111,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nDidExceedMaxLines
(
_ptr
)
_nDidExceedMaxLines
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -123,10 +124,10 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -123,10 +124,10 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
fun
paint
(
canvas
:
Canvas
?,
x
:
Float
,
y
:
Float
):
Paragraph
{
fun
paint
(
canvas
:
Canvas
?,
x
:
Float
,
y
:
Float
):
Paragraph
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nPaint
(
_ptr
,
Native
.
Companion
.
getPtr
(
canvas
),
x
,
y
)
_nPaint
(
_ptr
,
getPtr
(
canvas
),
x
,
y
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
canvas
)
reachabilityBarrier
(
canvas
)
}
}
}
}
...
@@ -144,7 +145,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -144,7 +145,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetRectsForRange
(
_ptr
,
start
,
end
,
rectHeightMode
.
ordinal
,
rectWidthMode
.
ordinal
)
_nGetRectsForRange
(
_ptr
,
start
,
end
,
rectHeightMode
.
ordinal
,
rectWidthMode
.
ordinal
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -153,7 +154,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -153,7 +154,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetRectsForPlaceholders
(
_ptr
)
_nGetRectsForPlaceholders
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
getGlyphPositionAtCoordinate
(
dx
:
Float
,
dy
:
Float
):
PositionWithAffinity
{
fun
getGlyphPositionAtCoordinate
(
dx
:
Float
,
dy
:
Float
):
PositionWithAffinity
{
...
@@ -165,7 +166,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -165,7 +166,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Affinity
.
UPSTREAM
Affinity
.
UPSTREAM
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -174,7 +175,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -174,7 +175,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
IRange
.
Companion
.
_makeFromLong
(
_nGetWordBoundary
(
_ptr
,
offset
))
IRange
.
Companion
.
_makeFromLong
(
_nGetWordBoundary
(
_ptr
,
offset
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -184,18 +185,18 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -184,18 +185,18 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
arrayOfNulls
(
0
)
arrayOfNulls
(
0
)
}
else
{
}
else
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLineMetrics
(
_ptr
,
Native
.
Companion
.
getPtr
(
_text
))
_nGetLineMetrics
(
_ptr
,
getPtr
(
_text
))
}
}
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
_text
)
reachabilityBarrier
(
_text
)
}
}
val
lineNumber
:
Long
val
lineNumber
:
Long
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLineNumber
(
_ptr
)
_nGetLineNumber
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
markDirty
():
Paragraph
{
fun
markDirty
():
Paragraph
{
...
@@ -209,7 +210,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -209,7 +210,7 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetUnresolvedGlyphsCount
(
_ptr
)
_nGetUnresolvedGlyphsCount
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
updateAlignment
(
alignment
:
Alignment
):
Paragraph
{
fun
updateAlignment
(
alignment
:
Alignment
):
Paragraph
{
...
@@ -233,12 +234,12 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -233,12 +234,12 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
from
,
from
,
to
,
to
,
size
,
size
,
Native
.
Companion
.
getPtr
(
_text
)
getPtr
(
_text
)
)
)
}
}
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
_text
)
reachabilityBarrier
(
_text
)
}
}
}
}
...
@@ -250,14 +251,14 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -250,14 +251,14 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
_ptr
,
_ptr
,
from
,
from
,
to
,
to
,
Native
.
Companion
.
getPtr
(
paint
),
getPtr
(
paint
),
Native
.
Companion
.
getPtr
(
_text
)
getPtr
(
_text
)
)
)
}
}
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
paint
)
reachabilityBarrier
(
paint
)
Reference
.
reachabilityFence
(
_text
)
reachabilityBarrier
(
_text
)
}
}
}
}
...
@@ -269,14 +270,14 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
...
@@ -269,14 +270,14 @@ class Paragraph internal constructor(ptr: Long, text: ManagedString?) : Managed(
_ptr
,
_ptr
,
from
,
from
,
to
,
to
,
Native
.
Companion
.
getPtr
(
paint
),
getPtr
(
paint
),
Native
.
Companion
.
getPtr
(
_text
)
getPtr
(
_text
)
)
)
}
}
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
paint
)
reachabilityBarrier
(
paint
)
Reference
.
reachabilityFence
(
_text
)
reachabilityBarrier
(
_text
)
}
}
}
}
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/ParagraphBuilder.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/ParagraphBuilder.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.ManagedString
import
org.jetbrains.skia.ManagedString
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
ParagraphBuilder
(
style
:
ParagraphStyle
?,
fc
:
FontCollection
?)
:
class
ParagraphBuilder
(
style
:
ParagraphStyle
?,
fc
:
FontCollection
?)
:
Managed
(
_nMake
(
Native
.
getPtr
(
style
),
Native
.
getPtr
(
fc
)),
_FinalizerHolder
.
PTR
)
{
Managed
(
_nMake
(
getPtr
(
style
),
getPtr
(
fc
)),
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
@JvmStatic
external
fun
_nMake
(
paragraphStylePtr
:
Long
,
fontCollectionPtr
:
Long
):
Long
@JvmStatic
external
fun
_nMake
(
paragraphStylePtr
:
Long
,
fontCollectionPtr
:
Long
):
Long
@JvmStatic
external
fun
_nGetFinalizer
():
Long
@JvmStatic
external
fun
_nGetFinalizer
():
Long
...
@@ -36,10 +37,10 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
...
@@ -36,10 +37,10 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
fun
pushStyle
(
style
:
TextStyle
?):
ParagraphBuilder
{
fun
pushStyle
(
style
:
TextStyle
?):
ParagraphBuilder
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nPushStyle
(
_ptr
,
Native
.
Companion
.
getPtr
(
style
))
_nPushStyle
(
_ptr
,
getPtr
(
style
))
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
style
)
reachabilityBarrier
(
style
)
}
}
}
}
...
@@ -72,10 +73,10 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
...
@@ -72,10 +73,10 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
fun
setParagraphStyle
(
style
:
ParagraphStyle
?):
ParagraphBuilder
{
fun
setParagraphStyle
(
style
:
ParagraphStyle
?):
ParagraphBuilder
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetParagraphStyle
(
_ptr
,
Native
.
getPtr
(
style
))
_nSetParagraphStyle
(
_ptr
,
getPtr
(
style
))
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
style
)
reachabilityBarrier
(
style
)
}
}
}
}
...
@@ -86,7 +87,7 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
...
@@ -86,7 +87,7 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
_text
=
null
_text
=
null
paragraph
paragraph
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -96,7 +97,7 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
...
@@ -96,7 +97,7 @@ class ParagraphBuilder(style: ParagraphStyle?, fc: FontCollection?) :
init
{
init
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Reference
.
reachabilityFence
(
style
)
reachabilityBarrier
(
style
)
Reference
.
reachabilityFence
(
fc
)
reachabilityBarrier
(
fc
)
}
}
}
}
\ No newline at end of file
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/ParagraphCache.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/ParagraphCache.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
ParagraphCache
internal
constructor
(
owner
:
FontCollection
,
ptr
:
Long
)
:
Native
(
ptr
)
{
class
ParagraphCache
internal
constructor
(
owner
:
FontCollection
,
ptr
:
Long
)
:
Native
(
ptr
)
{
companion
object
{
companion
object
{
...
@@ -26,7 +28,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -26,7 +28,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nAbandon
(
_ptr
)
_nAbandon
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -36,7 +38,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -36,7 +38,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nReset
(
_ptr
)
_nReset
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -44,10 +46,10 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -44,10 +46,10 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
return
try
{
return
try
{
_validate
()
_validate
()
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nUpdateParagraph
(
_ptr
,
Native
.
getPtr
(
paragraph
))
_nUpdateParagraph
(
_ptr
,
getPtr
(
paragraph
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
paragraph
)
reachabilityBarrier
(
paragraph
)
}
}
}
}
...
@@ -55,10 +57,10 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -55,10 +57,10 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
return
try
{
return
try
{
_validate
()
_validate
()
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nFindParagraph
(
_ptr
,
Native
.
Companion
.
getPtr
(
paragraph
))
_nFindParagraph
(
_ptr
,
getPtr
(
paragraph
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
paragraph
)
reachabilityBarrier
(
paragraph
)
}
}
}
}
...
@@ -68,7 +70,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -68,7 +70,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nPrintStatistics
(
_ptr
)
_nPrintStatistics
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -78,7 +80,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -78,7 +80,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetEnabled
(
_ptr
,
value
)
_nSetEnabled
(
_ptr
,
value
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -88,7 +90,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -88,7 +90,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetCount
(
_ptr
)
_nGetCount
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
internal
val
_owner
:
FontCollection
internal
val
_owner
:
FontCollection
...
@@ -96,7 +98,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
...
@@ -96,7 +98,7 @@ class ParagraphCache internal constructor(owner: FontCollection, ptr: Long) : Na
try
{
try
{
check
(
Native
.
getPtr
(
_owner
)
!=
0L
)
{
"ParagraphCache needs owning FontCollection to be alive"
}
check
(
Native
.
getPtr
(
_owner
)
!=
0L
)
{
"ParagraphCache needs owning FontCollection to be alive"
}
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
_owner
)
reachabilityBarrier
(
_owner
)
}
}
}
}
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/ParagraphStyle.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/ParagraphStyle.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
ParagraphStyle
:
Managed
(
_nMake
(),
_FinalizerHolder
.
PTR
)
{
class
ParagraphStyle
:
Managed
(
_nMake
(),
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -39,10 +41,10 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -39,10 +41,10 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
override
fun
_nativeEquals
(
other
:
Native
?):
Boolean
{
override
fun
_nativeEquals
(
other
:
Native
?):
Boolean
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nEquals
(
_ptr
,
Native
.
getPtr
(
other
))
_nEquals
(
_ptr
,
getPtr
(
other
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
other
)
reachabilityBarrier
(
other
)
}
}
}
}
...
@@ -51,16 +53,16 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -51,16 +53,16 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
StrutStyle
(
_nGetStrutStyle
(
_ptr
))
StrutStyle
(
_nGetStrutStyle
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setStrutStyle
(
s
:
StrutStyle
?):
ParagraphStyle
{
fun
setStrutStyle
(
s
:
StrutStyle
?):
ParagraphStyle
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetStrutStyle
(
_ptr
,
Native
.
getPtr
(
s
))
_nSetStrutStyle
(
_ptr
,
getPtr
(
s
))
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
s
)
reachabilityBarrier
(
s
)
}
}
}
}
...
@@ -69,16 +71,16 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -69,16 +71,16 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
TextStyle
(
_nGetTextStyle
(
_ptr
))
TextStyle
(
_nGetTextStyle
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setTextStyle
(
style
:
TextStyle
?):
ParagraphStyle
{
fun
setTextStyle
(
style
:
TextStyle
?):
ParagraphStyle
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetTextStyle
(
_ptr
,
Native
.
Companion
.
getPtr
(
style
))
_nSetTextStyle
(
_ptr
,
getPtr
(
style
))
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
style
)
reachabilityBarrier
(
style
)
}
}
}
}
...
@@ -87,7 +89,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -87,7 +89,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Direction
.
values
()[
_nGetDirection
(
_ptr
)]
Direction
.
values
()[
_nGetDirection
(
_ptr
)]
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setDirection
(
style
:
Direction
):
ParagraphStyle
{
fun
setDirection
(
style
:
Direction
):
ParagraphStyle
{
...
@@ -101,7 +103,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -101,7 +103,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Alignment
.
values
()[
_nGetAlignment
(
_ptr
)]
Alignment
.
values
()[
_nGetAlignment
(
_ptr
)]
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setAlignment
(
alignment
:
Alignment
):
ParagraphStyle
{
fun
setAlignment
(
alignment
:
Alignment
):
ParagraphStyle
{
...
@@ -115,7 +117,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -115,7 +117,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetMaxLinesCount
(
_ptr
)
_nGetMaxLinesCount
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setMaxLinesCount
(
count
:
Long
):
ParagraphStyle
{
fun
setMaxLinesCount
(
count
:
Long
):
ParagraphStyle
{
...
@@ -129,7 +131,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -129,7 +131,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetEllipsis
(
_ptr
)
_nGetEllipsis
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setEllipsis
(
ellipsis
:
String
?):
ParagraphStyle
{
fun
setEllipsis
(
ellipsis
:
String
?):
ParagraphStyle
{
...
@@ -143,7 +145,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -143,7 +145,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetHeight
(
_ptr
)
_nGetHeight
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setHeight
(
height
:
Float
):
ParagraphStyle
{
fun
setHeight
(
height
:
Float
):
ParagraphStyle
{
...
@@ -157,7 +159,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -157,7 +159,7 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
HeightMode
.
values
()[
_nGetHeightMode
(
_ptr
)]
HeightMode
.
values
()[
_nGetHeightMode
(
_ptr
)]
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setHeightMode
(
behavior
:
HeightMode
):
ParagraphStyle
{
fun
setHeightMode
(
behavior
:
HeightMode
):
ParagraphStyle
{
...
@@ -171,14 +173,14 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
...
@@ -171,14 +173,14 @@ class ParagraphStyle : Managed(_nMake(), _FinalizerHolder.PTR) {
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
Alignment
.
values
()[
_nGetEffectiveAlignment
(
_ptr
)]
Alignment
.
values
()[
_nGetEffectiveAlignment
(
_ptr
)]
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
isHintingEnabled
:
Boolean
val
isHintingEnabled
:
Boolean
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nIsHintingEnabled
(
_ptr
)
_nIsHintingEnabled
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
disableHinting
():
ParagraphStyle
{
fun
disableHinting
():
ParagraphStyle
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/PlaceholderStyle.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/PlaceholderStyle.kt
View file @
5c256dcf
...
@@ -44,15 +44,15 @@ class PlaceholderStyle(
...
@@ -44,15 +44,15 @@ class PlaceholderStyle(
if
(
o
!
is
PlaceholderStyle
)
return
false
if
(
o
!
is
PlaceholderStyle
)
return
false
val
other
=
o
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(
java
.
lang
.
Float
.
compare
(
width
,
other
.
width
)
!=
0
)
return
false
if
(
width
.
compareTo
(
other
.
width
)
!=
0
)
return
false
if
(
java
.
lang
.
Float
.
compare
(
height
,
other
.
height
)
!=
0
)
return
false
if
(
height
.
compareTo
(
other
.
height
)
!=
0
)
return
false
if
(
java
.
lang
.
Float
.
compare
(
baseline
,
other
.
baseline
)
!=
0
)
return
false
if
(
baseline
.
compareTo
(
other
.
baseline
)
!=
0
)
return
false
val
`
this
$
_alignment
`
:
Any
=
alignment
val
`
this
$
_alignment
`
:
Any
=
alignment
val
`
other
$
_alignment
`
:
Any
=
other
.
alignment
val
`
other
$
_alignment
`
:
Any
=
other
.
alignment
if
(
if
(
`
this
$
_alignment
`
==
null
)
`
other
$
_alignment
`
!=
null
else
`
this
$
_alignment
`
!=
`
other
$
_alignment
`
)
return
false
if
(
`
this
$
_alignment
`
!=
`
other
$
_alignment
`
)
return
false
val
`
this
$
_baselineMode
`
:
Any
=
baselineMode
val
`
this
$
_baselineMode
`
:
Any
=
baselineMode
val
`
other
$
_baselineMode
`
:
Any
=
other
.
baselineMode
val
`
other
$
_baselineMode
`
:
Any
=
other
.
baselineMode
return
if
(
if
(
`
this
$
_baselineMode
`
==
null
)
`
other
$
_baselineMode
`
!=
null
else
`
this
$
_baselineMode
`
!=
`
other
$
_baselineMode
`
)
false
else
true
return
`
this
$
_baselineMode
`
==
`
other
$
_baselineMode
`
}
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
@@ -62,18 +62,18 @@ class PlaceholderStyle(
...
@@ -62,18 +62,18 @@ class PlaceholderStyle(
override
fun
hashCode
():
Int
{
override
fun
hashCode
():
Int
{
val
PRIME
=
59
val
PRIME
=
59
var
result
=
1
var
result
=
1
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
width
)
result
=
result
*
PRIME
+
width
.
toBits
(
)
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
height
)
result
=
result
*
PRIME
+
height
.
toBits
(
)
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
baseline
)
result
=
result
*
PRIME
+
baseline
.
toBits
(
)
val
`$
_alignment
`
:
Any
=
alignment
val
`$
_alignment
`
:
Any
=
alignment
result
=
result
*
PRIME
+
(
`$
_alignment
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
(
`$
_alignment
`
.
hashCode
()
)
val
`$
_baselineMode
`
:
Any
=
baselineMode
val
`$
_baselineMode
`
:
Any
=
baselineMode
result
=
result
*
PRIME
+
(
`$
_baselineMode
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
(
`$
_baselineMode
`
.
hashCode
()
)
return
result
return
result
}
}
override
fun
toString
():
String
{
override
fun
toString
():
String
{
return
"PlaceholderStyle(_width=
"
+
width
+
", _height="
+
height
+
", _alignment="
+
alignment
+
", _baselineMode="
+
baselineMode
+
", _baseline="
+
baseline
+
"
)"
return
"PlaceholderStyle(_width=
$width, _height=$height, _alignment=$alignment, _baselineMode=$baselineMode, _baseline=$baseline
)"
}
}
init
{
init
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
View file @
5c256dcf
...
@@ -13,7 +13,7 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
...
@@ -13,7 +13,7 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
if
(
position
!=
other
.
position
)
return
false
if
(
position
!=
other
.
position
)
return
false
val
`
this
$
_affinity
`
:
Any
=
affinity
val
`
this
$
_affinity
`
:
Any
=
affinity
val
`
other
$
_affinity
`
:
Any
=
other
.
affinity
val
`
other
$
_affinity
`
:
Any
=
other
.
affinity
return
if
(
if
(
`
this
$
_affinity
`
==
null
)
`
other
$
_affinity
`
!=
null
else
`
this
$
_affinity
`
!=
`
other
$
_affinity
`
)
false
else
true
return
`
this
$
_affinity
`
==
`
other
$
_affinity
`
}
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
@@ -25,12 +25,12 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
...
@@ -25,12 +25,12 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
var
result
=
1
var
result
=
1
result
=
result
*
PRIME
+
position
result
=
result
*
PRIME
+
position
val
`$
_affinity
`
:
Any
=
affinity
val
`$
_affinity
`
:
Any
=
affinity
result
=
result
*
PRIME
+
(
`$
_affinity
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
(
`$
_affinity
`
?.
hashCode
())
return
result
return
result
}
}
override
fun
toString
():
String
{
override
fun
toString
():
String
{
return
"PositionWithAffinity(_position=
"
+
position
+
", _affinity="
+
affinity
+
"
)"
return
"PositionWithAffinity(_position=
$position, _affinity=$affinity
)"
}
}
init
{
init
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/Shadow.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/Shadow.kt
View file @
5c256dcf
...
@@ -15,9 +15,9 @@ class Shadow(val color: Int, val offsetX: Float, val offsetY: Float, val blurSig
...
@@ -15,9 +15,9 @@ class Shadow(val color: Int, val offsetX: Float, val offsetY: Float, val blurSig
val
other
=
o
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(
color
!=
other
.
color
)
return
false
if
(
color
!=
other
.
color
)
return
false
if
(
java
.
lang
.
Float
.
compare
(
offsetX
,
other
.
offsetX
)
!=
0
)
return
false
if
(
offsetX
.
compareTo
(
other
.
offsetX
)
!=
0
)
return
false
if
(
java
.
lang
.
Float
.
compare
(
offsetY
,
other
.
offsetY
)
!=
0
)
return
false
if
(
offsetY
.
compareTo
(
other
.
offsetY
)
!=
0
)
return
false
return
if
(
java
.
lang
.
Double
.
compare
(
blurSigma
,
other
.
blurSigma
)
!=
0
)
false
else
true
return
blurSigma
.
compareTo
(
other
.
blurSigma
)
==
0
}
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
@@ -28,15 +28,15 @@ class Shadow(val color: Int, val offsetX: Float, val offsetY: Float, val blurSig
...
@@ -28,15 +28,15 @@ class Shadow(val color: Int, val offsetX: Float, val offsetY: Float, val blurSig
val
PRIME
=
59
val
PRIME
=
59
var
result
=
1
var
result
=
1
result
=
result
*
PRIME
+
color
result
=
result
*
PRIME
+
color
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
offsetX
)
result
=
result
*
PRIME
+
offsetX
.
toBits
(
)
result
=
result
*
PRIME
+
java
.
lang
.
Float
.
floatToIntBits
(
offsetY
)
result
=
result
*
PRIME
+
offsetY
.
toBits
(
)
val
`$
_blurSigma
`
=
java
.
lang
.
Double
.
doubleToLongBits
(
blurSigma
)
val
`$
_blurSigma
`
=
blurSigma
.
toBits
(
)
result
=
result
*
PRIME
+
(
`$
_blurSigma
`
ushr
32
xor
`$
_blurSigma
`
).
toInt
()
result
=
result
*
PRIME
+
(
`$
_blurSigma
`
ushr
32
xor
`$
_blurSigma
`
).
toInt
()
return
result
return
result
}
}
override
fun
toString
():
String
{
override
fun
toString
():
String
{
return
"Shadow(_color=
"
+
color
+
", _offsetX="
+
offsetX
+
", _offsetY="
+
offsetY
+
", _blurSigma="
+
blurSigma
+
"
)"
return
"Shadow(_color=
$color, _offsetX=$offsetX, _offsetY=$offsetY, _blurSigma=$blurSigma
)"
}
}
fun
withColor
(
_color
:
Int
):
Shadow
{
fun
withColor
(
_color
:
Int
):
Shadow
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/StrutStyle.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/StrutStyle.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
@@ -5,7 +6,8 @@ import org.jetbrains.skia.*
...
@@ -5,7 +6,8 @@ import org.jetbrains.skia.*
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
StrutStyle
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
class
StrutStyle
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -41,10 +43,10 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -41,10 +43,10 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
override
fun
_nativeEquals
(
other
:
Native
?):
Boolean
{
override
fun
_nativeEquals
(
other
:
Native
?):
Boolean
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nEquals
(
_ptr
,
Native
.
getPtr
(
other
))
_nEquals
(
_ptr
,
getPtr
(
other
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
other
)
reachabilityBarrier
(
other
)
}
}
}
}
...
@@ -53,7 +55,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -53,7 +55,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontFamilies
(
_ptr
)
_nGetFontFamilies
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setFontFamilies
(
families
:
Array
<
String
?
>?):
StrutStyle
{
fun
setFontFamilies
(
families
:
Array
<
String
?
>?):
StrutStyle
{
...
@@ -67,7 +69,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -67,7 +69,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
FontStyle
(
_nGetFontStyle
(
_ptr
))
FontStyle
(
_nGetFontStyle
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setFontStyle
(
style
:
FontStyle
):
StrutStyle
{
fun
setFontStyle
(
style
:
FontStyle
):
StrutStyle
{
...
@@ -81,7 +83,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -81,7 +83,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontSize
(
_ptr
)
_nGetFontSize
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setFontSize
(
value
:
Float
):
StrutStyle
{
fun
setFontSize
(
value
:
Float
):
StrutStyle
{
...
@@ -95,7 +97,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -95,7 +97,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetHeight
(
_ptr
)
_nGetHeight
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setHeight
(
value
:
Float
):
StrutStyle
{
fun
setHeight
(
value
:
Float
):
StrutStyle
{
...
@@ -109,7 +111,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -109,7 +111,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLeading
(
_ptr
)
_nGetLeading
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setLeading
(
value
:
Float
):
StrutStyle
{
fun
setLeading
(
value
:
Float
):
StrutStyle
{
...
@@ -123,7 +125,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -123,7 +125,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nIsEnabled
(
_ptr
)
_nIsEnabled
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setEnabled
(
value
:
Boolean
):
StrutStyle
{
fun
setEnabled
(
value
:
Boolean
):
StrutStyle
{
...
@@ -137,7 +139,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -137,7 +139,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nIsHeightForced
(
_ptr
)
_nIsHeightForced
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setHeightForced
(
value
:
Boolean
):
StrutStyle
{
fun
setHeightForced
(
value
:
Boolean
):
StrutStyle
{
...
@@ -151,7 +153,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
...
@@ -151,7 +153,7 @@ class StrutStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nIsHeightOverridden
(
_ptr
)
_nIsHeightOverridden
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setHeightOverridden
(
value
:
Boolean
):
StrutStyle
{
fun
setHeightOverridden
(
value
:
Boolean
):
StrutStyle
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/TextBox.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/TextBox.kt
View file @
5c256dcf
File moved
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/TextStyle.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/TextStyle.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
...
@@ -5,7 +6,8 @@ import org.jetbrains.skia.*
...
@@ -5,7 +6,8 @@ import org.jetbrains.skia.*
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
TextStyle
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
class
TextStyle
internal
constructor
(
ptr
:
Long
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
companion
object
{
...
@@ -73,11 +75,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -73,11 +75,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nEquals
(
_nEquals
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
other
)
getPtr
(
other
)
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
other
)
reachabilityBarrier
(
other
)
}
}
}
}
...
@@ -87,11 +89,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -87,11 +89,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
_nAttributeEquals
(
_nAttributeEquals
(
_ptr
,
_ptr
,
attribute
.
ordinal
,
attribute
.
ordinal
,
Native
.
getPtr
(
other
)
getPtr
(
other
)
)
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
Reference
.
reachabilityFence
(
other
)
reachabilityBarrier
(
other
)
}
}
}
}
...
@@ -100,7 +102,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -100,7 +102,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetColor
(
_ptr
)
_nGetColor
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setColor
(
color
:
Int
):
TextStyle
{
fun
setColor
(
color
:
Int
):
TextStyle
{
...
@@ -115,7 +117,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -115,7 +117,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
val
ptr
=
_nGetForeground
(
_ptr
)
val
ptr
=
_nGetForeground
(
_ptr
)
if
(
ptr
==
0L
)
null
else
Paint
(
ptr
,
true
)
if
(
ptr
==
0L
)
null
else
Paint
(
ptr
,
true
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setForeground
(
paint
:
Paint
?):
TextStyle
{
fun
setForeground
(
paint
:
Paint
?):
TextStyle
{
...
@@ -123,11 +125,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -123,11 +125,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetForeground
(
_nSetForeground
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
paint
)
getPtr
(
paint
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
paint
)
reachabilityBarrier
(
paint
)
}
}
}
}
...
@@ -137,7 +139,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -137,7 +139,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
val
ptr
=
_nGetBackground
(
_ptr
)
val
ptr
=
_nGetBackground
(
_ptr
)
if
(
ptr
==
0L
)
null
else
Paint
(
ptr
,
true
)
if
(
ptr
==
0L
)
null
else
Paint
(
ptr
,
true
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setBackground
(
paint
:
Paint
?):
TextStyle
{
fun
setBackground
(
paint
:
Paint
?):
TextStyle
{
...
@@ -145,11 +147,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -145,11 +147,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetBackground
(
_nSetBackground
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
paint
)
getPtr
(
paint
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
paint
)
reachabilityBarrier
(
paint
)
}
}
}
}
...
@@ -158,7 +160,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -158,7 +160,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetDecorationStyle
(
_ptr
)
_nGetDecorationStyle
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setDecorationStyle
(
d
:
DecorationStyle
):
TextStyle
{
fun
setDecorationStyle
(
d
:
DecorationStyle
):
TextStyle
{
...
@@ -181,7 +183,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -181,7 +183,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
FontStyle
(
_nGetFontStyle
(
_ptr
))
FontStyle
(
_nGetFontStyle
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setFontStyle
(
s
:
FontStyle
):
TextStyle
{
fun
setFontStyle
(
s
:
FontStyle
):
TextStyle
{
...
@@ -195,7 +197,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -195,7 +197,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetShadows
(
_ptr
)
_nGetShadows
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
addShadow
(
s
:
Shadow
):
TextStyle
{
fun
addShadow
(
s
:
Shadow
):
TextStyle
{
...
@@ -220,7 +222,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -220,7 +222,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontFeatures
(
_ptr
)
_nGetFontFeatures
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
addFontFeature
(
f
:
FontFeature
):
TextStyle
{
fun
addFontFeature
(
f
:
FontFeature
):
TextStyle
{
...
@@ -245,7 +247,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -245,7 +247,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontSize
(
_ptr
)
_nGetFontSize
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setFontSize
(
size
:
Float
):
TextStyle
{
fun
setFontSize
(
size
:
Float
):
TextStyle
{
...
@@ -259,7 +261,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -259,7 +261,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontFamilies
(
_ptr
)
_nGetFontFamilies
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setFontFamily
(
family
:
String
):
TextStyle
{
fun
setFontFamily
(
family
:
String
):
TextStyle
{
...
@@ -277,7 +279,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -277,7 +279,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetHeight
(
_ptr
)
_nGetHeight
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setHeight
(
height
:
Float
?):
TextStyle
{
fun
setHeight
(
height
:
Float
?):
TextStyle
{
...
@@ -291,7 +293,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -291,7 +293,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLetterSpacing
(
_ptr
)
_nGetLetterSpacing
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setLetterSpacing
(
letterSpacing
:
Float
):
TextStyle
{
fun
setLetterSpacing
(
letterSpacing
:
Float
):
TextStyle
{
...
@@ -305,7 +307,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -305,7 +307,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetWordSpacing
(
_ptr
)
_nGetWordSpacing
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setWordSpacing
(
wordSpacing
:
Float
):
TextStyle
{
fun
setWordSpacing
(
wordSpacing
:
Float
):
TextStyle
{
...
@@ -320,7 +322,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -320,7 +322,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
val
ptr
=
_nGetTypeface
(
_ptr
)
val
ptr
=
_nGetTypeface
(
_ptr
)
if
(
ptr
==
0L
)
null
else
Typeface
(
ptr
)
if
(
ptr
==
0L
)
null
else
Typeface
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setTypeface
(
typeface
:
Typeface
?):
TextStyle
{
fun
setTypeface
(
typeface
:
Typeface
?):
TextStyle
{
...
@@ -328,11 +330,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -328,11 +330,11 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nSetTypeface
(
_nSetTypeface
(
_ptr
,
_ptr
,
Native
.
Companion
.
getPtr
(
typeface
)
getPtr
(
typeface
)
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
typeface
)
reachabilityBarrier
(
typeface
)
}
}
}
}
...
@@ -341,7 +343,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -341,7 +343,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetLocale
(
_ptr
)
_nGetLocale
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setLocale
(
locale
:
String
?):
TextStyle
{
fun
setLocale
(
locale
:
String
?):
TextStyle
{
...
@@ -355,7 +357,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -355,7 +357,7 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
BaselineMode
.
values
().
get
(
_nGetBaselineMode
(
_ptr
))
BaselineMode
.
values
().
get
(
_nGetBaselineMode
(
_ptr
))
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setBaselineMode
(
baseline
:
BaselineMode
):
TextStyle
{
fun
setBaselineMode
(
baseline
:
BaselineMode
):
TextStyle
{
...
@@ -369,14 +371,14 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
...
@@ -369,14 +371,14 @@ class TextStyle internal constructor(ptr: Long) : Managed(ptr, _FinalizerHolder.
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nGetFontMetrics
(
_ptr
)
_nGetFontMetrics
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
val
isPlaceholder
:
Boolean
val
isPlaceholder
:
Boolean
get
()
=
try
{
get
()
=
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nIsPlaceholder
(
_ptr
)
_nIsPlaceholder
(
_ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
fun
setPlaceholder
():
TextStyle
{
fun
setPlaceholder
():
TextStyle
{
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/paragraph/TypefaceFontProvider.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/paragraph/TypefaceFontProvider.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.paragraph
package
org.jetbrains.skia.paragraph
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.Typeface
import
org.jetbrains.skia.Typeface
import
org.jetbrains.skia.FontMgr
import
org.jetbrains.skia.FontMgr
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.ref.Reference
import
org.jetbrains.skia.impl.reachabilityBarrier
import
kotlin.jvm.JvmStatic
class
TypefaceFontProvider
:
FontMgr
(
_nMake
())
{
class
TypefaceFontProvider
:
FontMgr
(
_nMake
())
{
companion
object
{
companion
object
{
...
@@ -17,18 +18,17 @@ class TypefaceFontProvider : FontMgr(_nMake()) {
...
@@ -17,18 +18,17 @@ class TypefaceFontProvider : FontMgr(_nMake()) {
}
}
}
}
@JvmOverloads
fun
registerTypeface
(
typeface
:
Typeface
?,
alias
:
String
?
=
null
):
TypefaceFontProvider
{
fun
registerTypeface
(
typeface
:
Typeface
?,
alias
:
String
?
=
null
):
TypefaceFontProvider
{
return
try
{
return
try
{
Stats
.
onNativeCall
()
Stats
.
onNativeCall
()
_nRegisterTypeface
(
_nRegisterTypeface
(
_ptr
,
_ptr
,
Native
.
getPtr
(
typeface
),
getPtr
(
typeface
),
alias
alias
)
)
this
this
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
typeface
)
reachabilityBarrier
(
typeface
)
}
}
}
}
...
...
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/shaper/TextBlobBuilderRunHandler.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/shaper/TextBlobBuilderRunHandler.kt
View file @
5c256dcf
@file
:
Suppress
(
"NESTED_EXTERNAL_DECLARATION"
)
package
org.jetbrains.skia.shaper
package
org.jetbrains.skia.shaper
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
import
org.jetbrains.skia.*
import
org.jetbrains.skia.*
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Managed
import
org.jetbrains.skia.impl.Native
import
org.jetbrains.skia.impl.Stats
import
org.jetbrains.skia.impl.Stats
import
java.lang.UnsupportedOperationException
import
org.jetbrains.skia.impl.reachabilityBarrier
import
java.lang.ref.Reference
import
kotlin.jvm.JvmStatic
class
TextBlobBuilderRunHandler
<
T
>
internal
constructor
(
class
TextBlobBuilderRunHandler
<
T
>
internal
constructor
(
text
:
ManagedString
?,
text
:
ManagedString
?,
...
@@ -14,7 +14,7 @@ class TextBlobBuilderRunHandler<T> internal constructor(
...
@@ -14,7 +14,7 @@ class TextBlobBuilderRunHandler<T> internal constructor(
offsetX
:
Float
,
offsetX
:
Float
,
offsetY
:
Float
offsetY
:
Float
)
:
Managed
(
)
:
Managed
(
_nMake
(
Native
.
Companion
.
getPtr
(
text
),
offsetX
,
offsetY
),
_FinalizerHolder
.
PTR
_nMake
(
getPtr
(
text
),
offsetX
,
offsetY
),
_FinalizerHolder
.
PTR
),
RunHandler
{
),
RunHandler
{
companion
object
{
companion
object
{
@JvmStatic
external
fun
_nGetFinalizer
():
Long
@JvmStatic
external
fun
_nGetFinalizer
():
Long
...
@@ -66,7 +66,7 @@ class TextBlobBuilderRunHandler<T> internal constructor(
...
@@ -66,7 +66,7 @@ class TextBlobBuilderRunHandler<T> internal constructor(
val
ptr
=
_nMakeBlob
(
_ptr
)
val
ptr
=
_nMakeBlob
(
_ptr
)
if
(
0L
==
ptr
)
null
else
TextBlob
(
ptr
)
if
(
0L
==
ptr
)
null
else
TextBlob
(
ptr
)
}
finally
{
}
finally
{
Reference
.
reachabilityFence
(
this
)
reachabilityBarrier
(
this
)
}
}
}
}
...
@@ -76,6 +76,6 @@ class TextBlobBuilderRunHandler<T> internal constructor(
...
@@ -76,6 +76,6 @@ class TextBlobBuilderRunHandler<T> internal constructor(
init
{
init
{
_text
=
if
(
manageText
)
text
else
null
_text
=
if
(
manageText
)
text
else
null
Reference
.
reachabilityFence
(
text
)
reachabilityBarrier
(
text
)
}
}
}
}
\ No newline at end of file
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/shaper/TrivialBidiRunIterator.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/shaper/TrivialBidiRunIterator.kt
View file @
5c256dcf
File moved
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/shaper/TrivialFontRunIterator.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/shaper/TrivialFontRunIterator.kt
View file @
5c256dcf
File moved
skiko/src/
jvm
Main/kotlin/org/jetbrains/skia/shaper/TrivialScriptRunIterator.kt
→
skiko/src/
common
Main/kotlin/org/jetbrains/skia/shaper/TrivialScriptRunIterator.kt
View file @
5c256dcf
File moved
skiko/src/jsMain/kotlin/org/jetbrains/skia/Actuals.js.kt
View file @
5c256dcf
package
org.jetbrains.skia
package
org.jetbrains.skia
actual
abstract
class
OutputStream
actual
abstract
class
ByteBuffer
actual
abstract
class
ByteBuffer
actual
fun
<
R
>
commonSynchronized
(
lock
:
Any
,
block
:
()
->
R
)
{
actual
fun
<
R
>
commonSynchronized
(
lock
:
Any
,
block
:
()
->
R
)
{
...
...
skiko/src/jsMain/kotlin/org/jetbrains/skia/impl/Managed.js.kt
View file @
5c256dcf
...
@@ -2,4 +2,7 @@ package org.jetbrains.skia.impl
...
@@ -2,4 +2,7 @@ package org.jetbrains.skia.impl
actual
abstract
class
Managed
actual
constructor
(
ptr
:
Long
,
finalizer
:
Long
,
managed
:
Boolean
)
:
Native
(
ptr
)
{
actual
abstract
class
Managed
actual
constructor
(
ptr
:
Long
,
finalizer
:
Long
,
managed
:
Boolean
)
:
Native
(
ptr
)
{
actual
open
fun
close
():
Unit
=
TODO
()
actual
open
fun
close
():
Unit
=
TODO
()
actual
open
val
isClosed
:
Boolean
get
()
=
_ptr
==
0L
}
}
\ No newline at end of file
skiko/src/jvmMain/kotlin/org/jetbrains/skia/Actuals.jvm.kt
View file @
5c256dcf
...
@@ -18,3 +18,4 @@ actual fun defaultLanguageTag(): String = Locale.getDefault().toLanguageTag()
...
@@ -18,3 +18,4 @@ actual fun defaultLanguageTag(): String = Locale.getDefault().toLanguageTag()
actual
fun
compilePattern
(
regex
:
String
):
Pattern
=
Pattern
.
compile
(
regex
)
actual
fun
compilePattern
(
regex
:
String
):
Pattern
=
Pattern
.
compile
(
regex
)
actual
typealias
OutputStream
=
java
.
io
.
OutputStream
skiko/src/jvmMain/kotlin/org/jetbrains/skia/impl/Managed.jvm.kt
View file @
5c256dcf
...
@@ -15,7 +15,7 @@ actual abstract class Managed actual constructor(ptr: Long, finalizer: Long, man
...
@@ -15,7 +15,7 @@ actual abstract class Managed actual constructor(ptr: Long, finalizer: Long, man
}
}
}
}
open
val
isClosed
:
Boolean
actual
open
val
isClosed
:
Boolean
get
()
=
_ptr
==
0L
get
()
=
_ptr
==
0L
class
CleanerThunk
(
var
_className
:
String
,
var
_ptr
:
Long
,
var
_finalizerPtr
:
Long
)
:
Runnable
{
class
CleanerThunk
(
var
_className
:
String
,
var
_ptr
:
Long
,
var
_finalizerPtr
:
Long
)
:
Runnable
{
...
...
skiko/src/macosX64Main/kotlin/org/jetbrains/skia/Actuals.native.kt
View file @
5c256dcf
package
org.jetbrains.skia
package
org.jetbrains.skia
actual
abstract
class
ByteBuffer
actual
abstract
class
ByteBuffer
actual
abstract
class
OutputStream
actual
fun
<
R
>
commonSynchronized
(
lock
:
Any
,
block
:
()
->
R
)
{
actual
fun
<
R
>
commonSynchronized
(
lock
:
Any
,
block
:
()
->
R
)
{
block
()
block
()
...
...
skiko/src/macosX64Main/kotlin/org/jetbrains/skia/impl/Managed.native.kt
View file @
5c256dcf
...
@@ -2,4 +2,6 @@ package org.jetbrains.skia.impl
...
@@ -2,4 +2,6 @@ package org.jetbrains.skia.impl
actual
abstract
class
Managed
actual
constructor
(
ptr
:
Long
,
finalizer
:
Long
,
managed
:
Boolean
)
:
Native
(
ptr
)
{
actual
abstract
class
Managed
actual
constructor
(
ptr
:
Long
,
finalizer
:
Long
,
managed
:
Boolean
)
:
Native
(
ptr
)
{
actual
open
fun
close
():
Unit
=
TODO
()
actual
open
fun
close
():
Unit
=
TODO
()
actual
open
val
isClosed
:
Boolean
get
()
=
_ptr
==
0L
}
}
\ No newline at end of file
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