Init open gl before poi types and indexes

This commit is contained in:
Alex Sytnyk 2018-10-11 13:54:31 +03:00
parent 1d5de834f1
commit ec12ec3b45

View file

@ -626,13 +626,17 @@ public class AppInitializer implements IProgress {
private void startApplicationBackground() { private void startApplicationBackground() {
try { try {
startBgTime = System.currentTimeMillis(); startBgTime = System.currentTimeMillis();
app.getRendererRegistry().initRenderers(this);
notifyEvent(InitEvents.INIT_RENDERERS);
// native depends on renderers
initOpenGl();
notifyEvent(InitEvents.NATIVE_OPEN_GLINITIALIZED);
// init poi types before indexes and before POI // init poi types before indexes and before POI
initPoiTypes(); initPoiTypes();
notifyEvent(InitEvents.POI_TYPES_INITIALIZED); notifyEvent(InitEvents.POI_TYPES_INITIALIZED);
app.resourceManager.reloadIndexesOnStart(this, warnings); app.resourceManager.reloadIndexesOnStart(this, warnings);
app.getRendererRegistry().initRenderers(this);
notifyEvent(InitEvents.INIT_RENDERERS);
// native depends on renderers // native depends on renderers
initNativeCore(); initNativeCore();
notifyEvent(InitEvents.NATIVE_INITIALIZED); notifyEvent(InitEvents.NATIVE_INITIALIZED);
@ -735,8 +739,7 @@ public class AppInitializer implements IProgress {
} }
} }
private void initOpenGl() {
private void initNativeCore() {
if (!"qnx".equals(System.getProperty("os.name"))) { if (!"qnx".equals(System.getProperty("os.name"))) {
OsmandSettings osmandSettings = app.getSettings(); OsmandSettings osmandSettings = app.getSettings();
if (osmandSettings.USE_OPENGL_RENDER.get()) { if (osmandSettings.USE_OPENGL_RENDER.get()) {
@ -753,8 +756,13 @@ public class AppInitializer implements IProgress {
osmandSettings.OPENGL_RENDER_FAILED.set(false); osmandSettings.OPENGL_RENDER_FAILED.set(false);
warnings.add("Native OpenGL library is not supported. Please try again after exit"); warnings.add("Native OpenGL library is not supported. Please try again after exit");
} }
notifyEvent(InitEvents.NATIVE_OPEN_GLINITIALIZED);
} }
}
}
private void initNativeCore() {
if (!"qnx".equals(System.getProperty("os.name"))) {
OsmandSettings osmandSettings = app.getSettings();
if (osmandSettings.NATIVE_RENDERING_FAILED.get()) { if (osmandSettings.NATIVE_RENDERING_FAILED.get()) {
osmandSettings.SAFE_MODE.set(true); osmandSettings.SAFE_MODE.set(true);
osmandSettings.NATIVE_RENDERING_FAILED.set(false); osmandSettings.NATIVE_RENDERING_FAILED.set(false);