Properly report xcb_connect failures in DisplayVkXcb

Bug: chromium:1223431
Change-Id: Iaefddbda3fef283eed365fe010ee003a3b3beca8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3083383
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
This commit is contained in:
Yuly Novikov 2021-08-04 19:31:54 -04:00 коммит произвёл Angle LUCI CQ
Родитель 97c21277da
Коммит 81bee2e7f6
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -49,8 +49,13 @@ DisplayVkXcb::DisplayVkXcb(const egl::DisplayState &state)
egl::Error DisplayVkXcb::initialize(egl::Display *display)
{
mXcbConnection = xcb_connect(nullptr, nullptr);
if (mXcbConnection == nullptr)
ASSERT(mXcbConnection != nullptr);
int xcb_connection_error = xcb_connection_has_error(mXcbConnection);
if (xcb_connection_error)
{
ERR() << "xcb_connect() failed, error " << xcb_connection_error;
xcb_disconnect(mXcbConnection);
mXcbConnection = nullptr;
return egl::EglNotInitialized();
}
return DisplayVk::initialize(display);