Unverified Commit 50cbeb65 authored by Nikolay Igotti's avatar Nikolay Igotti Committed by GitHub

Cleanup generated files. (#244)

parent 9e1a2c85
...@@ -85,31 +85,17 @@ class AnimationFrameInfo( ...@@ -85,31 +85,17 @@ class AnimationFrameInfo(
BlendMode.values()[blendModeOrdinal], BlendMode.values()[blendModeOrdinal],
frameRect frameRect
) )
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is AnimationFrameInfo) return false if (other !is AnimationFrameInfo) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (requiredFrame != other.requiredFrame) return false if (requiredFrame != other.requiredFrame) return false
if (duration != other.duration) return false if (duration != other.duration) return false
if (isFullyReceived != other.isFullyReceived) return false if (isFullyReceived != other.isFullyReceived) return false
if (isHasAlphaWithinBounds != other.isHasAlphaWithinBounds) return false if (isHasAlphaWithinBounds != other.isHasAlphaWithinBounds) return false
val `this$_alphaType`: Any = alphaType if (this.alphaType != other.alphaType) return false
val `other$_alphaType`: Any = other.alphaType if (this.disposalMethod != other.disposalMethod) return false
if (`this$_alphaType` != `other$_alphaType`) return false if (this.blendMode != other.blendMode) return false
val `this$_disposalMethod`: Any = disposalMethod return this.frameRect == other.frameRect
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
} }
override fun hashCode(): Int { override fun hashCode(): Int {
...@@ -119,14 +105,10 @@ class AnimationFrameInfo( ...@@ -119,14 +105,10 @@ class AnimationFrameInfo(
result = result * PRIME + duration result = result * PRIME + duration
result = result * PRIME + if (isFullyReceived) 79 else 97 result = result * PRIME + if (isFullyReceived) 79 else 97
result = result * PRIME + if (isHasAlphaWithinBounds) 79 else 97 result = result * PRIME + if (isHasAlphaWithinBounds) 79 else 97
val `$_alphaType`: Any = alphaType result = result * PRIME + alphaType.hashCode()
result = result * PRIME + (`$_alphaType`.hashCode()) result = result * PRIME + disposalMethod.hashCode()
val `$_disposalMethod`: Any = disposalMethod result = result * PRIME + blendMode.hashCode()
result = result * PRIME + `$_disposalMethod`.hashCode() result = result * PRIME + frameRect.hashCode()
val `$_blendMode`: Any = blendMode
result = result * PRIME + `$_blendMode`.hashCode()
val `$_frameRect`: Any = frameRect
result = result * PRIME + `$_frameRect`.hashCode()
return result return result
} }
......
...@@ -68,7 +68,6 @@ class BackendRenderTarget internal constructor(ptr: NativePointer) : Managed(ptr ...@@ -68,7 +68,6 @@ class BackendRenderTarget internal constructor(ptr: NativePointer) : Managed(ptr
} }
} }
@ExternalSymbolName("org_jetbrains_skia_BackendRenderTarget__1nGetFinalizer") @ExternalSymbolName("org_jetbrains_skia_BackendRenderTarget__1nGetFinalizer")
private external fun BackendRenderTarget_nGetFinalizer(): NativePointer private external fun BackendRenderTarget_nGetFinalizer(): NativePointer
......
...@@ -996,9 +996,6 @@ class Bitmap internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH ...@@ -996,9 +996,6 @@ class Bitmap internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerH
localMatrix: Matrix33? = null localMatrix: Matrix33? = null
): Shader { ): Shader {
return try { 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() Stats.onNativeCall()
Shader( Shader(
interopScope { interopScope {
......
...@@ -353,8 +353,8 @@ class BreakIterator internal constructor(ptr: NativePointer) : Managed(ptr, _Fin ...@@ -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 * @return The character offset of the boundary position n boundaries away from
* the current one. * the current one.
*/ */
fun next(n: Int): Int { fun next(index: Int): Int {
var n = n var n = index
var result = 0 var result = 0
if (n > 0) { if (n > 0) {
while (n > 0 && result != DONE) { while (n > 0 && result != DONE) {
......
...@@ -33,21 +33,15 @@ class Color4f constructor(val r: Float, val g: Float, val b: Float, val a: Float ...@@ -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 { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Color4f) return false if (other !is Color4f) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (r.compareTo(other.r) != 0) return false if (r.compareTo(other.r) != 0) return false
if (g.compareTo(other.g) != 0) return false if (g.compareTo(other.g) != 0) return false
if (b.compareTo(other.b) != 0) return false if (b.compareTo(other.b) != 0) return false
return a.compareTo(other.a) == 0 return a.compareTo(other.a) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is Color4f
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -40,31 +40,17 @@ class ColorInfo(val colorType: ColorType, val alphaType: ColorAlphaType, val col ...@@ -40,31 +40,17 @@ class ColorInfo(val colorType: ColorType, val alphaType: ColorAlphaType, val col
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (other === this) return true if (other === this) return true
if (other !is ColorInfo) return false if (other !is ColorInfo) return false
if (!other.canEqual(this as Any)) return false if (this.colorType != other.colorType) return false
val `this$_colorType`: Any = colorType if (this.alphaType != other.alphaType) return false
val `other$_colorType`: Any = other.colorType return this.colorSpace == other.colorSpace
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
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_colorType`: Any = colorType result = result * PRIME + colorType.hashCode()
result = result * PRIME + `$_colorType`.hashCode() result = result * PRIME + alphaType.hashCode()
val `$_alphaType`: Any = alphaType result = result * PRIME + colorSpace.hashCode()
result = result * PRIME + `$_alphaType`.hashCode()
val `$_colorSpace`: Any? = colorSpace
result = result * PRIME + `$_colorSpace`.hashCode()
return result return result
} }
......
...@@ -2,18 +2,12 @@ package org.jetbrains.skia ...@@ -2,18 +2,12 @@ package org.jetbrains.skia
class ColorMatrix(vararg mat: Float) { class ColorMatrix(vararg mat: Float) {
val mat: FloatArray val mat: FloatArray
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is ColorMatrix) return false if (other !is ColorMatrix) return false
val other = o
if (!other.canEqual(this as Any)) return false
return mat.contentEquals(other.mat) return mat.contentEquals(other.mat)
} }
protected fun canEqual(other: Any?): Boolean {
return other is ColorMatrix
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -16,8 +16,8 @@ class ColorSpace : Managed { ...@@ -16,8 +16,8 @@ class ColorSpace : Managed {
} }
fun convert(to: ColorSpace?, color: Color4f): Color4f { fun convert(toColor: ColorSpace?, color: Color4f): Color4f {
var to = to var to = toColor
to = to ?: sRGB to = to ?: sRGB
return try { return try {
Color4f(withResult(FloatArray(4)) { Color4f(withResult(FloatArray(4)) {
......
...@@ -141,7 +141,6 @@ enum class ColorType { ...@@ -141,7 +141,6 @@ enum class ColorType {
R16G16_FLOAT -> 4 R16G16_FLOAT -> 4
R16G16B16A16_UNORM -> 8 R16G16B16A16_UNORM -> 8
} }
throw RuntimeException("Unreachable")
} }
val shiftPerPixel: Int val shiftPerPixel: Int
get() { get() {
...@@ -183,18 +182,19 @@ enum class ColorType { ...@@ -183,18 +182,19 @@ enum class ColorType {
* @return ColorAlphaType if can be associated with colorType * @return ColorAlphaType if can be associated with colorType
*/ */
fun validateAlphaType(alphaType: ColorAlphaType): ColorAlphaType? { fun validateAlphaType(alphaType: ColorAlphaType): ColorAlphaType? {
var alphaType = alphaType return when (this) {
when (this) { UNKNOWN -> ColorAlphaType.UNKNOWN
UNKNOWN -> alphaType = ColorAlphaType.UNKNOWN
ALPHA_8, A16_UNORM, A16_FLOAT -> { ALPHA_8, A16_UNORM, A16_FLOAT -> {
if (ColorAlphaType.UNPREMUL == alphaType) alphaType = ColorAlphaType.PREMUL if (ColorAlphaType.UNPREMUL == alphaType) ColorAlphaType.PREMUL
if (ColorAlphaType.UNKNOWN == alphaType) return null 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) return null ARGB_4444, RGBA_8888, BGRA_8888, RGBA_1010102, BGRA_1010102, RGBA_F16NORM, RGBA_F16, RGBA_F32, R16G16B16A16_UNORM ->
GRAY_8, R8G8_UNORM, R16G16_UNORM, R16G16_FLOAT, RGB_565, RGB_888X, RGB_101010X, BGR_101010X -> alphaType = 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 ColorAlphaType.OPAQUE
} }
return alphaType
} }
fun computeOffset(x: Int, y: Int, rowBytes: Long): Long { fun computeOffset(x: Int, y: Int, rowBytes: Long): Long {
......
package org.jetbrains.skia package org.jetbrains.skia
/** /**
* *
* Specify B and C (each between 0...1) to create a shader that applies the corresponding * 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 { ...@@ -26,19 +25,13 @@ class CubicResampler(val b: Float, val c: Float) : SamplingMode {
override fun _pack(): Long = (0x8L shl 60) or ((b.toBits().toULong() shl 32) or c.toBits().toULong()).toLong() override fun _pack(): Long = (0x8L shl 60) or ((b.toBits().toULong() shl 32) or c.toBits().toULong()).toLong()
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is CubicResampler) return false if (other !is CubicResampler) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (b.compareTo(other.b) != 0) return false if (b.compareTo(other.b) != 0) return false
return c.compareTo(other.c) == 0 return c.compareTo(other.c) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is CubicResampler
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -7,30 +7,18 @@ class FilterMipmap constructor( ...@@ -7,30 +7,18 @@ class FilterMipmap constructor(
override fun _pack() = filterMode.ordinal.toLong() shl 32 or mipmapMode.ordinal.toLong() override fun _pack() = filterMode.ordinal.toLong() shl 32 or mipmapMode.ordinal.toLong()
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FilterMipmap) return false if (other !is FilterMipmap) return false
val other = o if (this.filterMode != other.filterMode) return false
if (!other.canEqual(this as Any)) return false return this.mipmapMode == other.mipmapMode
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 hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_filterMode`: Any = filterMode result = result * PRIME + (filterMode.hashCode())
result = result * PRIME + (`$_filterMode`.hashCode()) result = result * PRIME + (mipmapMode.hashCode())
val `$_mipmapMode`: Any = mipmapMode
result = result * PRIME + (`$_mipmapMode`.hashCode())
return result return result
} }
......
...@@ -8,20 +8,14 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float) ...@@ -8,20 +8,14 @@ class FontExtents(val ascender: Float, val descender: Float, val lineGap: Float)
val lineHeight: Float val lineHeight: Float
get() = -ascender + descender + lineGap get() = -ascender + descender + lineGap
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontExtents) return false if (other !is FontExtents) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (ascender.compareTo(other.ascender) != 0) return false if (ascender.compareTo(other.ascender) != 0) return false
if (descender.compareTo(other.descender) != 0) return false if (descender.compareTo(other.descender) != 0) return false
return lineGap.compareTo(other.lineGap) == 0 return lineGap.compareTo(other.lineGap) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is FontExtents
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
package org.jetbrains.skia package org.jetbrains.skia
class FontFamilyName(val name: String, val language: String) { class FontFamilyName(val name: String, val language: String) {
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontFamilyName) return false if (other !is FontFamilyName) return false
val other = o if (this.name != other.name) return false
if (!other.canEqual(this as Any)) return false return this.language == other.language
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 hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_name`: Any = name result = result * PRIME + name.hashCode()
result = result * PRIME + (`$_name`.hashCode()) result = result * PRIME + language.hashCode()
val `$_language`: Any = language
result = result * PRIME + (`$_language`.hashCode())
return result return result
} }
......
...@@ -39,33 +39,22 @@ class FontFeature(val _tag: Int, val value: Int, val start: Long, val end: Long) ...@@ -39,33 +39,22 @@ class FontFeature(val _tag: Int, val value: Int, val start: Long, val end: Long)
return "FontFeature($valuePrefix$_tag$range$valueSuffix)" return "FontFeature($valuePrefix$_tag$range$valueSuffix)"
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontFeature) return false if (other !is FontFeature) return false
val other = o if (this.tag != other) return false
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
if (value != other.value) return false if (value != other.value) return false
if (start != other.start) 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 {
return other is FontFeature
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_tag`: Any = _tag result = result * PRIME + (_tag.hashCode())
result = result * PRIME + (`$_tag`.hashCode())
result = result * PRIME + value result = result * PRIME + value
val `$_start` = start result = result * PRIME + (start ushr 32 xor start).toInt()
result = result * PRIME + (`$_start` ushr 32 xor `$_start`).toInt() result = result * PRIME + (end ushr 32 xor end).toInt()
val `$_end` = end
result = result * PRIME + (`$_end` ushr 32 xor `$_end`).toInt()
return result return result
} }
...@@ -87,8 +76,8 @@ class FontFeature(val _tag: Int, val value: Int, val start: Long, val end: Long) ...@@ -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) return FontFeature(m.group("tag")!!, value, start, end)
} }
fun parse(s: String): Array<FontFeature?> { fun parse(str: String): Array<FontFeature?> {
return _splitPattern.split(s)?.map { s -> parseOne(s!!) }?.toTypedArray() ?: emptyArray() return _splitPattern.split(str)?.map { s -> parseOne(s!!) }?.toTypedArray() ?: emptyArray()
} }
} }
} }
\ No newline at end of file
...@@ -110,11 +110,9 @@ class FontMetrics( ...@@ -110,11 +110,9 @@ class FontMetrics(
val height: Float val height: Float
get() = descent - ascent get() = descent - ascent
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontMetrics) return false if (other !is FontMetrics) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (top.compareTo(other.top) != 0) return false if (top.compareTo(other.top) != 0) return false
if (ascent.compareTo(other.ascent) != 0) return false if (ascent.compareTo(other.ascent) != 0) return false
if (descent.compareTo(other.descent) != 0) return false if (descent.compareTo(other.descent) != 0) return false
...@@ -126,22 +124,10 @@ class FontMetrics( ...@@ -126,22 +124,10 @@ class FontMetrics(
if (xMax.compareTo(other.xMax) != 0) return false if (xMax.compareTo(other.xMax) != 0) return false
if (xHeight.compareTo(other.xHeight) != 0) return false if (xHeight.compareTo(other.xHeight) != 0) return false
if (capHeight.compareTo(other.capHeight) != 0) return false if (capHeight.compareTo(other.capHeight) != 0) return false
val `this$_underlineThickness`: Any? = underlineThickness if (if (this.underlineThickness == null) other.underlineThickness != null else this.underlineThickness != other.underlineThickness) return false
val `other$_underlineThickness`: Any? = other.underlineThickness if (if (this.underlinePosition == null) other.underlinePosition != null else this.underlinePosition != other.underlinePosition) return false
if (if (`this$_underlineThickness` == null) `other$_underlineThickness` != null else `this$_underlineThickness` != `other$_underlineThickness`) return false if (if (this.strikeoutThickness == null) other.strikeoutThickness != null else this.strikeoutThickness != other.strikeoutThickness) return false
val `this$_underlinePosition`: Any? = underlinePosition return !if (this.strikeoutPosition == null) other.strikeoutPosition != null else this.strikeoutPosition != other.strikeoutPosition
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
} }
override fun hashCode(): Int { override fun hashCode(): Int {
...@@ -158,14 +144,10 @@ class FontMetrics( ...@@ -158,14 +144,10 @@ class FontMetrics(
result = result * PRIME + xMax.toBits() result = result * PRIME + xMax.toBits()
result = result * PRIME + xHeight.toBits() result = result * PRIME + xHeight.toBits()
result = result * PRIME + capHeight.toBits() result = result * PRIME + capHeight.toBits()
val `$_underlineThickness`: Any? = underlineThickness result = result * PRIME + underlineThickness.hashCode()
result = result * PRIME + (`$_underlineThickness`?.hashCode() ?: 43) result = result * PRIME + underlinePosition.hashCode()
val `$_underlinePosition`: Any? = underlinePosition result = result * PRIME + strikeoutThickness.hashCode()
result = result * PRIME + (`$_underlinePosition`?.hashCode() ?: 43) result = result * PRIME + strikeoutPosition.hashCode()
val `$_strikeoutThickness`: Any? = strikeoutThickness
result = result * PRIME + (`$_strikeoutThickness`?.hashCode() ?: 43)
val `$_strikeoutPosition`: Any? = strikeoutPosition
result = result * PRIME + (`$_strikeoutPosition`?.hashCode() ?: 43)
return result return result
} }
......
...@@ -26,26 +26,20 @@ class FontStyle { ...@@ -26,26 +26,20 @@ class FontStyle {
} }
val slant: FontSlant 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 { fun withSlant(slant: FontSlant): FontStyle {
return FontStyle(weight, width, slant) return FontStyle(weight, width, slant)
} }
override fun toString(): String { 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 { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontStyle) return false if (other !is FontStyle) return false
val other = o return _value == other._value
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 hashCode(): Int { override fun hashCode(): Int {
......
...@@ -11,26 +11,17 @@ class FontVariation(val _tag: Int, val value: Float) { ...@@ -11,26 +11,17 @@ class FontVariation(val _tag: Int, val value: Float) {
return "$tag=$value" return "$tag=$value"
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontVariation) return false if (other !is FontVariation) return false
val other = o if (this.tag != other.tag) return false
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
return value.compareTo(other.value) == 0 return value.compareTo(other.value) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is FontVariation
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_tag`: Any = _tag result = result * PRIME + _tag
result = result * PRIME + (`$_tag`?.hashCode() ?: 43)
result = result * PRIME + value.toBits() result = result * PRIME + value.toBits()
return result return result
} }
...@@ -49,8 +40,8 @@ class FontVariation(val _tag: Int, val value: Float) { ...@@ -49,8 +40,8 @@ class FontVariation(val _tag: Int, val value: Float) {
return FontVariation(m.group("tag")!!, value) return FontVariation(m.group("tag")!!, value)
} }
fun parse(s: String?): Array<FontVariation> { fun parse(str: String): Array<FontVariation> {
return _splitPattern.split(s!!)!!.map { s -> parseOne(s!!) } return _splitPattern.split(str)!!.map { s -> parseOne(s!!) }
.toTypedArray() .toTypedArray()
} }
} }
......
...@@ -17,8 +17,7 @@ class FontVariationAxis( ...@@ -17,8 +17,7 @@ class FontVariationAxis(
def: Float, def: Float,
max: Float, max: Float,
hidden: Boolean 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( constructor(tag: String, min: Float, def: Float, max: Float) : this(
FourByteTag.fromString(tag), FourByteTag.fromString(tag),
...@@ -26,32 +25,22 @@ class FontVariationAxis( ...@@ -26,32 +25,22 @@ class FontVariationAxis(
def, def,
max, max,
false false
) { )
}
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontVariationAxis) return false if (other !is FontVariationAxis) return false
val other = o if (this._tag != other._tag) return false
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
if (minValue.compareTo(other.minValue) != 0) return false if (minValue.compareTo(other.minValue) != 0) return false
if (defaultValue.compareTo(other.defaultValue) != 0) return false if (defaultValue.compareTo(other.defaultValue) != 0) return false
if (maxValue.compareTo(other.maxValue) != 0) return false if (maxValue.compareTo(other.maxValue) != 0) return false
return isHidden == other.isHidden return isHidden == other.isHidden
} }
protected fun canEqual(other: Any?): Boolean {
return other is FontVariationAxis
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 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 + minValue.toBits()
result = result * PRIME + defaultValue.toBits() result = result * PRIME + defaultValue.toBits()
result = result * PRIME + maxValue.toBits() result = result * PRIME + maxValue.toBits()
......
...@@ -14,32 +14,20 @@ class GradientStyle( ...@@ -14,32 +14,20 @@ class GradientStyle(
return localMatrix?.mat return localMatrix?.mat
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is GradientStyle) return false if (other !is GradientStyle) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (isPremul != other.isPremul) return false if (isPremul != other.isPremul) return false
val `this$_tileMode`: Any = tileMode if (this.tileMode != other.tileMode) return false
val `other$_tileMode`: Any = other.tileMode return !if (this.localMatrix == null) other.localMatrix != null else this.localMatrix != other.localMatrix
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
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + if (isPremul) 79 else 97 result = result * PRIME + if (isPremul) 79 else 97
val `$_tileMode`: Any = tileMode result = result * PRIME + tileMode.hashCode()
result = result * PRIME + (`$_tileMode`?.hashCode() ?: 43) result = result * PRIME + (localMatrix?.hashCode() ?: 43)
val `$_localMatrix`: Any? = localMatrix
result = result * PRIME + (`$_localMatrix`?.hashCode() ?: 43)
return result return result
} }
......
...@@ -13,19 +13,13 @@ class IPoint(val x: Int, val y: Int) { ...@@ -13,19 +13,13 @@ class IPoint(val x: Int, val y: Int) {
val isEmpty: Boolean val isEmpty: Boolean
get() = x <= 0 || y <= 0 get() = x <= 0 || y <= 0
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is IPoint) return false if (other !is IPoint) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (x != other.x) return false if (x != other.x) return false
return y == other.y return y == other.y
} }
protected fun canEqual(other: Any?): Boolean {
return other is IPoint
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
package org.jetbrains.skia package org.jetbrains.skia
class IRange(val start: Int, val end: Int) { class IRange(val start: Int, val end: Int) {
override fun equals(other: Any?): Boolean {
override fun equals(o: Any?): Boolean { if (other === this) return true
if (o === this) return true if (other !is IRange) return false
if (o !is IRange) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (start != other.start) return false if (start != other.start) return false
return end == other.end return end == other.end
} }
protected fun canEqual(other: Any?): Boolean {
return other is IRange
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -9,11 +9,12 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va ...@@ -9,11 +9,12 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va
get() = bottom - top get() = bottom - top
fun intersect(other: IRect): IRect? { fun intersect(other: IRect): IRect? {
return if (right <= other.left || other.right <= left || bottom <= other.top || other.bottom <= top) null else IRect( return if (right <= other.left || other.right <= left ||
maxOf(left, other.left), maxOf(top, other.top), minOf( bottom <= other.top || other.bottom <= top) null
right, other.right else IRect(
), minOf(bottom, other.bottom) maxOf(left, other.left), maxOf(top, other.top),
) minOf(right, other.right), minOf(bottom, other.bottom)
)
} }
fun offset(dx: Int, dy: Int): IRect { fun offset(dx: Int, dy: Int): IRect {
...@@ -28,21 +29,15 @@ class IRect internal constructor(val left: Int, val top: Int, val right: Int, va ...@@ -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()) return Rect(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat())
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is IRect) return false if (other !is IRect) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (left != other.left) return false if (left != other.left) return false
if (top != other.top) return false if (top != other.top) return false
if (right != other.right) return false if (right != other.right) return false
return bottom == other.bottom return bottom == other.bottom
} }
protected fun canEqual(other: Any?): Boolean {
return other is IRect
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -15,19 +15,13 @@ class ISize internal constructor(val width: Int, val height: Int) { ...@@ -15,19 +15,13 @@ class ISize internal constructor(val width: Int, val height: Int) {
return width * height return width * height
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is ISize) return false if (other !is ISize) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (width != other.width) return false if (width != other.width) return false
return height == other.height return height == other.height
} }
protected fun canEqual(other: Any?): Boolean {
return other is ISize
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -189,20 +189,12 @@ class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int) { ...@@ -189,20 +189,12 @@ class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int) {
return computeByteSize(minRowBytes) return computeByteSize(minRowBytes)
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is ImageInfo) return false if (other !is ImageInfo) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (width != other.width) return false if (width != other.width) return false
if (height != other.height) return false if (height != other.height) return false
val `this$_colorInfo`: Any? = colorInfo return this.colorInfo == other.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
} }
override fun hashCode(): Int { override fun hashCode(): Int {
...@@ -210,13 +202,12 @@ class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int) { ...@@ -210,13 +202,12 @@ class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int) {
var result = 1 var result = 1
result = result * PRIME + width result = result * PRIME + width
result = result * PRIME + height result = result * PRIME + height
val `$_colorInfo`: Any? = colorInfo result = result * PRIME + colorInfo.hashCode()
result = result * PRIME + (`$_colorInfo`?.hashCode() ?: 43)
return result return result
} }
override fun toString(): String { 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 { fun withColorInfo(_colorInfo: ColorInfo): ImageInfo {
......
...@@ -114,18 +114,12 @@ class Matrix33(vararg mat: Float) { ...@@ -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]) 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 { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Matrix33) return false if (other !is Matrix33) return false
val other = o
if (!other.canEqual(this as Any)) return false
return mat.contentEquals(other.mat) return mat.contentEquals(other.mat)
} }
protected fun canEqual(other: Any?): Boolean {
return other is Matrix33
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -34,18 +34,12 @@ class Matrix44(vararg mat: Float) { ...@@ -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]) 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 { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Matrix44) return false if (other !is Matrix44) return false
val other = o
if (!other.canEqual(this as Any)) return false
return mat.contentEquals(other.mat) return mat.contentEquals(other.mat)
} }
protected fun canEqual(other: Any?): Boolean {
return other is Matrix44
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -34,7 +34,6 @@ enum class PathFillMode { ...@@ -34,7 +34,6 @@ enum class PathFillMode {
EVEN_ODD -> INVERSE_EVEN_ODD EVEN_ODD -> INVERSE_EVEN_ODD
INVERSE_WINDING -> WINDING INVERSE_WINDING -> WINDING
INVERSE_EVEN_ODD -> EVEN_ODD INVERSE_EVEN_ODD -> EVEN_ODD
else -> throw RuntimeException("Unreachable")
} }
} }
} }
\ No newline at end of file
...@@ -30,8 +30,7 @@ class PathSegment constructor( ...@@ -30,8 +30,7 @@ class PathSegment constructor(
0.0f, 0.0f,
isCloseLine, isCloseLine,
isClosedContour isClosedContour
) { )
}
constructor(x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, isClosedContour: Boolean) : this( constructor(x0: Float, y0: Float, x1: Float, y1: Float, x2: Float, y2: Float, isClosedContour: Boolean) : this(
PathVerb.QUAD, PathVerb.QUAD,
...@@ -42,8 +41,7 @@ class PathSegment constructor( ...@@ -42,8 +41,7 @@ class PathSegment constructor(
0.0f, 0.0f,
false, false,
isClosedContour isClosedContour
) { )
}
constructor( constructor(
x0: Float, x0: Float,
...@@ -63,8 +61,7 @@ class PathSegment constructor( ...@@ -63,8 +61,7 @@ class PathSegment constructor(
conicWeight, conicWeight,
false, false,
isClosedContour isClosedContour
) { )
}
constructor( constructor(
x0: Float, x0: Float,
...@@ -85,25 +82,23 @@ class PathSegment constructor( ...@@ -85,25 +82,23 @@ class PathSegment constructor(
0.0f, 0.0f,
false, false,
isClosedContour isClosedContour
) { )
}
override fun toString(): String { 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 "") + ")" 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 { override fun equals(other: Any?): Boolean {
if (this === o) return true if (this === other) return true
if (o == null || o !is PathSegment) return false if (other !is PathSegment) return false
val segment = o return verb == other.verb &&
return verb == segment.verb && (if (verb != PathVerb.DONE) p0 == other.p0 else true) &&
(if (verb != PathVerb.DONE) p0 == segment.p0 else true) && (if (verb == PathVerb.LINE || verb == PathVerb.QUAD || verb == PathVerb.CONIC || verb == PathVerb.CUBIC) p1 == other.p1 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 == other.p2 else true) &&
(if (verb == PathVerb.QUAD || verb == PathVerb.CONIC || verb == PathVerb.CUBIC) p2 == segment.p2 else true) && (if (verb == PathVerb.CUBIC) p3 == other.p3 else true) &&
(if (verb == PathVerb.CUBIC) p3 == segment.p3 else true) && (if (verb == PathVerb.CONIC) other.conicWeight.compareTo(conicWeight) == 0 else true) &&
(if (verb == PathVerb.CONIC) segment.conicWeight.compareTo(conicWeight) == 0 else true) && (if (verb == PathVerb.LINE) isCloseLine == other.isCloseLine else true) &&
(if (verb == PathVerb.LINE) isCloseLine == segment.isCloseLine else true) && if (verb != PathVerb.DONE) isClosedContour == other.isClosedContour else true
if (verb != PathVerb.DONE) isClosedContour == segment.isClosedContour else true
} }
override fun hashCode(): Int { override fun hashCode(): Int {
......
...@@ -21,17 +21,11 @@ class Point(val x: Float, val y: Float) { ...@@ -21,17 +21,11 @@ class Point(val x: Float, val y: Float) {
val isEmpty: Boolean val isEmpty: Boolean
get() = x <= 0 || y <= 0 get() = x <= 0 || y <= 0
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Point) return false if (other !is Point) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (x.compareTo(other.x) != 0) return false if (x.compareTo(other.x) != 0) return false
return if (y.compareTo(other.y) != 0) false else true return y.compareTo(other.y) == 0
}
protected fun canEqual(other: Any?): Boolean {
return other is Point
} }
override fun hashCode(): Int { override fun hashCode(): Int {
......
package org.jetbrains.skia package org.jetbrains.skia
class Point3(val x: Float, val y: Float, val z: Float) { class Point3(val x: Float, val y: Float, val z: Float) {
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Point3) return false if (other !is Point3) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (x.compareTo(other.x) != 0) return false if (x.compareTo(other.x) != 0) return false
if (y.compareTo(other.y) != 0) return false if (y.compareTo(other.y) != 0) return false
return z.compareTo(other.z) == 0 return z.compareTo(other.z) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is Point3
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -35,19 +35,13 @@ class RRect internal constructor(l: Float, t: Float, r: Float, b: Float, val rad ...@@ -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)" return "RRect(_left=$left, _top=$top, _right=$right, _bottom=$bottom, _radii=$radii)"
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is RRect) return false if (other !is RRect) return false
val other = o if (!super.equals(other)) return false
if (!other.canEqual(this as Any)) return false
if (!super.equals(o)) return false
return radii.contentEquals(other.radii) return radii.contentEquals(other.radii)
} }
override fun canEqual(other: Any?): Boolean {
return other is RRect
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = super.hashCode() var result = super.hashCode()
......
...@@ -18,20 +18,15 @@ class RSXform( ...@@ -18,20 +18,15 @@ class RSXform(
internal val ty: Float internal val ty: Float
) { ) {
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is RSXform) return false if (other !is RSXform) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (scos.compareTo(other.scos) != 0) return false if (scos.compareTo(other.scos) != 0) return false
if (ssin.compareTo(other.ssin) != 0) return false if (ssin.compareTo(other.ssin) != 0) return false
if (tx.compareTo(other.tx) != 0) return false if (tx.compareTo(other.tx) != 0) return false
return ty.compareTo(other.ty) == 0 return ty.compareTo(other.ty) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is RSXform
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
......
...@@ -54,21 +54,15 @@ open class Rect constructor(val left: Float, val top: Float, val right: Float, v ...@@ -54,21 +54,15 @@ open class Rect constructor(val left: Float, val top: Float, val right: Float, v
val isEmpty: Boolean val isEmpty: Boolean
get() = right == left || top == bottom get() = right == left || top == bottom
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Rect) return false if (other !is Rect) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (left.compareTo(other.left) != 0) return false if (left.compareTo(other.left) != 0) return false
if (top.compareTo(other.top) != 0) return false if (top.compareTo(other.top) != 0) return false
if (right.compareTo(other.right) != 0) return false if (right.compareTo(other.right) != 0) return false
return bottom.compareTo(other.bottom) == 0 return bottom.compareTo(other.bottom) == 0
} }
protected open fun canEqual(other: Any?): Boolean {
return other is Rect
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -4,38 +4,24 @@ class SurfaceProps constructor( ...@@ -4,38 +4,24 @@ class SurfaceProps constructor(
internal val isDeviceIndependentFonts: Boolean = false, internal val isDeviceIndependentFonts: Boolean = false,
internal val pixelGeometry: PixelGeometry = PixelGeometry.UNKNOWN internal val pixelGeometry: PixelGeometry = PixelGeometry.UNKNOWN
) { ) {
constructor(geo: PixelGeometry) : this(false, geo)
constructor(geo: PixelGeometry) : this(false, geo) {}
fun _getFlags(): Int { fun _getFlags(): Int {
return 0 or if (isDeviceIndependentFonts) 1 else 0 return 0 or if (isDeviceIndependentFonts) 1 else 0
} }
private fun _getPixelGeometryOrdinal(): Int { override fun equals(other: Any?): Boolean {
return pixelGeometry.ordinal if (other === this) return true
} if (other !is SurfaceProps) return false
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
if (isDeviceIndependentFonts != other.isDeviceIndependentFonts) return false if (isDeviceIndependentFonts != other.isDeviceIndependentFonts) return false
val `this$_pixelGeometry`: Any = pixelGeometry return this.pixelGeometry == other.pixelGeometry
val `other$_pixelGeometry`: Any = other.pixelGeometry
return `this$_pixelGeometry` == `other$_pixelGeometry`
}
protected fun canEqual(other: Any?): Boolean {
return other is SurfaceProps
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + if (isDeviceIndependentFonts) 79 else 97 result = result * PRIME + if (isDeviceIndependentFonts) 79 else 97
val `$_pixelGeometry`: Any = pixelGeometry result = result * PRIME + pixelGeometry.hashCode()
result = result * PRIME + (`$_pixelGeometry`.hashCode())
return result return result
} }
......
...@@ -3,55 +3,6 @@ package org.jetbrains.skia ...@@ -3,55 +3,6 @@ package org.jetbrains.skia
import org.jetbrains.skia.impl.* import org.jetbrains.skia.impl.*
import org.jetbrains.skia.impl.Library.Companion.staticLoad 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) { class TextBlob internal constructor(ptr: NativePointer) : Managed(ptr, _FinalizerHolder.PTR) {
companion object { companion object {
/** /**
...@@ -345,4 +296,52 @@ class TextBlob internal constructor(ptr: NativePointer) : Managed(ptr, _Finalize ...@@ -345,4 +296,52 @@ class TextBlob internal constructor(ptr: NativePointer) : Managed(ptr, _Finalize
private object _FinalizerHolder { private object _FinalizerHolder {
val PTR = TextBlob_nGetFinalizer() val PTR = TextBlob_nGetFinalizer()
} }
} }
\ No newline at end of file
@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?
...@@ -50,24 +50,16 @@ class DecorationStyle( ...@@ -50,24 +50,16 @@ class DecorationStyle(
val lineStyle: DecorationLineStyle val lineStyle: DecorationLineStyle
get() = _lineStyle get() = _lineStyle
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is DecorationStyle) return false if (other !is DecorationStyle) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (_underline != other._underline) return false if (_underline != other._underline) return false
if (_overline != other._overline) return false if (_overline != other._overline) return false
if (_lineThrough != other._lineThrough) return false if (_lineThrough != other._lineThrough) return false
if (_gaps != other._gaps) return false if (_gaps != other._gaps) return false
if (color != other.color) return false if (color != other.color) return false
if (thicknessMultiplier.compareTo(other.thicknessMultiplier) != 0) return false if (thicknessMultiplier.compareTo(other.thicknessMultiplier) != 0) return false
val `this$_lineStyle`: Any = lineStyle return this.lineStyle == other.lineStyle
val `other$_lineStyle`: Any = other.lineStyle
return `this$_lineStyle` == `other$_lineStyle`
}
protected fun canEqual(other: Any?): Boolean {
return other is DecorationStyle
} }
override fun hashCode(): Int { override fun hashCode(): Int {
...@@ -79,8 +71,7 @@ class DecorationStyle( ...@@ -79,8 +71,7 @@ class DecorationStyle(
result = result * PRIME + if (_gaps) 79 else 97 result = result * PRIME + if (_gaps) 79 else 97
result = result * PRIME + color result = result * PRIME + color
result = result * PRIME + thicknessMultiplier.toBits() result = result * PRIME + thicknessMultiplier.toBits()
val `$_lineStyle`: Any = lineStyle result = result * PRIME + lineStyle.hashCode()
result = result * PRIME + (`$_lineStyle`?.hashCode() ?: 43)
return result return result
} }
......
...@@ -135,7 +135,6 @@ class FontCollection internal constructor(ptr: NativePointer) : RefCnt(ptr) { ...@@ -135,7 +135,6 @@ class FontCollection internal constructor(ptr: NativePointer) : RefCnt(ptr) {
} }
} }
@ExternalSymbolName("org_jetbrains_skia_paragraph_FontCollection__1nMake") @ExternalSymbolName("org_jetbrains_skia_paragraph_FontCollection__1nMake")
private external fun _nMake(): NativePointer private external fun _nMake(): NativePointer
......
...@@ -97,11 +97,9 @@ class LineMetrics( ...@@ -97,11 +97,9 @@ class LineMetrics(
val right: Double val right: Double
get() = left + width get() = left + width
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is LineMetrics) return false if (other !is LineMetrics) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (startIndex != other.startIndex) return false if (startIndex != other.startIndex) return false
if (endIndex != other.endIndex) return false if (endIndex != other.endIndex) return false
if (endExcludingWhitespaces != other.endExcludingWhitespaces) return false if (endExcludingWhitespaces != other.endExcludingWhitespaces) return false
...@@ -117,38 +115,22 @@ class LineMetrics( ...@@ -117,38 +115,22 @@ class LineMetrics(
return lineNumber == other.lineNumber return lineNumber == other.lineNumber
} }
protected fun canEqual(other: Any?): Boolean {
return other is LineMetrics
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_startIndex` = startIndex result = result * PRIME + startIndex
result = result * PRIME + (`$_startIndex` ushr 32 xor `$_startIndex`).toInt() result = result * PRIME + endIndex
val `$_endIndex` = endIndex result = result * PRIME + endExcludingWhitespaces
result = result * PRIME + (`$_endIndex` ushr 32 xor `$_endIndex`).toInt() result = result * PRIME + endIncludingNewline
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 + if (isHardBreak) 79 else 97 result = result * PRIME + if (isHardBreak) 79 else 97
val `$_ascent` = ascent.toBits() result = result * PRIME + ascent.toBits().toInt()
result = result * PRIME + (`$_ascent` ushr 32 xor `$_ascent`).toInt() result = result * PRIME + descent.toBits().toInt()
val `$_descent` = descent.toBits() result = result * PRIME + unscaledAscent.toBits().toInt()
result = result * PRIME + (`$_descent` ushr 32 xor `$_descent`).toInt() result = result * PRIME + height.toBits().toInt()
val `$_unscaledAscent` = unscaledAscent.toBits() result = result * PRIME + width.toBits().toInt()
result = result * PRIME + (`$_unscaledAscent` ushr 32 xor `$_unscaledAscent`).toInt() result = result * PRIME + left.toBits().toInt()
val `$_height` = height.toBits() result = result * PRIME + baseline.toBits().toInt()
result = result * PRIME + (`$_height` ushr 32 xor `$_height`).toInt() result = result * PRIME + lineNumber
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()
return result return result
} }
...@@ -158,7 +140,7 @@ class LineMetrics( ...@@ -158,7 +140,7 @@ class LineMetrics(
override fun getArrayElement(array: InteropPointer, index: Int): LineMetrics { override fun getArrayElement(array: InteropPointer, index: Int): LineMetrics {
val intArray = IntArray(6) val intArray = IntArray(6)
val doubleArray = DoubleArray(7) val doubleArray = DoubleArray(7)
val result = interopScope { interopScope {
LineMetrics_nGetArrayElement(array, index, toInterop(intArray), toInterop(doubleArray)) LineMetrics_nGetArrayElement(array, index, toInterop(intArray), toInterop(doubleArray))
} }
return LineMetrics( return LineMetrics(
......
...@@ -109,7 +109,6 @@ private external fun _nAddPlaceholder( ...@@ -109,7 +109,6 @@ private external fun _nAddPlaceholder(
baseline: Float baseline: Float
) )
@ExternalSymbolName("org_jetbrains_skia_paragraph_ParagraphBuilder__1nSetParagraphStyle") @ExternalSymbolName("org_jetbrains_skia_paragraph_ParagraphBuilder__1nSetParagraphStyle")
private external fun _nSetParagraphStyle(ptr: NativePointer, stylePtr: NativePointer) private external fun _nSetParagraphStyle(ptr: NativePointer, stylePtr: NativePointer)
......
...@@ -173,7 +173,6 @@ class ParagraphStyle : Managed(ParagraphStyle_nMake(), _FinalizerHolder.PTR) { ...@@ -173,7 +173,6 @@ class ParagraphStyle : Managed(ParagraphStyle_nMake(), _FinalizerHolder.PTR) {
} }
} }
@ExternalSymbolName("org_jetbrains_skia_paragraph_ParagraphStyle__1nGetFinalizer") @ExternalSymbolName("org_jetbrains_skia_paragraph_ParagraphStyle__1nGetFinalizer")
private external fun ParagraphStyle_nGetFinalizer(): NativePointer private external fun ParagraphStyle_nGetFinalizer(): NativePointer
......
...@@ -39,24 +39,14 @@ class PlaceholderStyle( ...@@ -39,24 +39,14 @@ class PlaceholderStyle(
val baselineMode: BaselineMode val baselineMode: BaselineMode
get() = _baselineMode get() = _baselineMode
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is PlaceholderStyle) return false if (other !is PlaceholderStyle) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (width.compareTo(other.width) != 0) return false if (width.compareTo(other.width) != 0) return false
if (height.compareTo(other.height) != 0) return false if (height.compareTo(other.height) != 0) return false
if (baseline.compareTo(other.baseline) != 0) return false if (baseline.compareTo(other.baseline) != 0) return false
val `this$_alignment`: Any = alignment if (this.alignment != other.alignment) return false
val `other$_alignment`: Any = other.alignment return this.baselineMode == other.baselineMode
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
} }
override fun hashCode(): Int { override fun hashCode(): Int {
...@@ -65,10 +55,8 @@ class PlaceholderStyle( ...@@ -65,10 +55,8 @@ class PlaceholderStyle(
result = result * PRIME + width.toBits() result = result * PRIME + width.toBits()
result = result * PRIME + height.toBits() result = result * PRIME + height.toBits()
result = result * PRIME + baseline.toBits() result = result * PRIME + baseline.toBits()
val `$_alignment`: Any = alignment result = result * PRIME + alignment.hashCode()
result = result * PRIME + (`$_alignment`.hashCode()) result = result * PRIME + baselineMode.hashCode()
val `$_baselineMode`: Any = baselineMode
result = result * PRIME + (`$_baselineMode`.hashCode())
return result return result
} }
......
...@@ -5,27 +5,18 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) { ...@@ -5,27 +5,18 @@ class PositionWithAffinity(val position: Int, affinity: Affinity) {
val affinity: Affinity val affinity: Affinity
get() = _affinity get() = _affinity
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is PositionWithAffinity) return false if (other !is PositionWithAffinity) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (position != other.position) return false if (position != other.position) return false
val `this$_affinity`: Any = affinity return this.affinity == other.affinity
val `other$_affinity`: Any = other.affinity
return `this$_affinity` == `other$_affinity`
}
protected fun canEqual(other: Any?): Boolean {
return other is PositionWithAffinity
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + position result = result * PRIME + position
val `$_affinity`: Any = affinity result = result * PRIME + affinity.hashCode()
result = result * PRIME + `$_affinity`.hashCode()
return result return result
} }
......
...@@ -4,34 +4,28 @@ import org.jetbrains.skia.Point ...@@ -4,34 +4,28 @@ import org.jetbrains.skia.Point
class Shadow(val color: Int, val offsetX: Float, val offsetY: Float, val blurSigma: Double) { 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 val offset: Point
get() = Point(offsetX, offsetY) get() = Point(offsetX, offsetY)
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is Shadow) return false if (other !is Shadow) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (color != other.color) return false if (color != other.color) return false
if (offsetX.compareTo(other.offsetX) != 0) return false if (offsetX.compareTo(other.offsetX) != 0) return false
if (offsetY.compareTo(other.offsetY) != 0) return false if (offsetY.compareTo(other.offsetY) != 0) return false
return blurSigma.compareTo(other.blurSigma) == 0 return blurSigma.compareTo(other.blurSigma) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is Shadow
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + color result = result * PRIME + color
result = result * PRIME + offsetX.toBits() result = result * PRIME + offsetX.toBits()
result = result * PRIME + offsetY.toBits() result = result * PRIME + offsetY.toBits()
val `$_blurSigma` = blurSigma.toBits() val blurSigma = blurSigma.toBits()
result = result * PRIME + (`$_blurSigma` ushr 32 xor `$_blurSigma`).toInt() result = result * PRIME + (blurSigma ushr 32 xor blurSigma).toInt()
return result return result
} }
......
...@@ -14,35 +14,23 @@ class TextBox(val rect: Rect, direction: Direction) { ...@@ -14,35 +14,23 @@ class TextBox(val rect: Rect, direction: Direction) {
val direction: Direction val direction: Direction
get() = _direction get() = _direction
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is TextBox) return false if (other !is TextBox) return false
val other = o if (this.rect != other.rect) return false
if (!other.canEqual(this as Any)) return false return this.direction == other.direction
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 hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_rect`: Any = rect result = result * PRIME + rect.hashCode()
result = result * PRIME + (`$_rect`?.hashCode() ?: 43) result = result * PRIME + direction.hashCode()
val `$_direction`: Any = direction
result = result * PRIME + (`$_direction`?.hashCode() ?: 43)
return result return result
} }
override fun toString(): String { override fun toString(): String {
return "TextBox(_rect=" + rect + ", _direction=" + direction + ")" return "TextBox(_rect=$rect, _direction=$direction)"
} }
init { init {
......
...@@ -10,19 +10,13 @@ class BidiRun( ...@@ -10,19 +10,13 @@ class BidiRun(
/** /**
* The unicode bidi embedding level (even ltr, odd rtl) * The unicode bidi embedding level (even ltr, odd rtl)
*/ */
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is BidiRun) return false if (other !is BidiRun) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (end != other.end) return false if (end != other.end) return false
return level == other.level return level == other.level
} }
protected fun canEqual(other: Any?): Boolean {
return other is BidiRun
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -19,8 +19,8 @@ class FontMgrRunIterator(text: ManagedString?, manageText: Boolean, font: Font?, ...@@ -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?, 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?) : this(ManagedString(text), true, font, ShapingOptions.DEFAULT)
override operator fun next(): FontRun { override operator fun next(): FontRun {
return try { return try {
...@@ -43,7 +43,6 @@ class FontMgrRunIterator(text: ManagedString?, manageText: Boolean, font: Font?, ...@@ -43,7 +43,6 @@ class FontMgrRunIterator(text: ManagedString?, manageText: Boolean, font: Font?,
} }
} }
@ExternalSymbolName("org_jetbrains_skia_FontMgrRunIterator__1nMake") @ExternalSymbolName("org_jetbrains_skia_FontMgrRunIterator__1nMake")
private external fun _nMake(textPtr: NativePointer, fontPtr: NativePointer, opts: ShapingOptions?): NativePointer private external fun _nMake(textPtr: NativePointer, fontPtr: NativePointer, opts: ShapingOptions?): NativePointer
......
...@@ -15,27 +15,18 @@ class FontRun(internal val end: Int, internal val font: Font) { ...@@ -15,27 +15,18 @@ class FontRun(internal val end: Int, internal val font: Font) {
} }
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is FontRun) return false if (other !is FontRun) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (end != other.end) return false if (end != other.end) return false
val `this$_font`: Any = font return this.font == other.font
val `other$_font`: Any = other.font
return `this$_font` == `other$_font`
}
protected fun canEqual(other: Any?): Boolean {
return other is FontRun
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + end result = result * PRIME + end
val `$_font`: Any = font result = result * PRIME + font.hashCode()
result = result * PRIME + `$_font`.hashCode()
return result return result
} }
......
...@@ -20,7 +20,7 @@ class HbIcuScriptRunIterator(text: ManagedString?, manageText: Boolean) : Manage ...@@ -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 { override operator fun next(): ScriptRun {
return try { return try {
......
...@@ -39,7 +39,6 @@ class IcuBidiRunIterator(text: ManagedString?, manageText: Boolean, bidiLevel: I ...@@ -39,7 +39,6 @@ class IcuBidiRunIterator(text: ManagedString?, manageText: Boolean, bidiLevel: I
} }
} }
@ExternalSymbolName("org_jetbrains_skia_IcuBidiRunIterator__1nMake") @ExternalSymbolName("org_jetbrains_skia_IcuBidiRunIterator__1nMake")
private external fun _nMake(textPtr: NativePointer, bidiLevel: Int): NativePointer private external fun _nMake(textPtr: NativePointer, bidiLevel: Int): NativePointer
......
...@@ -10,27 +10,18 @@ class LanguageRun( ...@@ -10,27 +10,18 @@ class LanguageRun(
/** /**
* Should be BCP-47, c locale names may also work. * Should be BCP-47, c locale names may also work.
*/ */
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is LanguageRun) return false if (other !is LanguageRun) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (end != other.end) return false if (end != other.end) return false
val `this$_language`: Any = language return this.language == other.language
val `other$_language`: Any = other.language
return `this$_language` == `other$_language`
}
protected fun canEqual(other: Any?): Boolean {
return other is LanguageRun
} }
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + end result = result * PRIME + end
val `$_language`: Any = language result = result * PRIME + language.hashCode()
result = result * PRIME + `$_language`.hashCode()
return result return result
} }
......
...@@ -40,11 +40,9 @@ class RunInfo( ...@@ -40,11 +40,9 @@ class RunInfo(
return this return this
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is RunInfo) return false if (other !is RunInfo) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (_fontPtr != other._fontPtr) return false if (_fontPtr != other._fontPtr) return false
if (bidiLevel != other.bidiLevel) return false if (bidiLevel != other.bidiLevel) return false
if (advanceX.compareTo(other.advanceX) != 0) return false if (advanceX.compareTo(other.advanceX) != 0) return false
...@@ -54,21 +52,15 @@ class RunInfo( ...@@ -54,21 +52,15 @@ class RunInfo(
return rangeSize == other.rangeSize return rangeSize == other.rangeSize
} }
protected fun canEqual(other: Any?): Boolean {
return other is RunInfo
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
val `$_fontPtr` = _fontPtr
// TODO("Shagen: COMMENT OUT BEFORE ANY ACTUAL USAGE") // 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 + bidiLevel
result = result * PRIME + advanceX.toBits() result = result * PRIME + advanceX.toBits()
result = result * PRIME + advanceY.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 + rangeBegin
result = result * PRIME + rangeSize result = result * PRIME + rangeSize
return result return result
......
...@@ -12,19 +12,13 @@ class ScriptRun(internal val end: Int, internal val scriptTag: Int) { ...@@ -12,19 +12,13 @@ class ScriptRun(internal val end: Int, internal val scriptTag: Int) {
val script: String val script: String
get() = FourByteTag.toString(scriptTag) get() = FourByteTag.toString(scriptTag)
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is ScriptRun) return false if (other !is ScriptRun) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (end != other.end) return false if (end != other.end) return false
return scriptTag == other.scriptTag return scriptTag == other.scriptTag
} }
protected fun canEqual(other: Any?): Boolean {
return other is ScriptRun
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -35,32 +35,23 @@ class ShapingOptions( ...@@ -35,32 +35,23 @@ class ShapingOptions(
) )
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is ShapingOptions) return false if (other !is ShapingOptions) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (isLeftToRight != other.isLeftToRight) return false if (isLeftToRight != other.isLeftToRight) return false
if (isApproximateSpaces != other.isApproximateSpaces) return false if (isApproximateSpaces != other.isApproximateSpaces) return false
if (isApproximatePunctuation != other.isApproximatePunctuation) return false if (isApproximatePunctuation != other.isApproximatePunctuation) return false
val `this$_fontMgr`: Any? = fontMgr if (if (this.fontMgr == null) other.fontMgr != null else this.fontMgr != other.fontMgr) return false
val `other$_fontMgr`: Any? = other.fontMgr
if (if (`this$_fontMgr` == null) `other$_fontMgr` != null else `this$_fontMgr` != `other$_fontMgr`) return false
return features.contentDeepEquals(other.features) return features.contentDeepEquals(other.features)
} }
protected fun canEqual(other: Any?): Boolean {
return other is ShapingOptions
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
result = result * PRIME + if (isLeftToRight) 79 else 97 result = result * PRIME + if (isLeftToRight) 79 else 97
result = result * PRIME + if (isApproximateSpaces) 79 else 97 result = result * PRIME + if (isApproximateSpaces) 79 else 97
result = result * PRIME + if (isApproximatePunctuation) 79 else 97 result = result * PRIME + if (isApproximatePunctuation) 79 else 97
val `$_fontMgr`: Any? = fontMgr result = result * PRIME + fontMgr.hashCode()
result = result * PRIME + (`$_fontMgr`?.hashCode() ?: 43)
result = result * PRIME + features.contentDeepHashCode() result = result * PRIME + features.contentDeepHashCode()
return result return result
} }
......
...@@ -26,8 +26,8 @@ class TextBlobBuilderRunHandler<T> internal constructor( ...@@ -26,8 +26,8 @@ class TextBlobBuilderRunHandler<T> internal constructor(
internal val _text: ManagedString? internal val _text: ManagedString?
constructor(text: String?) : this(ManagedString(text), true, 0f, 0f) {} 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?, offset: Point) : this(ManagedString(text), true, offset.x, offset.y)
override fun close() { override fun close() {
super.close() super.close()
...@@ -78,7 +78,6 @@ class TextBlobBuilderRunHandler<T> internal constructor( ...@@ -78,7 +78,6 @@ class TextBlobBuilderRunHandler<T> internal constructor(
} }
} }
@ExternalSymbolName("org_jetbrains_skia_TextBlobBuilderRunHandler__1nGetFinalizer") @ExternalSymbolName("org_jetbrains_skia_TextBlobBuilderRunHandler__1nGetFinalizer")
private external fun TextBlobBuilderRunHandler_nGetFinalizer(): NativePointer private external fun TextBlobBuilderRunHandler_nGetFinalizer(): NativePointer
......
...@@ -95,7 +95,6 @@ class AnimationBuilder internal constructor(ptr: NativePointer) : Managed(ptr, _ ...@@ -95,7 +95,6 @@ class AnimationBuilder internal constructor(ptr: NativePointer) : Managed(ptr, _
} }
} }
@ExternalSymbolName("org_jetbrains_skia_skottie_AnimationBuilder__1nGetFinalizer") @ExternalSymbolName("org_jetbrains_skia_skottie_AnimationBuilder__1nGetFinalizer")
private external fun AnimationBuilder_nGetFinalizer(): NativePointer private external fun AnimationBuilder_nGetFinalizer(): NativePointer
......
...@@ -45,20 +45,14 @@ class SVGLengthContext constructor( ...@@ -45,20 +45,14 @@ class SVGLengthContext constructor(
) )
} }
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (o === this) return true if (other === this) return true
if (o !is SVGLengthContext) return false if (other !is SVGLengthContext) return false
val other = o
if (!other.canEqual(this as Any)) return false
if (width.compareTo(other.width) != 0) return false if (width.compareTo(other.width) != 0) return false
if (height.compareTo(other.height) != 0) return false if (height.compareTo(other.height) != 0) return false
return dpi.compareTo(other.dpi) == 0 return dpi.compareTo(other.dpi) == 0
} }
protected fun canEqual(other: Any?): Boolean {
return other is SVGLengthContext
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -26,10 +26,6 @@ class SVGPreserveAspectRatio(align: SVGPreserveAspectRatioAlign, scale: SVGPrese ...@@ -26,10 +26,6 @@ class SVGPreserveAspectRatio(align: SVGPreserveAspectRatioAlign, scale: SVGPrese
return scale == other.scale return scale == other.scale
} }
protected fun canEqual(other: Any?): Boolean {
return other is SVGPreserveAspectRatio
}
override fun hashCode(): Int { override fun hashCode(): Int {
val PRIME = 59 val PRIME = 59
var result = 1 var result = 1
......
...@@ -75,7 +75,8 @@ actual open class InteropScope actual constructor() { ...@@ -75,7 +75,8 @@ actual open class InteropScope actual constructor() {
actual fun toInterop(stringArray: Array<String>?): InteropPointer = stringArray actual fun toInterop(stringArray: Array<String>?): InteropPointer = stringArray
actual fun InteropPointer.fromInteropNativePointerArray(): NativePointerArray = actual fun InteropPointer.fromInteropNativePointerArray(): NativePointerArray =
NativePointerArray((this as LongArray).size, this) 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() {} actual fun release() {}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment