mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
GitOrigin-RevId: d48147477ca58d5d6019c9093a56199e9bde0136
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2593954299
commit
eaa105d145
@@ -11,7 +11,6 @@ import com.intellij.util.SVGLoader
|
||||
import com.intellij.util.ui.MultiResolutionImageProvider
|
||||
import com.intellij.util.ui.StartupUiUtil
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import java.awt.*
|
||||
import java.awt.image.BufferedImage
|
||||
import java.awt.image.ImageFilter
|
||||
@@ -107,9 +106,6 @@ open class CachedImageIcon protected constructor(
|
||||
@ApiStatus.Internal
|
||||
fun getRealIcon(): ImageIcon = getRealIcon(scaleContext = null)
|
||||
|
||||
@TestOnly
|
||||
fun doGetRealIcon(): ImageIcon? = unwrapIcon(realIcon)
|
||||
|
||||
internal fun getRealIcon(scaleContext: ScaleContext?): ImageIcon {
|
||||
if (resolver == null || !isActivated) {
|
||||
return EMPTY_ICON
|
||||
|
||||
@@ -18,16 +18,14 @@ import java.util.*
|
||||
import javax.swing.Icon
|
||||
import javax.swing.ImageIcon
|
||||
|
||||
private const val SCALED_ICONS_CACHE_LIMIT = 5
|
||||
|
||||
private fun key(context: ScaleContext): Long {
|
||||
return java.lang.Float.floatToIntBits(context.getScale(DerivedScaleType.EFF_USR_SCALE).toFloat()).toLong() shl 32 or
|
||||
(java.lang.Float.floatToIntBits(context.getScale(ScaleType.SYS_SCALE).toFloat()).toLong() and 0xffffffffL)
|
||||
}
|
||||
|
||||
internal class ScaledIconCache(private val host: CachedImageIcon) {
|
||||
companion object {
|
||||
private const val SCALED_ICONS_CACHE_LIMIT = 5
|
||||
|
||||
private fun key(context: ScaleContext): Long {
|
||||
return java.lang.Float.floatToIntBits(context.getScale(DerivedScaleType.EFF_USR_SCALE).toFloat()).toLong() shl 32 or
|
||||
(java.lang.Float.floatToIntBits(context.getScale(ScaleType.SYS_SCALE).toFloat()).toLong() and 0xffffffffL)
|
||||
}
|
||||
}
|
||||
|
||||
private val cache = Collections.synchronizedMap(FixedHashMap<Long, SoftReference<ImageIcon>>(SCALED_ICONS_CACHE_LIMIT))
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user