Fix blank screen issue [#18]#26
Conversation
|
Actually, there is some vertical stretching of the graphics sometimes when I lock screen and unlock. I will investigate a bit more. |
ByteHamster
left a comment
There was a problem hiding this comment.
Nice find, thanks a lot! I always assumed this was a problem with texture loading, not with the camera matrix. Nice! Even if it might sometimes stretch on some devices (not on mine), I'm sure it will already help a lot of users.
| gl.glGenTextures(textures.length, textures, 0); | ||
| loadTexture(gl, 0, textureDrawables[currentColorschemeIndex]); | ||
|
|
||
| gl.glLoadIdentity(); |
There was a problem hiding this comment.
Shouldn't the other one be enough? That's the only place where the view matrix is modified.
Edit: Ah, right, sorry. You already commented about that in the original post. And you are sure that this fixes something? Weird...
There was a problem hiding this comment.
No, you are correct. I had mistakenly thought it was relevant, but it was not. I think my OpenGL skills are at a kind of embarrassing level :)
I really don't know why this stretching is sometimes happening, but it does seem at least like less of a bug than the blank screen....
There was a problem hiding this comment.
it does seem at least like less of a bug than the blank screen....
Yeah, definitely. And the fix is so simple and clean, good find!


Fix #18, in which switching apps or turning the screen off and on results in a blank screen.
When Flowit launches,
onSurfaceChangedis called once. But when it resumes,onSurfaceChangedis called twice. The loaded matrix previously was not reset between calls, meaning that the secondonSurfaceChangedwould mess up all the coordinates. Addinggl.glLoadIdentity()inonSurfaceChangedfixes the issue.On my phone, if I unlock using pin instead of fingerprint sensor, the initial dimensions of the created surface change. Therefore, to fix the graphics appearing in a slightly incorrect position, another
gl.glLoadIdentity()inonSurfaceCreatedis applied. (This one I don't really understand, so I'm not sure if there's a better fix, but it seems to work in my testing).I think these two changes resolve the blank screen problem, but I'm not an expert on OpenGL and there may be some other edge cases that it doesn't address.