@@ -776,20 +776,34 @@ object ImageUtil {
776776 return options
777777 }
778778
779- fun isMaxTextureSizeExceeded (source : BufferedSource ): Boolean =
780- extractImageOptions(source).let { opts -> isMaxTextureSizeExceeded(opts.outWidth, opts.outHeight) }
779+ fun isHardwareThresholdExceeded (source : BufferedSource ): Boolean = extractImageOptions(source).let { opts ->
780+ isHardwareThresholdExceeded(opts.outWidth, opts.outHeight)
781+ }
781782
782- fun isMaxTextureSizeExceeded (drawable : BitmapDrawable ): Boolean =
783- isMaxTextureSizeExceeded (drawable.bitmap)
783+ fun isHardwareThresholdExceeded (drawable : BitmapDrawable ): Boolean =
784+ isHardwareThresholdExceeded (drawable.bitmap)
784785
785- fun isMaxTextureSizeExceeded (bitmap : Bitmap ): Boolean =
786- isMaxTextureSizeExceeded (bitmap.width, bitmap.height)
786+ fun isHardwareThresholdExceeded (bitmap : Bitmap ): Boolean =
787+ isHardwareThresholdExceeded (bitmap.width, bitmap.height)
787788
788789 var hardwareBitmapThreshold: Int = GLUtil .SAFE_TEXTURE_LIMIT
789790
790- private fun isMaxTextureSizeExceeded (width : Int , height : Int ): Boolean {
791+ private fun isHardwareThresholdExceeded (width : Int , height : Int ): Boolean {
791792 if (minOf(width, height) <= 0 ) return false
792793
793794 return maxOf(width, height) > hardwareBitmapThreshold
794795 }
796+
797+ fun isMaxTextureSizeExceeded (source : BufferedSource ): Boolean = extractImageOptions(source).let { opts ->
798+ isMaxTextureSizeExceeded(opts.outWidth, opts.outHeight)
799+ }
800+
801+ fun isMaxTextureSizeExceeded (bitmap : Bitmap ): Boolean =
802+ isMaxTextureSizeExceeded(bitmap.width, bitmap.height)
803+
804+ private fun isMaxTextureSizeExceeded (width : Int , height : Int ): Boolean {
805+ if (minOf(width, height) <= 0 ) return false
806+
807+ return maxOf(width, height) > GLUtil .DEVICE_TEXTURE_LIMIT
808+ }
795809}
0 commit comments