From ec12ec3b45e097aebbdacbd8ecca2a8cdc55dbda Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Thu, 11 Oct 2018 13:54:31 +0300 Subject: [PATCH] Init open gl before poi types and indexes --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 4fcd9f13bd..b9aece2979 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -626,13 +626,17 @@ public class AppInitializer implements IProgress { private void startApplicationBackground() { try { 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 initPoiTypes(); notifyEvent(InitEvents.POI_TYPES_INITIALIZED); app.resourceManager.reloadIndexesOnStart(this, warnings); - app.getRendererRegistry().initRenderers(this); - notifyEvent(InitEvents.INIT_RENDERERS); // native depends on renderers initNativeCore(); notifyEvent(InitEvents.NATIVE_INITIALIZED); @@ -735,8 +739,7 @@ public class AppInitializer implements IProgress { } } - - private void initNativeCore() { + private void initOpenGl() { if (!"qnx".equals(System.getProperty("os.name"))) { OsmandSettings osmandSettings = app.getSettings(); if (osmandSettings.USE_OPENGL_RENDER.get()) { @@ -753,8 +756,13 @@ public class AppInitializer implements IProgress { osmandSettings.OPENGL_RENDER_FAILED.set(false); 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()) { osmandSettings.SAFE_MODE.set(true); osmandSettings.NATIVE_RENDERING_FAILED.set(false);