18 lines
367 B
Kotlin
18 lines
367 B
Kotlin
package io.legato.kazusa.help
|
|
|
|
import android.graphics.Paint
|
|
import io.legato.kazusa.utils.objectpool.BaseSafeObjectPool
|
|
|
|
object PaintPool : BaseSafeObjectPool<Paint>(8) {
|
|
|
|
private val emptyPaint = Paint()
|
|
|
|
override fun create(): Paint = Paint()
|
|
|
|
override fun recycle(target: Paint) {
|
|
target.set(emptyPaint)
|
|
super.recycle(target)
|
|
}
|
|
|
|
}
|