X11 and Ozone: Try to check for display type when creating framebuf
We're making a new config in the Chromium project for Linux builds -
USE_X11 && USE_OZONE. The idea of that is to ease migration
from non-Ozone/X11 to Ozone. It will be possible to choose between
Ozone and non-Ozone path on runtime by supplying
the --enable-features=UseOzonePlatform flag.
However, SwiftShader doesn't support such a build and always uses
FrameBufferOzone. This is not correct when the browser is
run without the Ozone feature enabled aka using old
non-Ozone/X11 path. Basically, it results in crashes
during swap buffers call.
The very naive solution is to try to test the display. If we
can cast it to XDisplay and its valid, use X11 framebuffer.
Otherwise, use Ozone. Though, I'm not 100% sure about the safiness
of this check. Thus, we must be careful about that.
This is one of the last patches that blocks enabling both
use_x11 && use_ozone in Chromium.
Bug: chromium:1119303
Change-Id: I969798abd4d0bbacaffb7704161eac38e77d9311
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/47868Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Tested-by:
Maksim Sisov <msisov@igalia.com>
Showing
src/Main/FrameBufferFactoryOzone.cpp
0 → 100644
Please
register
or
sign in
to comment