Use GLESv2 as implementation for GLESv1

This may not apply on some systems but works well enough for the snap.
This commit is contained in:
Simon Fels 2017-02-19 12:16:11 +01:00
commit ce2f7e9928
3 changed files with 7 additions and 4 deletions

View file

@ -39,10 +39,13 @@ constexpr const char *default_glesv2_lib{"libGLESv2.so.2"};
namespace anbox {
namespace graphics {
namespace emugl {
std::vector<GLLibrary> default_gl_libraries() {
std::vector<GLLibrary> default_gl_libraries(bool no_glesv1) {
return std::vector<GLLibrary>{
{GLLibrary::Type::EGL, default_egl_lib},
{GLLibrary::Type::GLESv1, default_glesv1_lib},
// If environment doesn't provide a GLESv1 .so file we use the GLESv2
// implementation instead. If our stack allows it we can try to get
// rid of GLESv1 completely at a later point.
{GLLibrary::Type::GLESv1, no_glesv1 ? default_glesv2_lib : default_glesv1_lib},
{GLLibrary::Type::GLESv2, default_glesv2_lib},
};
}

View file

@ -38,7 +38,7 @@ struct GLLibrary {
boost::filesystem::path path;
};
std::vector<GLLibrary> default_gl_libraries();
std::vector<GLLibrary> default_gl_libraries(bool no_glesv1 = false);
bool initialize(const std::vector<GLLibrary> &libs, emugl_logger_struct log_funcs, emugl_crash_func_t crash_func);
} // namespace emugl

View file

@ -48,7 +48,7 @@ GLRendererServer::GLRendererServer(const Config &config, const std::shared_ptr<w
wm_(wm),
composer_(std::make_shared<LayerComposer>(renderer_, wm)) {
std::vector<emugl::GLLibrary> gl_libs = emugl::default_gl_libraries();
std::vector<emugl::GLLibrary> gl_libs = emugl::default_gl_libraries(true);
if (config.driver == Config::Driver::Translator) {
DEBUG("Using GLES-to-GL translator for rendering");