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
50cbeb65
Unverified
Commit
50cbeb65
authored
Oct 07, 2021
by
Nikolay Igotti
Committed by
GitHub
Oct 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup generated files. (#244)
parent
9e1a2c85
Changes
58
Show whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
304 additions
and
680 deletions
+304
-680
AnimationFrameInfo.kt
...ommonMain/kotlin/org/jetbrains/skia/AnimationFrameInfo.kt
+11
-29
BackendRenderTarget.kt
...mmonMain/kotlin/org/jetbrains/skia/BackendRenderTarget.kt
+0
-1
Bitmap.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Bitmap.kt
+0
-3
BreakIterator.kt
...src/commonMain/kotlin/org/jetbrains/skia/BreakIterator.kt
+2
-2
Color4f.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Color4f.kt
+3
-9
ColorInfo.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorInfo.kt
+6
-20
ColorMatrix.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/ColorMatrix.kt
+3
-9
ColorSpace.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorSpace.kt
+2
-2
ColorType.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorType.kt
+9
-9
CubicResampler.kt
...rc/commonMain/kotlin/org/jetbrains/skia/CubicResampler.kt
+3
-10
FilterMipmap.kt
.../src/commonMain/kotlin/org/jetbrains/skia/FilterMipmap.kt
+7
-19
FontExtents.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/FontExtents.kt
+3
-9
FontFamilyName.kt
...rc/commonMain/kotlin/org/jetbrains/skia/FontFamilyName.kt
+7
-19
FontFeature.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/FontFeature.kt
+10
-21
FontMetrics.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/FontMetrics.kt
+11
-29
FontStyle.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontStyle.kt
+6
-12
FontVariation.kt
...src/commonMain/kotlin/org/jetbrains/skia/FontVariation.kt
+7
-16
FontVariationAxis.kt
...commonMain/kotlin/org/jetbrains/skia/FontVariationAxis.kt
+7
-18
GradientStyle.kt
...src/commonMain/kotlin/org/jetbrains/skia/GradientStyle.kt
+7
-19
IPoint.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/IPoint.kt
+3
-9
IRange.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRange.kt
+3
-10
IRect.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRect.kt
+9
-14
ISize.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ISize.kt
+3
-9
ImageInfo.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ImageInfo.kt
+6
-15
Matrix33.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix33.kt
+3
-9
Matrix44.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix44.kt
+3
-9
PathFillMode.kt
.../src/commonMain/kotlin/org/jetbrains/skia/PathFillMode.kt
+0
-1
PathSegment.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/PathSegment.kt
+15
-20
Point.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Point.kt
+4
-10
Point3.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Point3.kt
+3
-9
RRect.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/RRect.kt
+4
-10
RSXform.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/RSXform.kt
+3
-8
Rect.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Rect.kt
+3
-9
SurfaceProps.kt
.../src/commonMain/kotlin/org/jetbrains/skia/SurfaceProps.kt
+6
-20
TextBlob.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/TextBlob.kt
+49
-50
DecorationStyle.kt
...in/kotlin/org/jetbrains/skia/paragraph/DecorationStyle.kt
+5
-14
FontCollection.kt
...ain/kotlin/org/jetbrains/skia/paragraph/FontCollection.kt
+0
-1
LineMetrics.kt
...onMain/kotlin/org/jetbrains/skia/paragraph/LineMetrics.kt
+16
-34
ParagraphBuilder.kt
...n/kotlin/org/jetbrains/skia/paragraph/ParagraphBuilder.kt
+0
-1
ParagraphStyle.kt
...ain/kotlin/org/jetbrains/skia/paragraph/ParagraphStyle.kt
+0
-1
PlaceholderStyle.kt
...n/kotlin/org/jetbrains/skia/paragraph/PlaceholderStyle.kt
+7
-19
PositionWithAffinity.kt
...tlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
+5
-14
Shadow.kt
.../commonMain/kotlin/org/jetbrains/skia/paragraph/Shadow.kt
+6
-12
TextBox.kt
...commonMain/kotlin/org/jetbrains/skia/paragraph/TextBox.kt
+8
-20
BidiRun.kt
...rc/commonMain/kotlin/org/jetbrains/skia/shaper/BidiRun.kt
+3
-9
FontMgrRunIterator.kt
...in/kotlin/org/jetbrains/skia/shaper/FontMgrRunIterator.kt
+2
-3
FontRun.kt
...rc/commonMain/kotlin/org/jetbrains/skia/shaper/FontRun.kt
+5
-14
HbIcuScriptRunIterator.kt
...otlin/org/jetbrains/skia/shaper/HbIcuScriptRunIterator.kt
+1
-1
IcuBidiRunIterator.kt
...in/kotlin/org/jetbrains/skia/shaper/IcuBidiRunIterator.kt
+0
-1
LanguageRun.kt
...ommonMain/kotlin/org/jetbrains/skia/shaper/LanguageRun.kt
+5
-14
RunInfo.kt
...rc/commonMain/kotlin/org/jetbrains/skia/shaper/RunInfo.kt
+5
-13
ScriptRun.kt
.../commonMain/kotlin/org/jetbrains/skia/shaper/ScriptRun.kt
+3
-9
ShapingOptions.kt
...onMain/kotlin/org/jetbrains/skia/shaper/ShapingOptions.kt
+5
-14
TextBlobBuilderRunHandler.kt
...in/org/jetbrains/skia/shaper/TextBlobBuilderRunHandler.kt
+2
-3
AnimationBuilder.kt
...ain/kotlin/org/jetbrains/skia/skottie/AnimationBuilder.kt
+0
-1
SVGLengthContext.kt
...monMain/kotlin/org/jetbrains/skia/svg/SVGLengthContext.kt
+3
-9
SVGPreserveAspectRatio.kt
...n/kotlin/org/jetbrains/skia/svg/SVGPreserveAspectRatio.kt
+0
-4
Native.jvm.kt
.../src/jvmMain/kotlin/org/jetbrains/skia/impl/Native.jvm.kt
+2
-1
No files found.
skiko/src/commonMain/kotlin/org/jetbrains/skia/AnimationFrameInfo.kt
View file @
50cbeb65
...
...
@@ -85,31 +85,17 @@ class AnimationFrameInfo(
BlendMode
.
values
()[
blendModeOrdinal
],
frameRect
)
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
AnimationFrameInfo
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
AnimationFrameInfo
)
return
false
if
(
requiredFrame
!=
other
.
requiredFrame
)
return
false
if
(
duration
!=
other
.
duration
)
return
false
if
(
isFullyReceived
!=
other
.
isFullyReceived
)
return
false
if
(
isHasAlphaWithinBounds
!=
other
.
isHasAlphaWithinBounds
)
return
false
val
`
this
$
_alphaType
`
:
Any
=
alphaType
val
`
other
$
_alphaType
`
:
Any
=
other
.
alphaType
if
(
`
this
$
_alphaType
`
!=
`
other
$
_alphaType
`
)
return
false
val
`
this
$
_disposalMethod
`
:
Any
=
disposalMethod
val
`
other
$
_disposalMethod
`
:
Any
=
other
.
disposalMethod
if
(
`
this
$
_disposalMethod
`
!=
`
other
$
_disposalMethod
`
)
return
false
val
`
this
$
_blendMode
`
:
Any
=
blendMode
val
`
other
$
_blendMode
`
:
Any
=
other
.
blendMode
if
(
`
this
$
_blendMode
`
!=
`
other
$
_blendMode
`
)
return
false
val
`
this
$
_frameRect
`
:
Any
=
frameRect
val
`
other
$
_frameRect
`
:
Any
=
other
.
frameRect
return
`
this
$
_frameRect
`
==
`
other
$
_frameRect
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
AnimationFrameInfo
if
(
this
.
alphaType
!=
other
.
alphaType
)
return
false
if
(
this
.
disposalMethod
!=
other
.
disposalMethod
)
return
false
if
(
this
.
blendMode
!=
other
.
blendMode
)
return
false
return
this
.
frameRect
==
other
.
frameRect
}
override
fun
hashCode
():
Int
{
...
...
@@ -119,14 +105,10 @@ class AnimationFrameInfo(
result
=
result
*
PRIME
+
duration
result
=
result
*
PRIME
+
if
(
isFullyReceived
)
79
else
97
result
=
result
*
PRIME
+
if
(
isHasAlphaWithinBounds
)
79
else
97
val
`$
_alphaType
`
:
Any
=
alphaType
result
=
result
*
PRIME
+
(
`$
_alphaType
`
.
hashCode
())
val
`$
_disposalMethod
`
:
Any
=
disposalMethod
result
=
result
*
PRIME
+
`$
_disposalMethod
`
.
hashCode
()
val
`$
_blendMode
`
:
Any
=
blendMode
result
=
result
*
PRIME
+
`$
_blendMode
`
.
hashCode
()
val
`$
_frameRect
`
:
Any
=
frameRect
result
=
result
*
PRIME
+
`$
_frameRect
`
.
hashCode
()
result
=
result
*
PRIME
+
alphaType
.
hashCode
()
result
=
result
*
PRIME
+
disposalMethod
.
hashCode
()
result
=
result
*
PRIME
+
blendMode
.
hashCode
()
result
=
result
*
PRIME
+
frameRect
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/BackendRenderTarget.kt
View file @
50cbeb65
...
...
@@ -68,7 +68,6 @@ class BackendRenderTarget internal constructor(ptr: NativePointer) : Managed(ptr
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_BackendRenderTarget__1nGetFinalizer"
)
private
external
fun
BackendRenderTarget_nGetFinalizer
():
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Bitmap.kt
View file @
50cbeb65
...
...
@@ -996,9 +996,6 @@ class Bitmap internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
localMatrix
:
Matrix33
?
=
null
):
Shader
{
return
try
{
require
(
tmx
!=
null
)
{
"Can’t Bitmap.makeShader with tmx == null"
}
require
(
tmy
!=
null
)
{
"Can’t Bitmap.makeShader with tmy == null"
}
require
(
sampling
!=
null
)
{
"Can’t Bitmap.makeShader with sampling == null"
}
Stats
.
onNativeCall
()
Shader
(
interopScope
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/BreakIterator.kt
View file @
50cbeb65
...
...
@@ -353,8 +353,8 @@ class BreakIterator internal constructor(ptr: NativePointer) : Managed(ptr, _Fin
* @return The character offset of the boundary position n boundaries away from
* the current one.
*/
fun
next
(
n
:
Int
):
Int
{
var
n
=
n
fun
next
(
index
:
Int
):
Int
{
var
n
=
index
var
result
=
0
if
(
n
>
0
)
{
while
(
n
>
0
&&
result
!=
DONE
)
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Color4f.kt
View file @
50cbeb65
...
...
@@ -33,21 +33,15 @@ class Color4f constructor(val r: Float, val g: Float, val b: Float, val a: Float
)
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Color4f
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Color4f
)
return
false
if
(
r
.
compareTo
(
other
.
r
)
!=
0
)
return
false
if
(
g
.
compareTo
(
other
.
g
)
!=
0
)
return
false
if
(
b
.
compareTo
(
other
.
b
)
!=
0
)
return
false
return
a
.
compareTo
(
other
.
a
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Color4f
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorInfo.kt
View file @
50cbeb65
...
...
@@ -40,31 +40,17 @@ class ColorInfo(val colorType: ColorType, val alphaType: ColorAlphaType, val col
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
ColorInfo
)
return
false
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_colorType
`
:
Any
=
colorType
val
`
other
$
_colorType
`
:
Any
=
other
.
colorType
if
(
`
this
$
_colorType
`
!=
`
other
$
_colorType
`
)
return
false
val
`
this
$
_alphaType
`
:
Any
=
alphaType
val
`
other
$
_alphaType
`
:
Any
=
other
.
alphaType
if
(
`
this
$
_alphaType
`
!=
`
other
$
_alphaType
`
)
return
false
val
`
this
$
_colorSpace
`
:
Any
?
=
colorSpace
val
`
other
$
_colorSpace
`
:
Any
?
=
other
.
colorSpace
return
!
if
(
`
this
$
_colorSpace
`
==
null
)
`
other
$
_colorSpace
`
!=
null
else
`
this
$
_colorSpace
`
!=
`
other
$
_colorSpace
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
ColorInfo
if
(
this
.
colorType
!=
other
.
colorType
)
return
false
if
(
this
.
alphaType
!=
other
.
alphaType
)
return
false
return
this
.
colorSpace
==
other
.
colorSpace
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_colorType
`
:
Any
=
colorType
result
=
result
*
PRIME
+
`$
_colorType
`
.
hashCode
()
val
`$
_alphaType
`
:
Any
=
alphaType
result
=
result
*
PRIME
+
`$
_alphaType
`
.
hashCode
()
val
`$
_colorSpace
`
:
Any
?
=
colorSpace
result
=
result
*
PRIME
+
`$
_colorSpace
`
.
hashCode
()
result
=
result
*
PRIME
+
colorType
.
hashCode
()
result
=
result
*
PRIME
+
alphaType
.
hashCode
()
result
=
result
*
PRIME
+
colorSpace
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorMatrix.kt
View file @
50cbeb65
...
...
@@ -2,18 +2,12 @@ package org.jetbrains.skia
class
ColorMatrix
(
vararg
mat
:
Float
)
{
val
mat
:
FloatArray
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
ColorMatrix
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
ColorMatrix
)
return
false
return
mat
.
contentEquals
(
other
.
mat
)
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
ColorMatrix
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorSpace.kt
View file @
50cbeb65
...
...
@@ -16,8 +16,8 @@ class ColorSpace : Managed {
}
fun
convert
(
to
:
ColorSpace
?,
color
:
Color4f
):
Color4f
{
var
to
=
to
fun
convert
(
to
Color
:
ColorSpace
?,
color
:
Color4f
):
Color4f
{
var
to
=
to
Color
to
=
to
?:
sRGB
return
try
{
Color4f
(
withResult
(
FloatArray
(
4
))
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorType.kt
View file @
50cbeb65
...
...
@@ -141,7 +141,6 @@ enum class ColorType {
R16G16_FLOAT
->
4
R16G16B16A16_UNORM
->
8
}
throw
RuntimeException
(
"Unreachable"
)
}
val
shiftPerPixel
:
Int
get
()
{
...
...
@@ -183,18 +182,19 @@ enum class ColorType {
* @return ColorAlphaType if can be associated with colorType
*/
fun
validateAlphaType
(
alphaType
:
ColorAlphaType
):
ColorAlphaType
?
{
var
alphaType
=
alphaType
when
(
this
)
{
UNKNOWN
->
alphaType
=
ColorAlphaType
.
UNKNOWN
return
when
(
this
)
{
UNKNOWN
->
ColorAlphaType
.
UNKNOWN
ALPHA_8
,
A16_UNORM
,
A16_FLOAT
->
{
if
(
ColorAlphaType
.
UNPREMUL
==
alphaType
)
alphaType
=
ColorAlphaType
.
PREMUL
if
(
ColorAlphaType
.
UNKNOWN
==
alphaType
)
return
null
}
ARGB_4444
,
RGBA_8888
,
BGRA_8888
,
RGBA_1010102
,
BGRA_1010102
,
RGBA_F16NORM
,
RGBA_F16
,
RGBA_F32
,
R16G16B16A16_UNORM
->
if
(
ColorAlphaType
.
UNKNOWN
==
alphaType
)
return
null
GRAY_8
,
R8G8_UNORM
,
R16G16_UNORM
,
R16G16_FLOAT
,
RGB_565
,
RGB_888X
,
RGB_101010X
,
BGR_101010X
->
alphaType
=
if
(
ColorAlphaType
.
UNPREMUL
==
alphaType
)
ColorAlphaType
.
PREMUL
else
if
(
ColorAlphaType
.
UNKNOWN
==
alphaType
)
null
else
alphaType
}
ARGB_4444
,
RGBA_8888
,
BGRA_8888
,
RGBA_1010102
,
BGRA_1010102
,
RGBA_F16NORM
,
RGBA_F16
,
RGBA_F32
,
R16G16B16A16_UNORM
->
if
(
ColorAlphaType
.
UNKNOWN
==
alphaType
)
null
else
alphaType
GRAY_8
,
R8G8_UNORM
,
R16G16_UNORM
,
R16G16_FLOAT
,
RGB_565
,
RGB_888X
,
RGB_101010X
,
BGR_101010X
->
ColorAlphaType
.
OPAQUE
}
return
alphaType
}
fun
computeOffset
(
x
:
Int
,
y
:
Int
,
rowBytes
:
Long
):
Long
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/CubicResampler.kt
View file @
50cbeb65
package
org.jetbrains.skia
/**
*
* Specify B and C (each between 0...1) to create a shader that applies the corresponding
...
...
@@ -26,19 +25,13 @@ class CubicResampler(val b: Float, val c: Float) : SamplingMode {
override
fun
_pack
():
Long
=
(
0
x8L
shl
60
)
or
((
b
.
toBits
().
toULong
()
shl
32
)
or
c
.
toBits
().
toULong
()).
toLong
()
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
CubicResampler
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
CubicResampler
)
return
false
if
(
b
.
compareTo
(
other
.
b
)
!=
0
)
return
false
return
c
.
compareTo
(
other
.
c
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
CubicResampler
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FilterMipmap.kt
View file @
50cbeb65
...
...
@@ -7,30 +7,18 @@ class FilterMipmap constructor(
override
fun
_pack
()
=
filterMode
.
ordinal
.
toLong
()
shl
32
or
mipmapMode
.
ordinal
.
toLong
()
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FilterMipmap
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_filterMode
`
:
Any
=
filterMode
val
`
other
$
_filterMode
`
:
Any
=
other
.
filterMode
if
(
`
this
$
_filterMode
`
!=
`
other
$
_filterMode
`
)
return
false
val
`
this
$
_mipmapMode
`
:
Any
=
mipmapMode
val
`
other
$
_mipmapMode
`
:
Any
=
other
.
mipmapMode
return
`
this
$
_mipmapMode
`
==
`
other
$
_mipmapMode
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FilterMipmap
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FilterMipmap
)
return
false
if
(
this
.
filterMode
!=
other
.
filterMode
)
return
false
return
this
.
mipmapMode
==
other
.
mipmapMode
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_filterMode
`
:
Any
=
filterMode
result
=
result
*
PRIME
+
(
`$
_filterMode
`
.
hashCode
())
val
`$
_mipmapMode
`
:
Any
=
mipmapMode
result
=
result
*
PRIME
+
(
`$
_mipmapMode
`
.
hashCode
())
result
=
result
*
PRIME
+
(
filterMode
.
hashCode
())
result
=
result
*
PRIME
+
(
mipmapMode
.
hashCode
())
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontExtents.kt
View file @
50cbeb65
...
...
@@ -8,20 +8,14 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float)
val
lineHeight
:
Float
get
()
=
-
ascender
+
descender
+
lineGap
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontExtents
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontExtents
)
return
false
if
(
ascender
.
compareTo
(
other
.
ascender
)
!=
0
)
return
false
if
(
descender
.
compareTo
(
other
.
descender
)
!=
0
)
return
false
return
lineGap
.
compareTo
(
other
.
lineGap
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontExtents
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontFamilyName.kt
View file @
50cbeb65
package
org.jetbrains.skia
class
FontFamilyName
(
val
name
:
String
,
val
language
:
String
)
{
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontFamilyName
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_name
`
:
Any
=
name
val
`
other
$
_name
`
:
Any
=
other
.
name
if
(
`
this
$
_name
`
!=
`
other
$
_name
`
)
return
false
val
`
this
$
_language
`
:
Any
=
language
val
`
other
$
_language
`
:
Any
=
other
.
language
return
`
this
$
_language
`
==
`
other
$
_language
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontFamilyName
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontFamilyName
)
return
false
if
(
this
.
name
!=
other
.
name
)
return
false
return
this
.
language
==
other
.
language
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_name
`
:
Any
=
name
result
=
result
*
PRIME
+
(
`$
_name
`
.
hashCode
())
val
`$
_language
`
:
Any
=
language
result
=
result
*
PRIME
+
(
`$
_language
`
.
hashCode
())
result
=
result
*
PRIME
+
name
.
hashCode
()
result
=
result
*
PRIME
+
language
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontFeature.kt
View file @
50cbeb65
...
...
@@ -39,33 +39,22 @@ class FontFeature(val _tag: Int, val value: Int, val start: Long, val end: Long)
return
"FontFeature($valuePrefix$_tag$range$valueSuffix)"
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontFeature
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_tag
`
:
Any
=
_tag
val
`
other
$
_tag
`
:
Any
=
other
.
_tag
if
(
`
this
$
_tag
`
!=
`
other
$
_tag
`
)
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontFeature
)
return
false
if
(
this
.
tag
!=
other
)
return
false
if
(
value
!=
other
.
value
)
return
false
if
(
start
!=
other
.
start
)
return
false
return
if
(
end
!=
other
.
end
)
false
else
true
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontFeature
return
end
==
other
.
end
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_tag
`
:
Any
=
_tag
result
=
result
*
PRIME
+
(
`$
_tag
`
.
hashCode
())
result
=
result
*
PRIME
+
(
_tag
.
hashCode
())
result
=
result
*
PRIME
+
value
val
`$
_start
`
=
start
result
=
result
*
PRIME
+
(
`$
_start
`
ushr
32
xor
`$
_start
`
).
toInt
()
val
`$
_end
`
=
end
result
=
result
*
PRIME
+
(
`$
_end
`
ushr
32
xor
`$
_end
`
).
toInt
()
result
=
result
*
PRIME
+
(
start
ushr
32
xor
start
).
toInt
()
result
=
result
*
PRIME
+
(
end
ushr
32
xor
end
).
toInt
()
return
result
}
...
...
@@ -87,8 +76,8 @@ class FontFeature(val _tag: Int, val value: Int, val start: Long, val end: Long)
return
FontFeature
(
m
.
group
(
"tag"
)
!!
,
value
,
start
,
end
)
}
fun
parse
(
s
:
String
):
Array
<
FontFeature
?
>
{
return
_splitPattern
.
split
(
s
)
?.
map
{
s
->
parseOne
(
s
!!
)
}
?.
toTypedArray
()
?:
emptyArray
()
fun
parse
(
s
tr
:
String
):
Array
<
FontFeature
?
>
{
return
_splitPattern
.
split
(
s
tr
)
?.
map
{
s
->
parseOne
(
s
!!
)
}
?.
toTypedArray
()
?:
emptyArray
()
}
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontMetrics.kt
View file @
50cbeb65
...
...
@@ -110,11 +110,9 @@ class FontMetrics(
val
height
:
Float
get
()
=
descent
-
ascent
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontMetrics
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontMetrics
)
return
false
if
(
top
.
compareTo
(
other
.
top
)
!=
0
)
return
false
if
(
ascent
.
compareTo
(
other
.
ascent
)
!=
0
)
return
false
if
(
descent
.
compareTo
(
other
.
descent
)
!=
0
)
return
false
...
...
@@ -126,22 +124,10 @@ class FontMetrics(
if
(
xMax
.
compareTo
(
other
.
xMax
)
!=
0
)
return
false
if
(
xHeight
.
compareTo
(
other
.
xHeight
)
!=
0
)
return
false
if
(
capHeight
.
compareTo
(
other
.
capHeight
)
!=
0
)
return
false
val
`
this
$
_underlineThickness
`
:
Any
?
=
underlineThickness
val
`
other
$
_underlineThickness
`
:
Any
?
=
other
.
underlineThickness
if
(
if
(
`
this
$
_underlineThickness
`
==
null
)
`
other
$
_underlineThickness
`
!=
null
else
`
this
$
_underlineThickness
`
!=
`
other
$
_underlineThickness
`
)
return
false
val
`
this
$
_underlinePosition
`
:
Any
?
=
underlinePosition
val
`
other
$
_underlinePosition
`
:
Any
?
=
other
.
underlinePosition
if
(
if
(
`
this
$
_underlinePosition
`
==
null
)
`
other
$
_underlinePosition
`
!=
null
else
`
this
$
_underlinePosition
`
!=
`
other
$
_underlinePosition
`
)
return
false
val
`
this
$
_strikeoutThickness
`
:
Any
?
=
strikeoutThickness
val
`
other
$
_strikeoutThickness
`
:
Any
?
=
other
.
strikeoutThickness
if
(
if
(
`
this
$
_strikeoutThickness
`
==
null
)
`
other
$
_strikeoutThickness
`
!=
null
else
`
this
$
_strikeoutThickness
`
!=
`
other
$
_strikeoutThickness
`
)
return
false
val
`
this
$
_strikeoutPosition
`
:
Any
?
=
strikeoutPosition
val
`
other
$
_strikeoutPosition
`
:
Any
?
=
other
.
strikeoutPosition
return
if
(
if
(
`
this
$
_strikeoutPosition
`
==
null
)
`
other
$
_strikeoutPosition
`
!=
null
else
`
this
$
_strikeoutPosition
`
!=
`
other
$
_strikeoutPosition
`
)
false
else
true
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontMetrics
if
(
if
(
this
.
underlineThickness
==
null
)
other
.
underlineThickness
!=
null
else
this
.
underlineThickness
!=
other
.
underlineThickness
)
return
false
if
(
if
(
this
.
underlinePosition
==
null
)
other
.
underlinePosition
!=
null
else
this
.
underlinePosition
!=
other
.
underlinePosition
)
return
false
if
(
if
(
this
.
strikeoutThickness
==
null
)
other
.
strikeoutThickness
!=
null
else
this
.
strikeoutThickness
!=
other
.
strikeoutThickness
)
return
false
return
!
if
(
this
.
strikeoutPosition
==
null
)
other
.
strikeoutPosition
!=
null
else
this
.
strikeoutPosition
!=
other
.
strikeoutPosition
}
override
fun
hashCode
():
Int
{
...
...
@@ -158,14 +144,10 @@ class FontMetrics(
result
=
result
*
PRIME
+
xMax
.
toBits
()
result
=
result
*
PRIME
+
xHeight
.
toBits
()
result
=
result
*
PRIME
+
capHeight
.
toBits
()
val
`$
_underlineThickness
`
:
Any
?
=
underlineThickness
result
=
result
*
PRIME
+
(
`$
_underlineThickness
`
?.
hashCode
()
?:
43
)
val
`$
_underlinePosition
`
:
Any
?
=
underlinePosition
result
=
result
*
PRIME
+
(
`$
_underlinePosition
`
?.
hashCode
()
?:
43
)
val
`$
_strikeoutThickness
`
:
Any
?
=
strikeoutThickness
result
=
result
*
PRIME
+
(
`$
_strikeoutThickness
`
?.
hashCode
()
?:
43
)
val
`$
_strikeoutPosition
`
:
Any
?
=
strikeoutPosition
result
=
result
*
PRIME
+
(
`$
_strikeoutPosition
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
underlineThickness
.
hashCode
()
result
=
result
*
PRIME
+
underlinePosition
.
hashCode
()
result
=
result
*
PRIME
+
strikeoutThickness
.
hashCode
()
result
=
result
*
PRIME
+
strikeoutPosition
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontStyle.kt
View file @
50cbeb65
...
...
@@ -26,26 +26,20 @@ class FontStyle {
}
val
slant
:
FontSlant
get
()
=
FontSlant
.
values
()
.
get
(
_value
shr
24
and
255
)
get
()
=
FontSlant
.
values
()
[
_value
shr
24
and
255
]
fun
withSlant
(
slant
:
FontSlant
):
FontStyle
{
return
FontStyle
(
weight
,
width
,
slant
)
}
override
fun
toString
():
String
{
return
"FontStyle(weight=$weight, width=$width, slant=
\'
$slant)"
return
"FontStyle(weight=$weight, width=$width, slant=$slant)"
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontStyle
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
return
if
(
_value
!=
other
.
_value
)
false
else
true
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontStyle
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontStyle
)
return
false
return
_value
==
other
.
_value
}
override
fun
hashCode
():
Int
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontVariation.kt
View file @
50cbeb65
...
...
@@ -11,26 +11,17 @@ class FontVariation(val _tag: Int, val value: Float) {
return
"$tag=$value"
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontVariation
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_tag
`
:
Any
=
_tag
val
`
other
$
_tag
`
:
Any
=
other
.
_tag
if
(
`
this
$
_tag
`
!=
`
other
$
_tag
`
)
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontVariation
)
return
false
if
(
this
.
tag
!=
other
.
tag
)
return
false
return
value
.
compareTo
(
other
.
value
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontVariation
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_tag
`
:
Any
=
_tag
result
=
result
*
PRIME
+
(
`$
_tag
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
_tag
result
=
result
*
PRIME
+
value
.
toBits
()
return
result
}
...
...
@@ -49,8 +40,8 @@ class FontVariation(val _tag: Int, val value: Float) {
return
FontVariation
(
m
.
group
(
"tag"
)
!!
,
value
)
}
fun
parse
(
s
:
String
?
):
Array
<
FontVariation
>
{
return
_splitPattern
.
split
(
s
!!
)
!!
.
map
{
s
->
parseOne
(
s
!!
)
}
fun
parse
(
s
tr
:
String
):
Array
<
FontVariation
>
{
return
_splitPattern
.
split
(
s
tr
)
!!
.
map
{
s
->
parseOne
(
s
!!
)
}
.
toTypedArray
()
}
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontVariationAxis.kt
View file @
50cbeb65
...
...
@@ -17,8 +17,7 @@ class FontVariationAxis(
def
:
Float
,
max
:
Float
,
hidden
:
Boolean
)
:
this
(
FourByteTag
.
fromString
(
tag
),
min
,
def
,
max
,
hidden
)
{
}
)
:
this
(
FourByteTag
.
fromString
(
tag
),
min
,
def
,
max
,
hidden
)
constructor
(
tag
:
String
,
min
:
Float
,
def
:
Float
,
max
:
Float
)
:
this
(
FourByteTag
.
fromString
(
tag
),
...
...
@@ -26,32 +25,22 @@ class FontVariationAxis(
def
,
max
,
false
)
{
}
)
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontVariationAxis
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_tag
`
:
Any
=
_tag
val
`
other
$
_tag
`
:
Any
=
other
.
_tag
if
(
`
this
$
_tag
`
!=
`
other
$
_tag
`
)
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontVariationAxis
)
return
false
if
(
this
.
_tag
!=
other
.
_tag
)
return
false
if
(
minValue
.
compareTo
(
other
.
minValue
)
!=
0
)
return
false
if
(
defaultValue
.
compareTo
(
other
.
defaultValue
)
!=
0
)
return
false
if
(
maxValue
.
compareTo
(
other
.
maxValue
)
!=
0
)
return
false
return
isHidden
==
other
.
isHidden
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontVariationAxis
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_tag
`
:
Any
=
_tag
result
=
result
*
PRIME
+
(
`$
_tag
`
.
hashCode
())
result
=
result
*
PRIME
+
_tag
.
hashCode
()
result
=
result
*
PRIME
+
minValue
.
toBits
()
result
=
result
*
PRIME
+
defaultValue
.
toBits
()
result
=
result
*
PRIME
+
maxValue
.
toBits
()
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/GradientStyle.kt
View file @
50cbeb65
...
...
@@ -14,32 +14,20 @@ class GradientStyle(
return
localMatrix
?.
mat
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
GradientStyle
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
GradientStyle
)
return
false
if
(
isPremul
!=
other
.
isPremul
)
return
false
val
`
this
$
_tileMode
`
:
Any
=
tileMode
val
`
other
$
_tileMode
`
:
Any
=
other
.
tileMode
if
(
`
this
$
_tileMode
`
!=
`
other
$
_tileMode
`
)
return
false
val
`
this
$
_localMatrix
`
:
Any
?
=
localMatrix
val
`
other
$
_localMatrix
`
:
Any
?
=
other
.
localMatrix
return
!
if
(
`
this
$
_localMatrix
`
==
null
)
`
other
$
_localMatrix
`
!=
null
else
`
this
$
_localMatrix
`
!=
`
other
$
_localMatrix
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
GradientStyle
if
(
this
.
tileMode
!=
other
.
tileMode
)
return
false
return
!
if
(
this
.
localMatrix
==
null
)
other
.
localMatrix
!=
null
else
this
.
localMatrix
!=
other
.
localMatrix
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
if
(
isPremul
)
79
else
97
val
`$
_tileMode
`
:
Any
=
tileMode
result
=
result
*
PRIME
+
(
`$
_tileMode
`
?.
hashCode
()
?:
43
)
val
`$
_localMatrix
`
:
Any
?
=
localMatrix
result
=
result
*
PRIME
+
(
`$
_localMatrix
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
tileMode
.
hashCode
()
result
=
result
*
PRIME
+
(
localMatrix
?.
hashCode
()
?:
43
)
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/IPoint.kt
View file @
50cbeb65
...
...
@@ -13,19 +13,13 @@ class IPoint(val x: Int, val y: Int) {
val
isEmpty
:
Boolean
get
()
=
x
<=
0
||
y
<=
0
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
IPoint
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
IPoint
)
return
false
if
(
x
!=
other
.
x
)
return
false
return
y
==
other
.
y
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
IPoint
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRange.kt
View file @
50cbeb65
package
org.jetbrains.skia
class
IRange
(
val
start
:
Int
,
val
end
:
Int
)
{
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
IRange
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
IRange
)
return
false
if
(
start
!=
other
.
start
)
return
false
return
end
==
other
.
end
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
IRange
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRect.kt
View file @
50cbeb65
...
...
@@ -9,10 +9,11 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
get
()
=
bottom
-
top
fun
intersect
(
other
:
IRect
):
IRect
?
{
return
if
(
right
<=
other
.
left
||
other
.
right
<=
left
||
bottom
<=
other
.
top
||
other
.
bottom
<=
top
)
null
else
IRect
(
maxOf
(
left
,
other
.
left
),
maxOf
(
top
,
other
.
top
),
minOf
(
right
,
other
.
right
),
minOf
(
bottom
,
other
.
bottom
)
return
if
(
right
<=
other
.
left
||
other
.
right
<=
left
||
bottom
<=
other
.
top
||
other
.
bottom
<=
top
)
null
else
IRect
(
maxOf
(
left
,
other
.
left
),
maxOf
(
top
,
other
.
top
),
minOf
(
right
,
other
.
right
),
minOf
(
bottom
,
other
.
bottom
)
)
}
...
...
@@ -28,21 +29,15 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
return
Rect
(
left
.
toFloat
(),
top
.
toFloat
(),
right
.
toFloat
(),
bottom
.
toFloat
())
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
IRect
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
IRect
)
return
false
if
(
left
!=
other
.
left
)
return
false
if
(
top
!=
other
.
top
)
return
false
if
(
right
!=
other
.
right
)
return
false
return
bottom
==
other
.
bottom
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
IRect
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ISize.kt
View file @
50cbeb65
...
...
@@ -15,19 +15,13 @@ class ISize internal constructor(val width: Int, val height: Int) {
return
width
*
height
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
ISize
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
ISize
)
return
false
if
(
width
!=
other
.
width
)
return
false
return
height
==
other
.
height
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
ISize
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ImageInfo.kt
View file @
50cbeb65
...
...
@@ -189,20 +189,12 @@ class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int) {
return
computeByteSize
(
minRowBytes
)
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
ImageInfo
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
ImageInfo
)
return
false
if
(
width
!=
other
.
width
)
return
false
if
(
height
!=
other
.
height
)
return
false
val
`
this
$
_colorInfo
`
:
Any
?
=
colorInfo
val
`
other
$
_colorInfo
`
:
Any
?
=
other
.
colorInfo
return
if
(
if
(
`
this
$
_colorInfo
`
==
null
)
`
other
$
_colorInfo
`
!=
null
else
`
this
$
_colorInfo
`
!=
`
other
$
_colorInfo
`
)
false
else
true
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
ImageInfo
return
this
.
colorInfo
==
other
.
colorInfo
}
override
fun
hashCode
():
Int
{
...
...
@@ -210,13 +202,12 @@ class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int) {
var
result
=
1
result
=
result
*
PRIME
+
width
result
=
result
*
PRIME
+
height
val
`$
_colorInfo
`
:
Any
?
=
colorInfo
result
=
result
*
PRIME
+
(
`$
_colorInfo
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
colorInfo
.
hashCode
()
return
result
}
override
fun
toString
():
String
{
return
"ImageInfo(_colorInfo=
"
+
colorInfo
+
", _width="
+
width
+
", _height="
+
height
+
"
)"
return
"ImageInfo(_colorInfo=
$colorInfo, _width=$width, _height=$height
)"
}
fun
withColorInfo
(
_colorInfo
:
ColorInfo
):
ImageInfo
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix33.kt
View file @
50cbeb65
...
...
@@ -114,18 +114,12 @@ class Matrix33(vararg mat: Float) {
return
Matrix44
(
mat
[
0
],
mat
[
1
],
0f
,
mat
[
2
],
mat
[
3
],
mat
[
4
],
0f
,
mat
[
5
],
0f
,
0f
,
1f
,
0f
,
mat
[
6
],
mat
[
7
],
0f
,
mat
[
8
])
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Matrix33
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Matrix33
)
return
false
return
mat
.
contentEquals
(
other
.
mat
)
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Matrix33
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix44.kt
View file @
50cbeb65
...
...
@@ -34,18 +34,12 @@ class Matrix44(vararg mat: Float) {
return
Matrix33
(
mat
[
0
],
mat
[
1
],
mat
[
3
],
mat
[
4
],
mat
[
5
],
mat
[
7
],
mat
[
12
],
mat
[
13
],
mat
[
15
])
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Matrix44
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Matrix44
)
return
false
return
mat
.
contentEquals
(
other
.
mat
)
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Matrix44
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/PathFillMode.kt
View file @
50cbeb65
...
...
@@ -34,7 +34,6 @@ enum class PathFillMode {
EVEN_ODD
->
INVERSE_EVEN_ODD
INVERSE_WINDING
->
WINDING
INVERSE_EVEN_ODD
->
EVEN_ODD
else
->
throw
RuntimeException
(
"Unreachable"
)
}
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/PathSegment.kt
View file @
50cbeb65
...
...
@@ -30,8 +30,7 @@ class PathSegment constructor(
0.0f
,
isCloseLine
,
isClosedContour
)
{
}
)
constructor
(
x0
:
Float
,
y0
:
Float
,
x1
:
Float
,
y1
:
Float
,
x2
:
Float
,
y2
:
Float
,
isClosedContour
:
Boolean
)
:
this
(
PathVerb
.
QUAD
,
...
...
@@ -42,8 +41,7 @@ class PathSegment constructor(
0.0f
,
false
,
isClosedContour
)
{
}
)
constructor
(
x0
:
Float
,
...
...
@@ -63,8 +61,7 @@ class PathSegment constructor(
conicWeight
,
false
,
isClosedContour
)
{
}
)
constructor
(
x0
:
Float
,
...
...
@@ -85,25 +82,23 @@ class PathSegment constructor(
0.0f
,
false
,
isClosedContour
)
{
}
)
override
fun
toString
():
String
{
return
"Segment("
+
"verb="
+
verb
+
(
if
(
verb
!=
PathVerb
.
DONE
)
", p0=$p0"
else
""
)
+
(
if
(
verb
==
PathVerb
.
LINE
||
verb
==
PathVerb
.
QUAD
||
verb
==
PathVerb
.
CONIC
||
verb
==
PathVerb
.
CUBIC
)
", p1="
+
p1
else
""
)
+
(
if
(
verb
==
PathVerb
.
QUAD
||
verb
==
PathVerb
.
CONIC
||
verb
==
PathVerb
.
CUBIC
)
", p2="
+
p2
else
""
)
+
(
if
(
verb
==
PathVerb
.
CUBIC
)
", p3="
+
p3
else
""
)
+
(
if
(
verb
==
PathVerb
.
CONIC
)
", conicWeight="
+
conicWeight
else
""
)
+
(
if
(
verb
==
PathVerb
.
LINE
)
", closeLine="
+
isCloseLine
else
""
)
+
(
if
(
verb
!=
PathVerb
.
DONE
)
", closedContour="
+
isClosedContour
else
""
)
+
")"
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
this
===
o
)
return
true
if
(
o
==
null
||
o
!
is
PathSegment
)
return
false
val
segment
=
o
return
verb
==
segment
.
verb
&&
(
if
(
verb
!=
PathVerb
.
DONE
)
p0
==
segment
.
p0
else
true
)
&&
(
if
(
verb
==
PathVerb
.
LINE
||
verb
==
PathVerb
.
QUAD
||
verb
==
PathVerb
.
CONIC
||
verb
==
PathVerb
.
CUBIC
)
p1
==
segment
.
p1
else
true
)
&&
(
if
(
verb
==
PathVerb
.
QUAD
||
verb
==
PathVerb
.
CONIC
||
verb
==
PathVerb
.
CUBIC
)
p2
==
segment
.
p2
else
true
)
&&
(
if
(
verb
==
PathVerb
.
CUBIC
)
p3
==
segment
.
p3
else
true
)
&&
(
if
(
verb
==
PathVerb
.
CONIC
)
segment
.
conicWeight
.
compareTo
(
conicWeight
)
==
0
else
true
)
&&
(
if
(
verb
==
PathVerb
.
LINE
)
isCloseLine
==
segment
.
isCloseLine
else
true
)
&&
if
(
verb
!=
PathVerb
.
DONE
)
isClosedContour
==
segment
.
isClosedContour
else
true
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
this
===
other
)
return
true
if
(
other
!
is
PathSegment
)
return
false
return
verb
==
other
.
verb
&&
(
if
(
verb
!=
PathVerb
.
DONE
)
p0
==
other
.
p0
else
true
)
&&
(
if
(
verb
==
PathVerb
.
LINE
||
verb
==
PathVerb
.
QUAD
||
verb
==
PathVerb
.
CONIC
||
verb
==
PathVerb
.
CUBIC
)
p1
==
other
.
p1
else
true
)
&&
(
if
(
verb
==
PathVerb
.
QUAD
||
verb
==
PathVerb
.
CONIC
||
verb
==
PathVerb
.
CUBIC
)
p2
==
other
.
p2
else
true
)
&&
(
if
(
verb
==
PathVerb
.
CUBIC
)
p3
==
other
.
p3
else
true
)
&&
(
if
(
verb
==
PathVerb
.
CONIC
)
other
.
conicWeight
.
compareTo
(
conicWeight
)
==
0
else
true
)
&&
(
if
(
verb
==
PathVerb
.
LINE
)
isCloseLine
==
other
.
isCloseLine
else
true
)
&&
if
(
verb
!=
PathVerb
.
DONE
)
isClosedContour
==
other
.
isClosedContour
else
true
}
override
fun
hashCode
():
Int
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Point.kt
View file @
50cbeb65
...
...
@@ -21,17 +21,11 @@ class Point(val x: Float, val y: Float) {
val
isEmpty
:
Boolean
get
()
=
x
<=
0
||
y
<=
0
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Point
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Point
)
return
false
if
(
x
.
compareTo
(
other
.
x
)
!=
0
)
return
false
return
if
(
y
.
compareTo
(
other
.
y
)
!=
0
)
false
else
true
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Point
return
y
.
compareTo
(
other
.
y
)
==
0
}
override
fun
hashCode
():
Int
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Point3.kt
View file @
50cbeb65
package
org.jetbrains.skia
class
Point3
(
val
x
:
Float
,
val
y
:
Float
,
val
z
:
Float
)
{
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Point3
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Point3
)
return
false
if
(
x
.
compareTo
(
other
.
x
)
!=
0
)
return
false
if
(
y
.
compareTo
(
other
.
y
)
!=
0
)
return
false
return
z
.
compareTo
(
other
.
z
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Point3
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/RRect.kt
View file @
50cbeb65
...
...
@@ -35,19 +35,13 @@ class RRect internal constructor(l: Float, t: Float, r: Float, b: Float, val rad
return
"RRect(_left=$left, _top=$top, _right=$right, _bottom=$bottom, _radii=$radii)"
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
RRect
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(!
super
.
equals
(
o
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
RRect
)
return
false
if
(!
super
.
equals
(
other
))
return
false
return
radii
.
contentEquals
(
other
.
radii
)
}
override
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
RRect
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
super
.
hashCode
()
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/RSXform.kt
View file @
50cbeb65
...
...
@@ -18,20 +18,15 @@ class RSXform(
internal
val
ty
:
Float
)
{
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
RSXform
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
RSXform
)
return
false
if
(
scos
.
compareTo
(
other
.
scos
)
!=
0
)
return
false
if
(
ssin
.
compareTo
(
other
.
ssin
)
!=
0
)
return
false
if
(
tx
.
compareTo
(
other
.
tx
)
!=
0
)
return
false
return
ty
.
compareTo
(
other
.
ty
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
RSXform
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/Rect.kt
View file @
50cbeb65
...
...
@@ -54,21 +54,15 @@ open class Rect constructor(val left: Float, val top: Float, val right: Float, v
val
isEmpty
:
Boolean
get
()
=
right
==
left
||
top
==
bottom
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Rect
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Rect
)
return
false
if
(
left
.
compareTo
(
other
.
left
)
!=
0
)
return
false
if
(
top
.
compareTo
(
other
.
top
)
!=
0
)
return
false
if
(
right
.
compareTo
(
other
.
right
)
!=
0
)
return
false
return
bottom
.
compareTo
(
other
.
bottom
)
==
0
}
protected
open
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Rect
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/SurfaceProps.kt
View file @
50cbeb65
...
...
@@ -4,38 +4,24 @@ class SurfaceProps constructor(
internal
val
isDeviceIndependentFonts
:
Boolean
=
false
,
internal
val
pixelGeometry
:
PixelGeometry
=
PixelGeometry
.
UNKNOWN
)
{
constructor
(
geo
:
PixelGeometry
)
:
this
(
false
,
geo
)
{}
constructor
(
geo
:
PixelGeometry
)
:
this
(
false
,
geo
)
fun
_getFlags
():
Int
{
return
0
or
if
(
isDeviceIndependentFonts
)
1
else
0
}
private
fun
_getPixelGeometryOrdinal
():
Int
{
return
pixelGeometry
.
ordinal
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
SurfaceProps
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
SurfaceProps
)
return
false
if
(
isDeviceIndependentFonts
!=
other
.
isDeviceIndependentFonts
)
return
false
val
`
this
$
_pixelGeometry
`
:
Any
=
pixelGeometry
val
`
other
$
_pixelGeometry
`
:
Any
=
other
.
pixelGeometry
return
`
this
$
_pixelGeometry
`
==
`
other
$
_pixelGeometry
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
SurfaceProps
return
this
.
pixelGeometry
==
other
.
pixelGeometry
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
if
(
isDeviceIndependentFonts
)
79
else
97
val
`$
_pixelGeometry
`
:
Any
=
pixelGeometry
result
=
result
*
PRIME
+
(
`$
_pixelGeometry
`
.
hashCode
())
result
=
result
*
PRIME
+
pixelGeometry
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/TextBlob.kt
View file @
50cbeb65
...
...
@@ -3,55 +3,6 @@ package org.jetbrains.skia
import
org.jetbrains.skia.impl.*
import
org.jetbrains.skia.impl.Library.Companion.staticLoad
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetFinalizer"
)
private
external
fun
TextBlob_nGetFinalizer
():
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetUniqueId"
)
private
external
fun
TextBlob_nGetUniqueId
(
ptr
:
NativePointer
):
Int
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nSerializeToData"
)
private
external
fun
TextBlob_nSerializeToData
(
ptr
:
NativePointer
/*, SkSerialProcs */
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromData"
)
private
external
fun
TextBlob_nMakeFromData
(
dataPtr
:
NativePointer
/*, SkDeserialProcs */
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nBounds"
)
private
external
fun
_nBounds
(
ptr
:
NativePointer
):
Rect
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetIntercepts"
)
private
external
fun
_nGetIntercepts
(
ptr
:
NativePointer
,
lower
:
Float
,
upper
:
Float
,
paintPtr
:
NativePointer
):
FloatArray
?
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromPosH"
)
private
external
fun
_nMakeFromPosH
(
glyphs
:
InteropPointer
,
xpos
:
InteropPointer
,
ypos
:
Float
,
fontPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromPos"
)
private
external
fun
_nMakeFromPos
(
glyphs
:
InteropPointer
,
pos
:
InteropPointer
,
fontPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromRSXform"
)
private
external
fun
_nMakeFromRSXform
(
glyphs
:
InteropPointer
,
xform
:
InteropPointer
,
fontPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetGlyphs"
)
private
external
fun
_nGetGlyphs
(
ptr
:
NativePointer
):
ShortArray
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetPositions"
)
private
external
fun
_nGetPositions
(
ptr
:
NativePointer
):
FloatArray
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetClusters"
)
private
external
fun
_nGetClusters
(
ptr
:
NativePointer
):
IntArray
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetTightBounds"
)
private
external
fun
_nGetTightBounds
(
ptr
:
NativePointer
):
Rect
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetBlockBounds"
)
private
external
fun
_nGetBlockBounds
(
ptr
:
NativePointer
):
Rect
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetFirstBaseline"
)
private
external
fun
_nGetFirstBaseline
(
ptr
:
NativePointer
):
Float
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetLastBaseline"
)
private
external
fun
_nGetLastBaseline
(
ptr
:
NativePointer
):
Float
class
TextBlob
internal
constructor
(
ptr
:
NativePointer
)
:
Managed
(
ptr
,
_FinalizerHolder
.
PTR
)
{
companion
object
{
/**
...
...
@@ -346,3 +297,51 @@ class TextBlob internal constructor(ptr: NativePointer) : Managed(ptr, _Finalize
val
PTR
=
TextBlob_nGetFinalizer
()
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetFinalizer"
)
private
external
fun
TextBlob_nGetFinalizer
():
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetUniqueId"
)
private
external
fun
TextBlob_nGetUniqueId
(
ptr
:
NativePointer
):
Int
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nSerializeToData"
)
private
external
fun
TextBlob_nSerializeToData
(
ptr
:
NativePointer
/*, SkSerialProcs */
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromData"
)
private
external
fun
TextBlob_nMakeFromData
(
dataPtr
:
NativePointer
/*, SkDeserialProcs */
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nBounds"
)
private
external
fun
_nBounds
(
ptr
:
NativePointer
):
Rect
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetIntercepts"
)
private
external
fun
_nGetIntercepts
(
ptr
:
NativePointer
,
lower
:
Float
,
upper
:
Float
,
paintPtr
:
NativePointer
):
FloatArray
?
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromPosH"
)
private
external
fun
_nMakeFromPosH
(
glyphs
:
InteropPointer
,
xpos
:
InteropPointer
,
ypos
:
Float
,
fontPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromPos"
)
private
external
fun
_nMakeFromPos
(
glyphs
:
InteropPointer
,
pos
:
InteropPointer
,
fontPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nMakeFromRSXform"
)
private
external
fun
_nMakeFromRSXform
(
glyphs
:
InteropPointer
,
xform
:
InteropPointer
,
fontPtr
:
NativePointer
):
NativePointer
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetGlyphs"
)
private
external
fun
_nGetGlyphs
(
ptr
:
NativePointer
):
ShortArray
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetPositions"
)
private
external
fun
_nGetPositions
(
ptr
:
NativePointer
):
FloatArray
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetClusters"
)
private
external
fun
_nGetClusters
(
ptr
:
NativePointer
):
IntArray
?
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetTightBounds"
)
private
external
fun
_nGetTightBounds
(
ptr
:
NativePointer
):
Rect
?
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetBlockBounds"
)
private
external
fun
_nGetBlockBounds
(
ptr
:
NativePointer
):
Rect
?
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetFirstBaseline"
)
private
external
fun
_nGetFirstBaseline
(
ptr
:
NativePointer
):
Float
?
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlob__1nGetLastBaseline"
)
private
external
fun
_nGetLastBaseline
(
ptr
:
NativePointer
):
Float
?
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/DecorationStyle.kt
View file @
50cbeb65
...
...
@@ -50,24 +50,16 @@ class DecorationStyle(
val
lineStyle
:
DecorationLineStyle
get
()
=
_lineStyle
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
DecorationStyle
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
DecorationStyle
)
return
false
if
(
_underline
!=
other
.
_underline
)
return
false
if
(
_overline
!=
other
.
_overline
)
return
false
if
(
_lineThrough
!=
other
.
_lineThrough
)
return
false
if
(
_gaps
!=
other
.
_gaps
)
return
false
if
(
color
!=
other
.
color
)
return
false
if
(
thicknessMultiplier
.
compareTo
(
other
.
thicknessMultiplier
)
!=
0
)
return
false
val
`
this
$
_lineStyle
`
:
Any
=
lineStyle
val
`
other
$
_lineStyle
`
:
Any
=
other
.
lineStyle
return
`
this
$
_lineStyle
`
==
`
other
$
_lineStyle
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
DecorationStyle
return
this
.
lineStyle
==
other
.
lineStyle
}
override
fun
hashCode
():
Int
{
...
...
@@ -79,8 +71,7 @@ class DecorationStyle(
result
=
result
*
PRIME
+
if
(
_gaps
)
79
else
97
result
=
result
*
PRIME
+
color
result
=
result
*
PRIME
+
thicknessMultiplier
.
toBits
()
val
`$
_lineStyle
`
:
Any
=
lineStyle
result
=
result
*
PRIME
+
(
`$
_lineStyle
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
lineStyle
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/FontCollection.kt
View file @
50cbeb65
...
...
@@ -135,7 +135,6 @@ class FontCollection internal constructor(ptr: NativePointer) : RefCnt(ptr) {
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_paragraph_FontCollection__1nMake"
)
private
external
fun
_nMake
():
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/LineMetrics.kt
View file @
50cbeb65
...
...
@@ -97,11 +97,9 @@ class LineMetrics(
val
right
:
Double
get
()
=
left
+
width
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
LineMetrics
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
LineMetrics
)
return
false
if
(
startIndex
!=
other
.
startIndex
)
return
false
if
(
endIndex
!=
other
.
endIndex
)
return
false
if
(
endExcludingWhitespaces
!=
other
.
endExcludingWhitespaces
)
return
false
...
...
@@ -117,38 +115,22 @@ class LineMetrics(
return
lineNumber
==
other
.
lineNumber
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
LineMetrics
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_startIndex
`
=
startIndex
result
=
result
*
PRIME
+
(
`$
_startIndex
`
ushr
32
xor
`$
_startIndex
`
).
toInt
()
val
`$
_endIndex
`
=
endIndex
result
=
result
*
PRIME
+
(
`$
_endIndex
`
ushr
32
xor
`$
_endIndex
`
).
toInt
()
val
`$
_endExcludingWhitespaces
`
=
endExcludingWhitespaces
result
=
result
*
PRIME
+
(
`$
_endExcludingWhitespaces
`
ushr
32
xor
`$
_endExcludingWhitespaces
`
).
toInt
()
val
`$
_endIncludingNewline
`
=
endIncludingNewline
result
=
result
*
PRIME
+
(
`$
_endIncludingNewline
`
ushr
32
xor
`$
_endIncludingNewline
`
).
toInt
()
result
=
result
*
PRIME
+
startIndex
result
=
result
*
PRIME
+
endIndex
result
=
result
*
PRIME
+
endExcludingWhitespaces
result
=
result
*
PRIME
+
endIncludingNewline
result
=
result
*
PRIME
+
if
(
isHardBreak
)
79
else
97
val
`$
_ascent
`
=
ascent
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_ascent
`
ushr
32
xor
`$
_ascent
`
).
toInt
()
val
`$
_descent
`
=
descent
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_descent
`
ushr
32
xor
`$
_descent
`
).
toInt
()
val
`$
_unscaledAscent
`
=
unscaledAscent
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_unscaledAscent
`
ushr
32
xor
`$
_unscaledAscent
`
).
toInt
()
val
`$
_height
`
=
height
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_height
`
ushr
32
xor
`$
_height
`
).
toInt
()
val
`$
_width
`
=
width
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_width
`
ushr
32
xor
`$
_width
`
).
toInt
()
val
`$
_left
`
=
left
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_left
`
ushr
32
xor
`$
_left
`
).
toInt
()
val
`$
_baseline
`
=
baseline
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_baseline
`
ushr
32
xor
`$
_baseline
`
).
toInt
()
val
`$
_lineNumber
`
=
lineNumber
result
=
result
*
PRIME
+
(
`$
_lineNumber
`
ushr
32
xor
`$
_lineNumber
`
).
toInt
()
result
=
result
*
PRIME
+
ascent
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
descent
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
unscaledAscent
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
height
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
width
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
left
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
baseline
.
toBits
().
toInt
()
result
=
result
*
PRIME
+
lineNumber
return
result
}
...
...
@@ -158,7 +140,7 @@ class LineMetrics(
override
fun
getArrayElement
(
array
:
InteropPointer
,
index
:
Int
):
LineMetrics
{
val
intArray
=
IntArray
(
6
)
val
doubleArray
=
DoubleArray
(
7
)
val
result
=
interopScope
{
interopScope
{
LineMetrics_nGetArrayElement
(
array
,
index
,
toInterop
(
intArray
),
toInterop
(
doubleArray
))
}
return
LineMetrics
(
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/ParagraphBuilder.kt
View file @
50cbeb65
...
...
@@ -109,7 +109,6 @@ private external fun _nAddPlaceholder(
baseline
:
Float
)
@ExternalSymbolName
(
"org_jetbrains_skia_paragraph_ParagraphBuilder__1nSetParagraphStyle"
)
private
external
fun
_nSetParagraphStyle
(
ptr
:
NativePointer
,
stylePtr
:
NativePointer
)
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/ParagraphStyle.kt
View file @
50cbeb65
...
...
@@ -173,7 +173,6 @@ class ParagraphStyle : Managed(ParagraphStyle_nMake(), _FinalizerHolder.PTR) {
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_paragraph_ParagraphStyle__1nGetFinalizer"
)
private
external
fun
ParagraphStyle_nGetFinalizer
():
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/PlaceholderStyle.kt
View file @
50cbeb65
...
...
@@ -39,24 +39,14 @@ class PlaceholderStyle(
val
baselineMode
:
BaselineMode
get
()
=
_baselineMode
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
PlaceholderStyle
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
PlaceholderStyle
)
return
false
if
(
width
.
compareTo
(
other
.
width
)
!=
0
)
return
false
if
(
height
.
compareTo
(
other
.
height
)
!=
0
)
return
false
if
(
baseline
.
compareTo
(
other
.
baseline
)
!=
0
)
return
false
val
`
this
$
_alignment
`
:
Any
=
alignment
val
`
other
$
_alignment
`
:
Any
=
other
.
alignment
if
(
`
this
$
_alignment
`
!=
`
other
$
_alignment
`
)
return
false
val
`
this
$
_baselineMode
`
:
Any
=
baselineMode
val
`
other
$
_baselineMode
`
:
Any
=
other
.
baselineMode
return
`
this
$
_baselineMode
`
==
`
other
$
_baselineMode
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
PlaceholderStyle
if
(
this
.
alignment
!=
other
.
alignment
)
return
false
return
this
.
baselineMode
==
other
.
baselineMode
}
override
fun
hashCode
():
Int
{
...
...
@@ -65,10 +55,8 @@ class PlaceholderStyle(
result
=
result
*
PRIME
+
width
.
toBits
()
result
=
result
*
PRIME
+
height
.
toBits
()
result
=
result
*
PRIME
+
baseline
.
toBits
()
val
`$
_alignment
`
:
Any
=
alignment
result
=
result
*
PRIME
+
(
`$
_alignment
`
.
hashCode
())
val
`$
_baselineMode
`
:
Any
=
baselineMode
result
=
result
*
PRIME
+
(
`$
_baselineMode
`
.
hashCode
())
result
=
result
*
PRIME
+
alignment
.
hashCode
()
result
=
result
*
PRIME
+
baselineMode
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
View file @
50cbeb65
...
...
@@ -5,27 +5,18 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
val
affinity
:
Affinity
get
()
=
_affinity
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
PositionWithAffinity
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
PositionWithAffinity
)
return
false
if
(
position
!=
other
.
position
)
return
false
val
`
this
$
_affinity
`
:
Any
=
affinity
val
`
other
$
_affinity
`
:
Any
=
other
.
affinity
return
`
this
$
_affinity
`
==
`
other
$
_affinity
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
PositionWithAffinity
return
this
.
affinity
==
other
.
affinity
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
position
val
`$
_affinity
`
:
Any
=
affinity
result
=
result
*
PRIME
+
`$
_affinity
`
.
hashCode
()
result
=
result
*
PRIME
+
affinity
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/Shadow.kt
View file @
50cbeb65
...
...
@@ -4,34 +4,28 @@ import org.jetbrains.skia.Point
class
Shadow
(
val
color
:
Int
,
val
offsetX
:
Float
,
val
offsetY
:
Float
,
val
blurSigma
:
Double
)
{
constructor
(
color
:
Int
,
offset
:
Point
,
blurSigma
:
Double
)
:
this
(
color
,
offset
.
x
,
offset
.
y
,
blurSigma
)
{}
constructor
(
color
:
Int
,
offset
:
Point
,
blurSigma
:
Double
)
:
this
(
color
,
offset
.
x
,
offset
.
y
,
blurSigma
)
val
offset
:
Point
get
()
=
Point
(
offsetX
,
offsetY
)
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
Shadow
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
Shadow
)
return
false
if
(
color
!=
other
.
color
)
return
false
if
(
offsetX
.
compareTo
(
other
.
offsetX
)
!=
0
)
return
false
if
(
offsetY
.
compareTo
(
other
.
offsetY
)
!=
0
)
return
false
return
blurSigma
.
compareTo
(
other
.
blurSigma
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
Shadow
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
color
result
=
result
*
PRIME
+
offsetX
.
toBits
()
result
=
result
*
PRIME
+
offsetY
.
toBits
()
val
`$
_blurSigma
`
=
blurSigma
.
toBits
()
result
=
result
*
PRIME
+
(
`$
_blurSigma
`
ushr
32
xor
`$
_blurSigma
`
).
toInt
()
val
blurSigma
=
blurSigma
.
toBits
()
result
=
result
*
PRIME
+
(
blurSigma
ushr
32
xor
blurSigma
).
toInt
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/TextBox.kt
View file @
50cbeb65
...
...
@@ -14,35 +14,23 @@ class TextBox(val rect: Rect, direction: Direction) {
val
direction
:
Direction
get
()
=
_direction
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
TextBox
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
val
`
this
$
_rect
`
:
Any
=
rect
val
`
other
$
_rect
`
:
Any
=
other
.
rect
if
(
if
(
`
this
$
_rect
`
==
null
)
`
other
$
_rect
`
!=
null
else
`
this
$
_rect
`
!=
`
other
$
_rect
`
)
return
false
val
`
this
$
_direction
`
:
Any
=
direction
val
`
other
$
_direction
`
:
Any
=
other
.
direction
return
!
if
(
`
this
$
_direction
`
==
null
)
true
else
`
this
$
_direction
`
!=
`
other
$
_direction
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
TextBox
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
TextBox
)
return
false
if
(
this
.
rect
!=
other
.
rect
)
return
false
return
this
.
direction
==
other
.
direction
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_rect
`
:
Any
=
rect
result
=
result
*
PRIME
+
(
`$
_rect
`
?.
hashCode
()
?:
43
)
val
`$
_direction
`
:
Any
=
direction
result
=
result
*
PRIME
+
(
`$
_direction
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
rect
.
hashCode
()
result
=
result
*
PRIME
+
direction
.
hashCode
()
return
result
}
override
fun
toString
():
String
{
return
"TextBox(_rect=
"
+
rect
+
", _direction="
+
direction
+
"
)"
return
"TextBox(_rect=
$rect, _direction=$direction
)"
}
init
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/BidiRun.kt
View file @
50cbeb65
...
...
@@ -10,19 +10,13 @@ class BidiRun(
/**
* The unicode bidi embedding level (even ltr, odd rtl)
*/
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
BidiRun
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
BidiRun
)
return
false
if
(
end
!=
other
.
end
)
return
false
return
level
==
other
.
level
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
BidiRun
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/FontMgrRunIterator.kt
View file @
50cbeb65
...
...
@@ -19,8 +19,8 @@ class FontMgrRunIterator(text: ManagedString?, manageText: Boolean, font: Font?,
}
}
constructor
(
text
:
String
?,
font
:
Font
?,
opts
:
ShapingOptions
)
:
this
(
ManagedString
(
text
),
true
,
font
,
opts
)
{}
constructor
(
text
:
String
?,
font
:
Font
?)
:
this
(
ManagedString
(
text
),
true
,
font
,
ShapingOptions
.
DEFAULT
)
{}
constructor
(
text
:
String
?,
font
:
Font
?,
opts
:
ShapingOptions
)
:
this
(
ManagedString
(
text
),
true
,
font
,
opts
)
constructor
(
text
:
String
?,
font
:
Font
?)
:
this
(
ManagedString
(
text
),
true
,
font
,
ShapingOptions
.
DEFAULT
)
override
operator
fun
next
():
FontRun
{
return
try
{
...
...
@@ -43,7 +43,6 @@ class FontMgrRunIterator(text: ManagedString?, manageText: Boolean, font: Font?,
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_FontMgrRunIterator__1nMake"
)
private
external
fun
_nMake
(
textPtr
:
NativePointer
,
fontPtr
:
NativePointer
,
opts
:
ShapingOptions
?):
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/FontRun.kt
View file @
50cbeb65
...
...
@@ -15,27 +15,18 @@ class FontRun(internal val end: Int, internal val font: Font) {
}
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
FontRun
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
FontRun
)
return
false
if
(
end
!=
other
.
end
)
return
false
val
`
this
$
_font
`
:
Any
=
font
val
`
other
$
_font
`
:
Any
=
other
.
font
return
`
this
$
_font
`
==
`
other
$
_font
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
FontRun
return
this
.
font
==
other
.
font
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
end
val
`$
_font
`
:
Any
=
font
result
=
result
*
PRIME
+
`$
_font
`
.
hashCode
()
result
=
result
*
PRIME
+
font
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/HbIcuScriptRunIterator.kt
View file @
50cbeb65
...
...
@@ -20,7 +20,7 @@ class HbIcuScriptRunIterator(text: ManagedString?, manageText: Boolean) : Manage
}
}
constructor
(
text
:
String
?)
:
this
(
ManagedString
(
text
),
true
)
{}
constructor
(
text
:
String
?)
:
this
(
ManagedString
(
text
),
true
)
override
operator
fun
next
():
ScriptRun
{
return
try
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/IcuBidiRunIterator.kt
View file @
50cbeb65
...
...
@@ -39,7 +39,6 @@ class IcuBidiRunIterator(text: ManagedString?, manageText: Boolean, bidiLevel: I
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_IcuBidiRunIterator__1nMake"
)
private
external
fun
_nMake
(
textPtr
:
NativePointer
,
bidiLevel
:
Int
):
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/LanguageRun.kt
View file @
50cbeb65
...
...
@@ -10,27 +10,18 @@ class LanguageRun(
/**
* Should be BCP-47, c locale names may also work.
*/
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
LanguageRun
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
LanguageRun
)
return
false
if
(
end
!=
other
.
end
)
return
false
val
`
this
$
_language
`
:
Any
=
language
val
`
other
$
_language
`
:
Any
=
other
.
language
return
`
this
$
_language
`
==
`
other
$
_language
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
LanguageRun
return
this
.
language
==
other
.
language
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
end
val
`$
_language
`
:
Any
=
language
result
=
result
*
PRIME
+
`$
_language
`
.
hashCode
()
result
=
result
*
PRIME
+
language
.
hashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/RunInfo.kt
View file @
50cbeb65
...
...
@@ -40,11 +40,9 @@ class RunInfo(
return
this
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
RunInfo
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
RunInfo
)
return
false
if
(
_fontPtr
!=
other
.
_fontPtr
)
return
false
if
(
bidiLevel
!=
other
.
bidiLevel
)
return
false
if
(
advanceX
.
compareTo
(
other
.
advanceX
)
!=
0
)
return
false
...
...
@@ -54,21 +52,15 @@ class RunInfo(
return
rangeSize
==
other
.
rangeSize
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
RunInfo
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
val
`$
_fontPtr
`
=
_fontPtr
// TODO("Shagen: COMMENT OUT BEFORE ANY ACTUAL USAGE")
//result = result * PRIME + (
`$_fontPtr` ushr 32 xor `$_fontPtr`
).toInt()
//result = result * PRIME + (
fontPtr ushr 32 xor fontPtr
).toInt()
result
=
result
*
PRIME
+
bidiLevel
result
=
result
*
PRIME
+
advanceX
.
toBits
()
result
=
result
*
PRIME
+
advanceY
.
toBits
()
val
`$
_glyphCount
`
=
glyphCount
//result = result * PRIME + (`$_glyphCount` ushr 32 xor `$_glyphCount`).toInt()
//result = result * PRIME + (glyphCount ushr 32 xor glyphCount).toInt()
result
=
result
*
PRIME
+
rangeBegin
result
=
result
*
PRIME
+
rangeSize
return
result
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/ScriptRun.kt
View file @
50cbeb65
...
...
@@ -12,19 +12,13 @@ class ScriptRun(internal val end: Int, internal val scriptTag: Int) {
val
script
:
String
get
()
=
FourByteTag
.
toString
(
scriptTag
)
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
ScriptRun
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
ScriptRun
)
return
false
if
(
end
!=
other
.
end
)
return
false
return
scriptTag
==
other
.
scriptTag
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
ScriptRun
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/ShapingOptions.kt
View file @
50cbeb65
...
...
@@ -35,32 +35,23 @@ class ShapingOptions(
)
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
ShapingOptions
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
ShapingOptions
)
return
false
if
(
isLeftToRight
!=
other
.
isLeftToRight
)
return
false
if
(
isApproximateSpaces
!=
other
.
isApproximateSpaces
)
return
false
if
(
isApproximatePunctuation
!=
other
.
isApproximatePunctuation
)
return
false
val
`
this
$
_fontMgr
`
:
Any
?
=
fontMgr
val
`
other
$
_fontMgr
`
:
Any
?
=
other
.
fontMgr
if
(
if
(
`
this
$
_fontMgr
`
==
null
)
`
other
$
_fontMgr
`
!=
null
else
`
this
$
_fontMgr
`
!=
`
other
$
_fontMgr
`
)
return
false
if
(
if
(
this
.
fontMgr
==
null
)
other
.
fontMgr
!=
null
else
this
.
fontMgr
!=
other
.
fontMgr
)
return
false
return
features
.
contentDeepEquals
(
other
.
features
)
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
ShapingOptions
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
result
=
result
*
PRIME
+
if
(
isLeftToRight
)
79
else
97
result
=
result
*
PRIME
+
if
(
isApproximateSpaces
)
79
else
97
result
=
result
*
PRIME
+
if
(
isApproximatePunctuation
)
79
else
97
val
`$
_fontMgr
`
:
Any
?
=
fontMgr
result
=
result
*
PRIME
+
(
`$
_fontMgr
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
fontMgr
.
hashCode
()
result
=
result
*
PRIME
+
features
.
contentDeepHashCode
()
return
result
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/TextBlobBuilderRunHandler.kt
View file @
50cbeb65
...
...
@@ -26,8 +26,8 @@ class TextBlobBuilderRunHandler<T> internal constructor(
internal
val
_text
:
ManagedString
?
constructor
(
text
:
String
?)
:
this
(
ManagedString
(
text
),
true
,
0f
,
0f
)
{}
constructor
(
text
:
String
?,
offset
:
Point
)
:
this
(
ManagedString
(
text
),
true
,
offset
.
x
,
offset
.
y
)
{}
constructor
(
text
:
String
?)
:
this
(
ManagedString
(
text
),
true
,
0f
,
0f
)
constructor
(
text
:
String
?,
offset
:
Point
)
:
this
(
ManagedString
(
text
),
true
,
offset
.
x
,
offset
.
y
)
override
fun
close
()
{
super
.
close
()
...
...
@@ -78,7 +78,6 @@ class TextBlobBuilderRunHandler<T> internal constructor(
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_TextBlobBuilderRunHandler__1nGetFinalizer"
)
private
external
fun
TextBlobBuilderRunHandler_nGetFinalizer
():
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/skottie/AnimationBuilder.kt
View file @
50cbeb65
...
...
@@ -95,7 +95,6 @@ class AnimationBuilder internal constructor(ptr: NativePointer) : Managed(ptr, _
}
}
@ExternalSymbolName
(
"org_jetbrains_skia_skottie_AnimationBuilder__1nGetFinalizer"
)
private
external
fun
AnimationBuilder_nGetFinalizer
():
NativePointer
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGLengthContext.kt
View file @
50cbeb65
...
...
@@ -45,20 +45,14 @@ class SVGLengthContext constructor(
)
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
SVGLengthContext
)
return
false
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
override
fun
equals
(
other
:
Any
?):
Boolean
{
if
(
other
===
this
)
return
true
if
(
other
!
is
SVGLengthContext
)
return
false
if
(
width
.
compareTo
(
other
.
width
)
!=
0
)
return
false
if
(
height
.
compareTo
(
other
.
height
)
!=
0
)
return
false
return
dpi
.
compareTo
(
other
.
dpi
)
==
0
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
SVGLengthContext
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGPreserveAspectRatio.kt
View file @
50cbeb65
...
...
@@ -26,10 +26,6 @@ class SVGPreserveAspectRatio(align: SVGPreserveAspectRatioAlign, scale: SVGPrese
return
scale
==
other
.
scale
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
return
other
is
SVGPreserveAspectRatio
}
override
fun
hashCode
():
Int
{
val
PRIME
=
59
var
result
=
1
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skia/impl/Native.jvm.kt
View file @
50cbeb65
...
...
@@ -75,7 +75,8 @@ actual open class InteropScope actual constructor() {
actual
fun
toInterop
(
stringArray
:
Array
<
String
>?):
InteropPointer
=
stringArray
actual
fun
InteropPointer
.
fromInteropNativePointerArray
():
NativePointerArray
=
NativePointerArray
((
this
as
LongArray
).
size
,
this
)
actual
inline
fun
<
reified
T
>
InteropPointer
.
fromInterop
(
decoder
:
ArrayInteropDecoder
<
T
>):
Array
<
T
>
=
this
as
Array
<
T
>
actual
inline
fun
<
reified
T
>
InteropPointer
.
fromInterop
(
decoder
:
ArrayInteropDecoder
<
T
>):
Array
<
T
>
=
this
@fromInterop
as
Array
<
T
>
actual
fun
release
()
{}
}
...
...
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