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
cfdcbc63
Unverified
Commit
cfdcbc63
authored
Sep 14, 2021
by
Nikolay Igotti
Committed by
GitHub
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Less internals, cleanup. (#187)
parent
023a1695
Changes
46
Show whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
150 additions
and
252 deletions
+150
-252
AnimationFrameInfo.kt
...ommonMain/kotlin/org/jetbrains/skia/AnimationFrameInfo.kt
+7
-162
BreakIterator.kt
...src/commonMain/kotlin/org/jetbrains/skia/BreakIterator.kt
+1
-1
ColorChannel.kt
.../src/commonMain/kotlin/org/jetbrains/skia/ColorChannel.kt
+4
-1
CubicResampler.kt
...rc/commonMain/kotlin/org/jetbrains/skia/CubicResampler.kt
+1
-1
EncodedImageFormat.kt
...ommonMain/kotlin/org/jetbrains/skia/EncodedImageFormat.kt
+12
-1
FontMetrics.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/FontMetrics.kt
+1
-1
FontSlant.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontSlant.kt
+3
-1
FontVariationAxis.kt
...commonMain/kotlin/org/jetbrains/skia/FontVariationAxis.kt
+5
-5
GLBackendState.kt
...rc/commonMain/kotlin/org/jetbrains/skia/GLBackendState.kt
+10
-4
GradientStyle.kt
...src/commonMain/kotlin/org/jetbrains/skia/GradientStyle.kt
+7
-7
IPoint.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/IPoint.kt
+0
-2
IRange.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRange.kt
+1
-4
IRect.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRect.kt
+2
-2
ISize.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/ISize.kt
+2
-2
InversionMode.kt
...src/commonMain/kotlin/org/jetbrains/skia/InversionMode.kt
+3
-1
Matrix33.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix33.kt
+1
-1
Matrix44.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix44.kt
+1
-1
OutputWStream.kt
...src/commonMain/kotlin/org/jetbrains/skia/OutputWStream.kt
+1
-1
PaintMode.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/PaintMode.kt
+3
-1
PathSegment.kt
...o/src/commonMain/kotlin/org/jetbrains/skia/PathSegment.kt
+1
-3
PixelGeometry.kt
...src/commonMain/kotlin/org/jetbrains/skia/PixelGeometry.kt
+5
-1
SurfaceOrigin.kt
...src/commonMain/kotlin/org/jetbrains/skia/SurfaceOrigin.kt
+2
-1
SurfaceProps.kt
.../src/commonMain/kotlin/org/jetbrains/skia/SurfaceProps.kt
+3
-3
Affinity.kt
...ommonMain/kotlin/org/jetbrains/skia/paragraph/Affinity.kt
+2
-1
Alignment.kt
...mmonMain/kotlin/org/jetbrains/skia/paragraph/Alignment.kt
+6
-1
BaselineMode.kt
...nMain/kotlin/org/jetbrains/skia/paragraph/BaselineMode.kt
+2
-1
DecorationLineStyle.kt
...otlin/org/jetbrains/skia/paragraph/DecorationLineStyle.kt
+5
-1
Direction.kt
...mmonMain/kotlin/org/jetbrains/skia/paragraph/Direction.kt
+2
-1
HeightMode.kt
...monMain/kotlin/org/jetbrains/skia/paragraph/HeightMode.kt
+4
-1
PositionWithAffinity.kt
...tlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
+1
-1
TextBox.kt
...commonMain/kotlin/org/jetbrains/skia/paragraph/TextBox.kt
+1
-1
TextStyleAttribute.kt
...kotlin/org/jetbrains/skia/paragraph/TextStyleAttribute.kt
+10
-1
TrivialBidiRunIterator.kt
...otlin/org/jetbrains/skia/shaper/TrivialBidiRunIterator.kt
+2
-2
TrivialFontRunIterator.kt
...otlin/org/jetbrains/skia/shaper/TrivialFontRunIterator.kt
+2
-2
TrivialLanguageRunIterator.kt
...n/org/jetbrains/skia/shaper/TrivialLanguageRunIterator.kt
+2
-2
TrivialScriptRunIterator.kt
...lin/org/jetbrains/skia/shaper/TrivialScriptRunIterator.kt
+2
-2
AnimationBuilder.kt
...ain/kotlin/org/jetbrains/skia/skottie/AnimationBuilder.kt
+1
-1
AnimationBuilderFlag.kt
...kotlin/org/jetbrains/skia/skottie/AnimationBuilderFlag.kt
+1
-1
LogLevel.kt
.../commonMain/kotlin/org/jetbrains/skia/skottie/LogLevel.kt
+2
-1
RenderFlag.kt
...ommonMain/kotlin/org/jetbrains/skia/skottie/RenderFlag.kt
+1
-1
SVGLength.kt
...src/commonMain/kotlin/org/jetbrains/skia/svg/SVGLength.kt
+3
-12
SVGLengthContext.kt
...monMain/kotlin/org/jetbrains/skia/svg/SVGLengthContext.kt
+5
-5
SVGLengthType.kt
...commonMain/kotlin/org/jetbrains/skia/svg/SVGLengthType.kt
+3
-1
SVGLengthUnit.kt
...commonMain/kotlin/org/jetbrains/skia/svg/SVGLengthUnit.kt
+11
-1
SVGPreserveAspectRatioScale.kt
...lin/org/jetbrains/skia/svg/SVGPreserveAspectRatioScale.kt
+2
-1
SVGSVG.kt
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGSVG.kt
+4
-4
No files found.
skiko/src/commonMain/kotlin/org/jetbrains/skia/AnimationFrameInfo.kt
View file @
cfdcbc63
...
...
@@ -15,11 +15,11 @@ class AnimationFrameInfo(
* for blending. Any frame from [_requiredFrame, i) can be
* used, unless its getDisposalMethod() is [AnimationDisposalMode.RESTORE_PREVIOUS].
*/
internal
var
requiredFrame
:
Int
,
var
requiredFrame
:
Int
,
/**
* Number of milliseconds to show this frame.
*/
internal
var
duration
:
Int
,
var
duration
:
Int
,
/**
*
* Whether the end marker for this frame is contained in the stream.
...
...
@@ -28,13 +28,13 @@ class AnimationFrameInfo(
* Note: this does not guarantee that an attempt to decode will be complete.
* There could be an error in the stream.
*/
internal
var
isFullyReceived
:
Boolean
,
var
isFullyReceived
:
Boolean
,
/**
*
* This is conservative; it will still return non-opaque if e.g. a
* color index-based frame has a color with alpha but does not use it.
*/
internal
var
alphaType
:
ColorAlphaType
,
var
alphaType
:
ColorAlphaType
,
/**
*
* Whether the updated rectangle contains alpha.
...
...
@@ -45,17 +45,17 @@ class AnimationFrameInfo(
* addition, it may be set to true, even if the final frame, after
* blending, is opaque.
*/
internal
var
isHasAlphaWithinBounds
:
Boolean
,
var
isHasAlphaWithinBounds
:
Boolean
,
/**
*
* How this frame should be modified before decoding the next one.
*/
internal
var
disposalMethod
:
AnimationDisposalMode
,
var
disposalMethod
:
AnimationDisposalMode
,
/**
*
* How this frame should blend with the prior frame.
*/
internal
var
blendMode
:
BlendMode
,
var
blendMode
:
BlendMode
,
/**
*
* The rectangle updated by this frame.
...
...
@@ -85,161 +85,6 @@ class AnimationFrameInfo(
BlendMode
.
values
()[
blendModeOrdinal
],
frameRect
)
/**
*
* The frame that this frame needs to be blended with, or
* -1 if this frame is independent (so it can be
* drawn over an uninitialized buffer).
*
*
* Note that this is the *earliest* frame that can be used
* for blending. Any frame from [_requiredFrame, i) can be
* used, unless its getDisposalMethod() is [AnimationDisposalMode.RESTORE_PREVIOUS].
*/
/**
* Number of milliseconds to show this frame.
*/
/**
*
* Whether the end marker for this frame is contained in the stream.
*
*
* Note: this does not guarantee that an attempt to decode will be complete.
* There could be an error in the stream.
*/
/**
*
* This is conservative; it will still return non-opaque if e.g. a
* color index-based frame has a color with alpha but does not use it.
*/
/**
*
* Whether the updated rectangle contains alpha.
*
*
* This is conservative; it will still be set to true if e.g. a color
* index-based frame has a color with alpha but does not use it. In
* addition, it may be set to true, even if the final frame, after
* blending, is opaque.
*/
/**
*
* How this frame should be modified before decoding the next one.
*/
/**
*
* How this frame should blend with the prior frame.
*/
/**
*
* The rectangle updated by this frame.
*
*
* It may be empty, if the frame does not change the image. It will
* always be contained by [Codec.getSize].
*/
/**
*
* The frame that this frame needs to be blended with, or
* -1 if this frame is independent (so it can be
* drawn over an uninitialized buffer).
*
*
* Note that this is the *earliest* frame that can be used
* for blending. Any frame from [_requiredFrame, i) can be
* used, unless its getDisposalMethod() is [AnimationDisposalMode.RESTORE_PREVIOUS].
* @return `this`.
*/
fun
setRequiredFrame
(
_requiredFrame
:
Int
):
AnimationFrameInfo
{
requiredFrame
=
_requiredFrame
return
this
}
/**
* Number of milliseconds to show this frame.
* @return `this`.
*/
fun
setDuration
(
_duration
:
Int
):
AnimationFrameInfo
{
duration
=
_duration
return
this
}
/**
*
* Whether the end marker for this frame is contained in the stream.
*
*
* Note: this does not guarantee that an attempt to decode will be complete.
* There could be an error in the stream.
* @return `this`.
*/
fun
setFullyReceived
(
_fullyReceived
:
Boolean
):
AnimationFrameInfo
{
isFullyReceived
=
_fullyReceived
return
this
}
/**
*
* This is conservative; it will still return non-opaque if e.g. a
* color index-based frame has a color with alpha but does not use it.
* @return `this`.
*/
fun
setAlphaType
(
_alphaType
:
ColorAlphaType
):
AnimationFrameInfo
{
alphaType
=
_alphaType
return
this
}
/**
*
* Whether the updated rectangle contains alpha.
*
*
* This is conservative; it will still be set to true if e.g. a color
* index-based frame has a color with alpha but does not use it. In
* addition, it may be set to true, even if the final frame, after
* blending, is opaque.
* @return `this`.
*/
fun
setHasAlphaWithinBounds
(
_hasAlphaWithinBounds
:
Boolean
):
AnimationFrameInfo
{
isHasAlphaWithinBounds
=
_hasAlphaWithinBounds
return
this
}
/**
*
* How this frame should be modified before decoding the next one.
* @return `this`.
*/
fun
setDisposalMethod
(
_disposalMethod
:
AnimationDisposalMode
):
AnimationFrameInfo
{
disposalMethod
=
_disposalMethod
return
this
}
/**
*
* How this frame should blend with the prior frame.
* @return `this`.
*/
fun
setBlendMode
(
_blendMode
:
BlendMode
):
AnimationFrameInfo
{
blendMode
=
_blendMode
return
this
}
/**
*
* The rectangle updated by this frame.
*
*
* It may be empty, if the frame does not change the image. It will
* always be contained by [Codec.getSize].
* @return `this`.
*/
fun
setFrameRect
(
_frameRect
:
IRect
):
AnimationFrameInfo
{
frameRect
=
_frameRect
return
this
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
AnimationFrameInfo
)
return
false
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/BreakIterator.kt
View file @
cfdcbc63
...
...
@@ -556,7 +556,7 @@ class BreakIterator internal constructor(ptr: NativePointer) : Managed(ptr, _Fin
}
}
internal
object
_FinalizerHolder
{
private
object
_FinalizerHolder
{
val
PTR
=
_nGetFinalizer
()
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/ColorChannel.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
ColorChannel
{
R
,
G
,
B
,
A
;
R
,
G
,
B
,
A
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/CubicResampler.kt
View file @
cfdcbc63
...
...
@@ -22,7 +22,7 @@ package org.jetbrains.skia
* * Nice overview [https://entropymine.com/imageworsener/bicubic/](https://entropymine.com/imageworsener/bicubic/)
*
*/
class
CubicResampler
(
internal
val
b
:
Float
,
internal
val
c
:
Float
)
:
SamplingMode
{
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
()
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/EncodedImageFormat.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
EncodedImageFormat
{
BMP
,
GIF
,
ICO
,
JPEG
,
PNG
,
WBMP
,
WEBP
,
PKM
,
KTX
,
ASTC
,
DNG
,
HEIF
;
BMP
,
GIF
,
ICO
,
JPEG
,
PNG
,
WBMP
,
WEBP
,
PKM
,
KTX
,
ASTC
,
DNG
,
HEIF
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontMetrics.kt
View file @
cfdcbc63
...
...
@@ -170,6 +170,6 @@ class FontMetrics(
}
override
fun
toString
():
String
{
return
"FontMetrics(_top=
"
+
top
+
", _ascent="
+
ascent
+
", _descent="
+
descent
+
", _bottom="
+
bottom
+
", _leading="
+
leading
+
", _avgCharWidth="
+
avgCharWidth
+
", _maxCharWidth="
+
maxCharWidth
+
", _xMin="
+
xMin
+
", _xMax="
+
xMax
+
", _xHeight="
+
xHeight
+
", _capHeight="
+
capHeight
+
", _underlineThickness="
+
underlineThickness
+
", _underlinePosition="
+
underlinePosition
+
", _strikeoutThickness="
+
strikeoutThickness
+
", _strikeoutPosition="
+
strikeoutPosition
+
"
)"
return
"FontMetrics(_top=
$top, _ascent=$ascent, _descent=$descent, _bottom=$bottom, _leading=$leading, _avgCharWidth=$avgCharWidth, _maxCharWidth=$maxCharWidth, _xMin=$xMin, _xMax=$xMax, _xHeight=$xHeight, _capHeight=$capHeight, _underlineThickness=$underlineThickness, _underlinePosition=$underlinePosition, _strikeoutThickness=$strikeoutThickness, _strikeoutPosition=$strikeoutPosition
)"
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontSlant.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
FontSlant
{
UPRIGHT
,
ITALIC
,
OBLIQUE
;
UPRIGHT
,
ITALIC
,
OBLIQUE
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/FontVariationAxis.kt
View file @
cfdcbc63
package
org.jetbrains.skia
class
FontVariationAxis
(
internal
val
_tag
:
Int
,
internal
val
minValue
:
Float
,
internal
val
defaultValue
:
Float
,
internal
val
maxValue
:
Float
,
internal
val
isHidden
:
Boolean
val
_tag
:
Int
,
val
minValue
:
Float
,
val
defaultValue
:
Float
,
val
maxValue
:
Float
,
val
isHidden
:
Boolean
)
{
val
tag
:
String
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/GLBackendState.kt
View file @
cfdcbc63
...
...
@@ -11,8 +11,14 @@ enum class GLBackendState(internal val _bit: Int) {
/**
* View state stands for scissor and viewport
*/
VIEW
(
1
shl
2
),
BLEND
(
1
shl
3
),
MSAA_ENABLE
(
1
shl
4
),
VERTEX
(
1
shl
5
),
STENCIL
(
1
shl
6
),
PIXEL_STORE
(
1
shl
7
),
PROGRAM
(
1
shl
8
),
FIXED_FUNCTION
(
1
shl
9
),
MISC
(
1
shl
10
),
PATH_RENDERING
(
1
shl
11
);
VIEW
(
1
shl
2
),
BLEND
(
1
shl
3
),
MSAA_ENABLE
(
1
shl
4
),
VERTEX
(
1
shl
5
),
STENCIL
(
1
shl
6
),
PIXEL_STORE
(
1
shl
7
),
PROGRAM
(
1
shl
8
),
FIXED_FUNCTION
(
1
shl
9
),
MISC
(
1
shl
10
),
PATH_RENDERING
(
1
shl
11
);
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/GradientStyle.kt
View file @
cfdcbc63
package
org.jetbrains.skia
class
GradientStyle
(
internal
val
tileMode
:
FilterTileMode
,
internal
val
isPremul
:
Boolean
,
internal
val
localMatrix
:
Matrix33
?
val
tileMode
:
FilterTileMode
,
val
isPremul
:
Boolean
,
val
localMatrix
:
Matrix33
?
)
{
internal
fun
_getFlags
():
Int
{
...
...
@@ -11,7 +11,7 @@ class GradientStyle(
}
internal
fun
_getMatrixArray
():
FloatArray
?
{
return
if
(
localMatrix
==
null
)
null
else
localMatrix
.
mat
return
localMatrix
?
.
mat
}
override
fun
equals
(
o
:
Any
?):
Boolean
{
...
...
@@ -22,10 +22,10 @@ class GradientStyle(
if
(
isPremul
!=
other
.
isPremul
)
return
false
val
`
this
$
_tileMode
`
:
Any
=
tileMode
val
`
other
$
_tileMode
`
:
Any
=
other
.
tileMode
if
(
if
(
`
this
$
_tileMode
`
==
null
)
`
other
$
_tileMode
`
!=
null
else
`
this
$
_tileMode
`
!=
`
other
$
_tileMode
`
)
return
false
if
(
`
this
$
_tileMode
`
!=
`
other
$
_tileMode
`
)
return
false
val
`
this
$
_localMatrix
`
:
Any
?
=
localMatrix
val
`
other
$
_localMatrix
`
:
Any
?
=
other
.
localMatrix
return
if
(
if
(
`
this
$
_localMatrix
`
==
null
)
`
other
$
_localMatrix
`
!=
null
else
`
this
$
_localMatrix
`
!=
`
other
$
_localMatrix
`
)
false
else
true
return
!
if
(
`
this
$
_localMatrix
`
==
null
)
`
other
$
_localMatrix
`
!=
null
else
`
this
$
_localMatrix
`
!=
`
other
$
_localMatrix
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
...
@@ -44,7 +44,7 @@ class GradientStyle(
}
override
fun
toString
():
String
{
return
"GradientStyle(_tileMode=
"
+
tileMode
+
", _premul="
+
isPremul
+
", _localMatrix="
+
localMatrix
+
"
)"
return
"GradientStyle(_tileMode=
$tileMode, _premul=$isPremul, _localMatrix=$localMatrix
)"
}
fun
withTileMode
(
_tileMode
:
FilterTileMode
):
GradientStyle
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/IPoint.kt
View file @
cfdcbc63
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.NativePointer
class
IPoint
(
val
x
:
Int
,
val
y
:
Int
)
{
fun
offset
(
dx
:
Int
,
dy
:
Int
):
IPoint
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRange.kt
View file @
cfdcbc63
package
org.jetbrains.skia
import
org.jetbrains.skia.impl.NativePointer
class
IRange
(
val
start
:
Int
,
val
end
:
Int
)
{
override
fun
equals
(
o
:
Any
?):
Boolean
{
...
...
@@ -11,7 +8,7 @@ class IRange(val start: Int, val end: Int) {
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(
start
!=
other
.
start
)
return
false
return
if
(
end
!=
other
.
end
)
false
else
true
return
end
==
other
.
end
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/IRect.kt
View file @
cfdcbc63
...
...
@@ -36,7 +36,7 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
if
(
left
!=
other
.
left
)
return
false
if
(
top
!=
other
.
top
)
return
false
if
(
right
!=
other
.
right
)
return
false
return
if
(
bottom
!=
other
.
bottom
)
false
else
true
return
bottom
==
other
.
bottom
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
...
@@ -54,7 +54,7 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
}
override
fun
toString
():
String
{
return
"IRect(_left=
"
+
left
+
", _top="
+
top
+
", _right="
+
right
+
", _bottom="
+
bottom
+
"
)"
return
"IRect(_left=
$left, _top=$top, _right=$right, _bottom=$bottom
)"
}
companion
object
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/ISize.kt
View file @
cfdcbc63
...
...
@@ -21,7 +21,7 @@ class ISize internal constructor(val width: Int, val height: Int) {
val
other
=
o
if
(!
other
.
canEqual
(
this
as
Any
))
return
false
if
(
width
!=
other
.
width
)
return
false
return
if
(
height
!=
other
.
height
)
false
else
true
return
height
==
other
.
height
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
...
@@ -37,7 +37,7 @@ class ISize internal constructor(val width: Int, val height: Int) {
}
override
fun
toString
():
String
{
return
"ISize(_width=
"
+
width
+
", _height="
+
height
+
"
)"
return
"ISize(_width=
$width, _height=$height
)"
}
companion
object
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/InversionMode.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
InversionMode
{
NO
,
BRIGHTNESS
,
LIGHTNESS
;
NO
,
BRIGHTNESS
,
LIGHTNESS
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix33.kt
View file @
cfdcbc63
...
...
@@ -291,7 +291,7 @@ class Matrix33(vararg mat: Float) {
}
init
{
require
(
mat
.
size
==
9
)
{
(
if
(
"Expected 9 elements, got $mat"
==
null
)
null
else
mat
.
size
)
!!
}
require
(
mat
.
size
==
9
)
{
"Expected 9 elements, got ${mat.size}"
}
this
.
mat
=
mat
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/Matrix44.kt
View file @
cfdcbc63
...
...
@@ -65,7 +65,7 @@ class Matrix44(vararg mat: Float) {
* The constructor parameters are in row-major order.
*/
init
{
require
(
mat
.
size
==
16
)
{
(
if
(
"Expected 16 elements, got $mat"
==
null
)
null
else
mat
.
size
)
!!
}
require
(
mat
.
size
==
16
)
{
"Expected 16 elements, got ${mat.size}"
}
this
.
mat
=
mat
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/OutputWStream.kt
View file @
cfdcbc63
...
...
@@ -23,7 +23,7 @@ class OutputWStream(out: OutputStream?) : WStream(_nMake(out), _FinalizerHolder.
private
val
_out
:
OutputStream
?
internal
object
_FinalizerHolder
{
private
object
_FinalizerHolder
{
val
PTR
=
_nGetFinalizer
()
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/PaintMode.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
PaintMode
{
FILL
,
STROKE
,
STROKE_AND_FILL
;
FILL
,
STROKE
,
STROKE_AND_FILL
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/PathSegment.kt
View file @
cfdcbc63
...
...
@@ -17,9 +17,7 @@ class PathSegment constructor(
),
Point
(
x0
,
y0
),
null
,
null
,
null
,
0.0f
,
false
,
isClosedContour
)
{
require
(
verbOrdinal
==
PathVerb
.
MOVE
.
ordinal
||
verbOrdinal
==
PathVerb
.
CLOSE
.
ordinal
)
{
"Expected MOVE or CLOSE, got "
+
PathVerb
.
values
().
get
(
verbOrdinal
)
"Expected MOVE or CLOSE, got "
+
PathVerb
.
values
()[
verbOrdinal
]
}
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/PixelGeometry.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
PixelGeometry
{
UNKNOWN
,
RGB_H
,
BGR_H
,
RGB_V
,
BGR_V
;
UNKNOWN
,
RGB_H
,
BGR_H
,
RGB_V
,
BGR_V
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/SurfaceOrigin.kt
View file @
cfdcbc63
package
org.jetbrains.skia
enum
class
SurfaceOrigin
{
TOP_LEFT
,
BOTTOM_LEFT
;
TOP_LEFT
,
BOTTOM_LEFT
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/SurfaceProps.kt
View file @
cfdcbc63
...
...
@@ -23,7 +23,7 @@ class SurfaceProps constructor(
if
(
isDeviceIndependentFonts
!=
other
.
isDeviceIndependentFonts
)
return
false
val
`
this
$
_pixelGeometry
`
:
Any
=
pixelGeometry
val
`
other
$
_pixelGeometry
`
:
Any
=
other
.
pixelGeometry
return
if
(
if
(
`
this
$
_pixelGeometry
`
==
null
)
`
other
$
_pixelGeometry
`
!=
null
else
`
this
$
_pixelGeometry
`
!=
`
other
$
_pixelGeometry
`
)
false
else
true
return
`
this
$
_pixelGeometry
`
==
`
other
$
_pixelGeometry
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
...
@@ -35,12 +35,12 @@ class SurfaceProps constructor(
var
result
=
1
result
=
result
*
PRIME
+
if
(
isDeviceIndependentFonts
)
79
else
97
val
`$
_pixelGeometry
`
:
Any
=
pixelGeometry
result
=
result
*
PRIME
+
(
`$
_pixelGeometry
`
?.
hashCode
()
?:
43
)
result
=
result
*
PRIME
+
(
`$
_pixelGeometry
`
.
hashCode
()
)
return
result
}
override
fun
toString
():
String
{
return
"SurfaceProps(_deviceIndependentFonts=
"
+
isDeviceIndependentFonts
+
", _pixelGeometry="
+
pixelGeometry
+
"
)"
return
"SurfaceProps(_deviceIndependentFonts=
$isDeviceIndependentFonts, _pixelGeometry=$pixelGeometry
)"
}
fun
withDeviceIndependentFonts
(
_deviceIndependentFonts
:
Boolean
):
SurfaceProps
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/Affinity.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
Affinity
{
UPSTREAM
,
DOWNSTREAM
;
UPSTREAM
,
DOWNSTREAM
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/Alignment.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
Alignment
{
LEFT
,
RIGHT
,
CENTER
,
JUSTIFY
,
START
,
END
;
LEFT
,
RIGHT
,
CENTER
,
JUSTIFY
,
START
,
END
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/BaselineMode.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
BaselineMode
{
ALPHABETIC
,
IDEOGRAPHIC
;
ALPHABETIC
,
IDEOGRAPHIC
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/DecorationLineStyle.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
DecorationLineStyle
{
SOLID
,
DOUBLE
,
DOTTED
,
DASHED
,
WAVY
;
SOLID
,
DOUBLE
,
DOTTED
,
DASHED
,
WAVY
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/Direction.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
Direction
{
RTL
,
LTR
;
RTL
,
LTR
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/HeightMode.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
HeightMode
{
ALL
,
DISABLE_FIRST_ASCENT
,
DISABLE_LAST_DESCENT
,
DISABLE_ALL
;
ALL
,
DISABLE_FIRST_ASCENT
,
DISABLE_LAST_DESCENT
,
DISABLE_ALL
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/PositionWithAffinity.kt
View file @
cfdcbc63
...
...
@@ -25,7 +25,7 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
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/TextBox.kt
View file @
cfdcbc63
...
...
@@ -23,7 +23,7 @@ class TextBox(val rect: Rect, direction: Direction) {
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
(
if
(
`
this
$
_direction
`
==
null
)
`
other
$
_direction
`
!=
null
else
`
this
$
_direction
`
!=
`
other
$
_direction
`
)
false
else
true
return
!
if
(
`
this
$
_direction
`
==
null
)
true
else
`
this
$
_direction
`
!=
`
other
$
_direction
`
}
protected
fun
canEqual
(
other
:
Any
?):
Boolean
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/paragraph/TextStyleAttribute.kt
View file @
cfdcbc63
package
org.jetbrains.skia.paragraph
enum
class
TextStyleAttribute
{
NONE
,
ALL_ATTRIBUTES
,
FONT
,
FOREGROUND
,
BACKGROUND
,
SHADOW
,
DECORATIONS
,
LETTER_SPACING
,
WORD_SPACING
,
FONT_EXACT
;
NONE
,
ALL_ATTRIBUTES
,
FONT
,
FOREGROUND
,
BACKGROUND
,
SHADOW
,
DECORATIONS
,
LETTER_SPACING
,
WORD_SPACING
,
FONT_EXACT
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/TrivialBidiRunIterator.kt
View file @
cfdcbc63
package
org.jetbrains.skia.shaper
class
TrivialBidiRunIterator
(
text
:
String
,
level
:
Int
)
:
MutableIterator
<
BidiRun
?
>
{
internal
val
_length
:
Int
val
_length
:
Int
internal
val
_level
:
Int
val
_level
:
Int
internal
var
_atEnd
:
Boolean
override
fun
next
():
BidiRun
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/TrivialFontRunIterator.kt
View file @
cfdcbc63
...
...
@@ -3,9 +3,9 @@ package org.jetbrains.skia.shaper
import
org.jetbrains.skia.*
class
TrivialFontRunIterator
(
text
:
String
,
font
:
Font
)
:
MutableIterator
<
FontRun
?
>
{
internal
val
_length
:
Int
val
_length
:
Int
internal
val
_font
:
Font
val
_font
:
Font
internal
var
_atEnd
:
Boolean
override
fun
next
():
FontRun
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/TrivialLanguageRunIterator.kt
View file @
cfdcbc63
package
org.jetbrains.skia.shaper
class
TrivialLanguageRunIterator
(
text
:
String
,
language
:
String
)
:
MutableIterator
<
LanguageRun
?
>
{
internal
val
_length
:
Int
val
_length
:
Int
internal
val
_language
:
String
val
_language
:
String
internal
var
_atEnd
:
Boolean
override
fun
next
():
LanguageRun
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/shaper/TrivialScriptRunIterator.kt
View file @
cfdcbc63
package
org.jetbrains.skia.shaper
class
TrivialScriptRunIterator
(
text
:
String
,
script
:
String
)
:
MutableIterator
<
ScriptRun
?
>
{
internal
val
_length
:
Int
val
_length
:
Int
internal
val
_script
:
String
val
_script
:
String
internal
var
_atEnd
:
Boolean
override
fun
next
():
ScriptRun
{
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/skottie/AnimationBuilder.kt
View file @
cfdcbc63
...
...
@@ -46,7 +46,7 @@ class AnimationBuilder internal constructor(ptr: NativePointer) : Managed(ptr, _
}
}
internal
object
_FinalizerHolder
{
private
object
_FinalizerHolder
{
val
PTR
=
_nGetFinalizer
()
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/skottie/AnimationBuilderFlag.kt
View file @
cfdcbc63
package
org.jetbrains.skia.skottie
enum
class
AnimationBuilderFlag
(
internal
val
_flag
:
Int
)
{
enum
class
AnimationBuilderFlag
(
val
_flag
:
Int
)
{
/**
* Normally, all static image frames are resolved at
* load time via ImageAsset::getFrame(0). With this flag,
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/skottie/LogLevel.kt
View file @
cfdcbc63
package
org.jetbrains.skia.skottie
enum
class
LogLevel
{
WARNING
,
ERROR
;
WARNING
,
ERROR
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/skottie/RenderFlag.kt
View file @
cfdcbc63
package
org.jetbrains.skia.skottie
enum
class
RenderFlag
(
internal
val
_flag
:
Int
)
{
enum
class
RenderFlag
(
val
_flag
:
Int
)
{
/**
* When rendering into a known transparent buffer, clients can pass
* this flag to avoid some unnecessary compositing overhead for
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGLength.kt
View file @
cfdcbc63
package
org.jetbrains.skia.svg
class
SVGLength
(
val
value
:
Float
,
unit
:
SVGLengthUnit
)
{
internal
val
_unit
:
SVGLengthUnit
class
SVGLength
(
val
value
:
Float
,
val
unit
:
SVGLengthUnit
)
{
internal
constructor
(
value
:
Float
,
unit
:
Int
)
:
this
(
value
,
SVGLengthUnit
.
values
()[
unit
])
constructor
(
value
:
Float
)
:
this
(
value
,
SVGLengthUnit
.
NUMBER
)
{}
val
unit
:
SVGLengthUnit
get
()
=
_unit
override
fun
equals
(
o
:
Any
?):
Boolean
{
if
(
o
===
this
)
return
true
if
(
o
!
is
SVGLength
)
return
false
...
...
@@ -40,14 +35,10 @@ class SVGLength(val value: Float, unit: SVGLengthUnit) {
}
fun
withValue
(
_value
:
Float
):
SVGLength
{
return
if
(
value
==
_value
)
this
else
SVGLength
(
_value
,
_
unit
)
return
if
(
value
==
_value
)
this
else
SVGLength
(
_value
,
unit
)
}
fun
withUnit
(
_unit
:
SVGLengthUnit
):
SVGLength
{
return
if
(
this
.
_unit
===
_unit
)
this
else
SVGLength
(
value
,
_unit
)
}
init
{
_unit
=
unit
return
if
(
this
.
unit
===
unit
)
this
else
SVGLength
(
value
,
unit
)
}
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGLengthContext.kt
View file @
cfdcbc63
...
...
@@ -5,15 +5,15 @@ import kotlin.math.hypot
import
kotlin.math.sqrt
class
SVGLengthContext
constructor
(
internal
val
width
:
Float
,
internal
val
height
:
Float
,
internal
val
dpi
:
Float
=
90f
val
width
:
Float
,
val
height
:
Float
,
val
dpi
:
Float
=
90f
)
{
constructor
(
size
:
Point
)
:
this
(
size
.
x
,
size
.
y
,
90f
)
fun
resolve
(
length
:
SVGLength
,
type
:
SVGLengthType
):
Float
{
return
when
(
length
.
_
unit
)
{
return
when
(
length
.
unit
)
{
SVGLengthUnit
.
NUMBER
->
length
.
value
SVGLengthUnit
.
PX
->
length
.
value
SVGLengthUnit
.
PERCENTAGE
->
{
...
...
@@ -32,7 +32,7 @@ class SVGLengthContext constructor(
SVGLengthUnit
.
IN
->
length
.
value
*
dpi
SVGLengthUnit
.
PT
->
length
.
value
*
dpi
/
72.272f
SVGLengthUnit
.
PC
->
length
.
value
*
dpi
*
12.0f
/
72.272f
else
->
throw
IllegalArgumentException
(
"Unknown SVGLengthUnit: "
+
length
.
_
unit
)
else
->
throw
IllegalArgumentException
(
"Unknown SVGLengthUnit: "
+
length
.
unit
)
}
}
...
...
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGLengthType.kt
View file @
cfdcbc63
package
org.jetbrains.skia.svg
enum
class
SVGLengthType
{
HORIZONTAL
,
VERTICAL
,
OTHER
;
HORIZONTAL
,
VERTICAL
,
OTHER
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGLengthUnit.kt
View file @
cfdcbc63
package
org.jetbrains.skia.svg
enum
class
SVGLengthUnit
{
UNKNOWN
,
NUMBER
,
PERCENTAGE
,
EMS
,
EXS
,
PX
,
CM
,
MM
,
IN
,
PT
,
PC
;
UNKNOWN
,
NUMBER
,
PERCENTAGE
,
EMS
,
EXS
,
PX
,
CM
,
MM
,
IN
,
PT
,
PC
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGPreserveAspectRatioScale.kt
View file @
cfdcbc63
package
org.jetbrains.skia.svg
enum
class
SVGPreserveAspectRatioScale
{
MEET
,
SLICE
;
MEET
,
SLICE
;
}
\ No newline at end of file
skiko/src/commonMain/kotlin/org/jetbrains/skia/svg/SVGSVG.kt
View file @
cfdcbc63
...
...
@@ -70,7 +70,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun
setX
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
Stats
.
onNativeCall
()
_nSetX
(
_ptr
,
length
.
value
,
length
.
_
unit
.
ordinal
)
_nSetX
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
}
finally
{
reachabilityBarrier
(
this
)
...
...
@@ -91,7 +91,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun
setY
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
Stats
.
onNativeCall
()
_nSetY
(
_ptr
,
length
.
value
,
length
.
_
unit
.
ordinal
)
_nSetY
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
}
finally
{
reachabilityBarrier
(
this
)
...
...
@@ -112,7 +112,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun
setWidth
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
Stats
.
onNativeCall
()
_nSetWidth
(
_ptr
,
length
.
value
,
length
.
_
unit
.
ordinal
)
_nSetWidth
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
}
finally
{
reachabilityBarrier
(
this
)
...
...
@@ -133,7 +133,7 @@ class SVGSVG internal constructor(ptr: NativePointer) : SVGContainer(ptr) {
fun
setHeight
(
length
:
SVGLength
):
SVGSVG
{
return
try
{
Stats
.
onNativeCall
()
_nSetHeight
(
_ptr
,
length
.
value
,
length
.
_
unit
.
ordinal
)
_nSetHeight
(
_ptr
,
length
.
value
,
length
.
unit
.
ordinal
)
this
}
finally
{
reachabilityBarrier
(
this
)
...
...
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