[egl] add additional check against eglcontext #723
Conversation
@@ -432,6 +432,10 @@ boolean createSurface() { | |||
Log.e(TAG, "mEglConfig not initialized"); | |||
return false; | |||
} | |||
if (mEglContext == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder what the outcome would be, if we skip init here black map?
Also, to help debugging, I'd probably enriched logs a bit, like Could not create surface for drawing, mEglContext not initialized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pretty curious when / why exactly this does happen.
Do I get it correctly that we will try to recreate whole EGL setup when returning false here? Might be pretty much imho, it should be sufficient try to re-acquire context but this solution should work
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok, not sure if the lack of space error from driver will dissappear on the following iterations of the loop.
Otherwise suppose map will just be black, it seems.
Maybe would be a good idea to have some callback/status API that allows developers to show some error message if we fail to initialize the map
Let's try this out for |
Right, that's what I suggested - definitely wouldn't want to introduce this changes to the Hydrogen |
This PR adds an additional check against eglContext being null. This avoids having our GL context in an invalid state and as results run into an IllegalArgumentException on the OS level.