Check that the native display is valid before using it

EglOS::getDefaultDisplay() can return an invalid display, e.g. on X11
if $DISPLAY is not set. This is called from the EglGlobalInfo
constructor, which doesn't have a good way to indicate failure. So
instead EglGlobalInfo::addDisplay() checks that the display is valid
before wrapping it in a EglDisplay.

Bug: 7020498
Change-Id: Id18fc568dae5bff4b45b706f3322ae5e4785d95d
5 files changed