Open stleusc opened 10 years ago
I read that Android 2.3.6 was the first release with proper GLES20 support. So I would expect issues using earlier versions.. The problem could be triggered by some special color format, like 8bit png. If this is the case one should catch the exception and convert the bitmap to standard rgb. https://code.google.com/p/rokon/issues/detail?id=50
You are (like most of the time) again 100% spot on. The bitmap is a png8. Can we add that feature into the renderer, or possibly the loader or decoder of the bitmap?
I think the image should be converted directly on creation. This might work - completely untested though: https://github.com/hjanetzek/vtm/commit/7053cf8405fd1bef8d24b0766cc984f3dcc8813c
Here a stacktrace I received:
Device: Desire HD Android V2.3.5
Stacktrace: java.lang.IllegalArgumentException: Unknown type at android.opengl.GLUtils.getType(GLUtils.java) at org.oscim.android.canvas.AndroidBitmap.uploadToTexture(SourceFile:79) at org.oscim.renderer.bucket.TextureItem$TexturePool.uploadTexture(SourceFile:272) at org.oscim.renderer.bucket.TextureItem$TexturePool.access$200(SourceFile:142) at org.oscim.renderer.bucket.TextureItem.upload(SourceFile:106) at org.oscim.renderer.bucket.BitmapBucket.compile(SourceFile:133) at org.oscim.renderer.bucket.RenderBuckets.compile(SourceFile:372) at org.oscim.layers.tile.TileRenderer.uploadTileData(SourceFile:196) at org.oscim.layers.tile.TileRenderer.compileTileLayers(SourceFile:156) at org.oscim.layers.tile.TileRenderer.update(SourceFile:125) at org.oscim.renderer.MapRenderer.draw(SourceFile:120) at org.oscim.renderer.MapRenderer.onDrawFrame(SourceFile:72) at org.oscim.android.gl.GLView$GLRenderer.onDrawFrame(SourceFile:49) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java)
I only happens on certain devices. Digging a bit I read the following:
"Return the type as defined by OpenGL ES of the supplied bitmap, if there is one. If the bitmap is stored in a compressed format, it may not have a valid OpenGL ES type."
So I'm wondering what can cause this? I'm displaying bitmap tiles from different servers and some server work great on the device while one crashes. ALL work on my test devices without any issue.
What defines the internal Bitmap format? The way it's stored on the server? Like png, jpg, etc? Or purely the VTM code that creates the Bitmap?