diff --git a/platform/util/ui/src/com/intellij/openapi/util/CachedImageIcon.kt b/platform/util/ui/src/com/intellij/openapi/util/CachedImageIcon.kt index bb730e86c3cc..b29d9283d415 100644 --- a/platform/util/ui/src/com/intellij/openapi/util/CachedImageIcon.kt +++ b/platform/util/ui/src/com/intellij/openapi/util/CachedImageIcon.kt @@ -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 diff --git a/platform/util/ui/src/com/intellij/openapi/util/ScaledIconCache.kt b/platform/util/ui/src/com/intellij/openapi/util/ScaledIconCache.kt index c36e49fa20c2..246b46f92e49 100644 --- a/platform/util/ui/src/com/intellij/openapi/util/ScaledIconCache.kt +++ b/platform/util/ui/src/com/intellij/openapi/util/ScaledIconCache.kt @@ -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>(SCALED_ICONS_CACHE_LIMIT)) /**