Retain GLUtil.maxTextureSize
(cherry picked from commit ee20787c5e95ef0100e763f5a634b7086ca1fecf)
This commit is contained in:
parent
97ddafe539
commit
2f5718c92f
@ -5,13 +5,8 @@ import javax.microedition.khronos.egl.EGLConfig
|
||||
import javax.microedition.khronos.egl.EGLContext
|
||||
import kotlin.math.max
|
||||
|
||||
class GLUtil private constructor() {
|
||||
companion object {
|
||||
// Safe minimum default size
|
||||
private const val IMAGE_MAX_BITMAP_DIMENSION = 2048
|
||||
|
||||
val maxTextureSize: Int
|
||||
get() {
|
||||
object GLUtil {
|
||||
val maxTextureSize: Int by lazy {
|
||||
// Get EGL Display
|
||||
val egl = EGLContext.getEGL() as EGL10
|
||||
val display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY)
|
||||
@ -44,11 +39,9 @@ class GLUtil private constructor() {
|
||||
egl.eglTerminate(display)
|
||||
|
||||
// Return largest texture size found, or default
|
||||
return max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION)
|
||||
max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
throw InstantiationException("This class is not for instantiation")
|
||||
}
|
||||
}
|
||||
// Safe minimum default size
|
||||
private const val IMAGE_MAX_BITMAP_DIMENSION = 2048
|
||||
|
Loading…
x
Reference in New Issue
Block a user