Skip to content

Commit

Permalink
Fix FakeImage constructor parameter ordering.
Browse files Browse the repository at this point in the history
# Conflicts:
#	coil-test/src/androidMain/kotlin/coil3/test/FakeImage.android.kt
#	coil-test/src/commonMain/kotlin/coil3/test/FakeImage.kt
  • Loading branch information
colinrtwhite committed Nov 19, 2024
1 parent 764f1b3 commit 3923eb8
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
4 changes: 3 additions & 1 deletion coil-test/api/android/coil-test.api
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
public final class coil3/test/FakeImage : coil3/Image {
public fun <init> ()V
public fun <init> (IIJZI)V
public fun <init> (IIIJZ)V
public synthetic fun <init> (IIIJZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (IIJZI)V
public synthetic fun <init> (IIJZIILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun draw (Landroid/graphics/Canvas;)V
public fun equals (Ljava/lang/Object;)Z
Expand Down
1 change: 1 addition & 0 deletions coil-test/api/coil-test.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

// Library unique name: <io.coil-kt.coil3:coil-test>
final class coil3.test/FakeImage : coil3/Image { // coil3.test/FakeImage|null[0]
constructor <init>(kotlin/Int = ..., kotlin/Int = ..., kotlin/Int = ..., kotlin/Long = ..., kotlin/Boolean = ...) // coil3.test/FakeImage.<init>|<init>(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Long;kotlin.Boolean){}[0]
constructor <init>(kotlin/Int = ..., kotlin/Int = ..., kotlin/Long = ..., kotlin/Boolean = ..., kotlin/Int = ...) // coil3.test/FakeImage.<init>|<init>(kotlin.Int;kotlin.Int;kotlin.Long;kotlin.Boolean;kotlin.Int){}[0]

final val color // coil3.test/FakeImage.color|{}color[0]
Expand Down
4 changes: 3 additions & 1 deletion coil-test/api/jvm/coil-test.api
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
public final class coil3/test/FakeImage : coil3/Image {
public fun <init> ()V
public fun <init> (IIJZI)V
public fun <init> (IIIJZ)V
public synthetic fun <init> (IIIJZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (IIJZI)V
public synthetic fun <init> (IIJZIILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun draw (Lorg/jetbrains/skia/Canvas;)V
public fun equals (Ljava/lang/Object;)Z
Expand Down
12 changes: 11 additions & 1 deletion coil-test/src/androidMain/kotlin/coil3/test/FakeImage.android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ import coil3.annotation.Poko

@Poko
actual class FakeImage actual constructor(
actual val color: Int,
actual override val width: Int,
actual override val height: Int,
actual override val size: Long,
actual override val shareable: Boolean,
actual val color: Int,
) : Image {

@Deprecated("Kept for binary compatibility.", level = DeprecationLevel.HIDDEN)
actual constructor(
width: Int,
height: Int,
size: Long,
shareable: Boolean,
color: Int,
) : this(color, width, height, size, shareable)

private var lazyPaint: Paint? = null

actual override fun draw(canvas: Canvas) {
Expand Down
15 changes: 13 additions & 2 deletions coil-test/src/commonMain/kotlin/coil3/test/FakeImage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,27 @@ import coil3.test.internal.Black
* A simple [Image] that draws a 100x100 black square by default.
*/
expect class FakeImage(
color: Int = Black,
width: Int = 100,
height: Int = 100,
size: Long = 4L * width * height,
shareable: Boolean = true,
color: Int = Black,
) : Image {

@Deprecated("Kept for binary compatibility.", level = DeprecationLevel.HIDDEN)
constructor(
width: Int = 100,
height: Int = 100,
size: Long = 4L * width * height,
shareable: Boolean = true,
color: Int = Black,
)

val color: Int
override val width: Int
override val height: Int
override val size: Long
override val shareable: Boolean
val color: Int

override fun draw(canvas: Canvas)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ import org.jetbrains.skia.Rect

@Poko
actual class FakeImage actual constructor(
actual val color: Int,
actual override val width: Int,
actual override val height: Int,
actual override val size: Long,
actual override val shareable: Boolean,
actual val color: Int,
) : Image {

@Deprecated("Kept for binary compatibility.", level = DeprecationLevel.HIDDEN)
actual constructor(
width: Int,
height: Int,
size: Long,
shareable: Boolean,
color: Int,
) : this(color, width, height, size, shareable)

private var lazyPaint: Paint? = null
private var lazyRect: Rect? = null

Expand Down

0 comments on commit 3923eb8

Please sign in to comment.