diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java index 46238ee789..cc29166b36 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java @@ -3,16 +3,15 @@ package com.mapbox.mapboxsdk.maps.renderer.egl; import android.opengl.GLSurfaceView; import android.os.Build; import android.support.annotation.NonNull; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import com.mapbox.mapboxsdk.constants.MapboxConstants; +import com.mapbox.mapboxsdk.log.Logger; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLDisplay; - -import timber.log.Timber; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import static com.mapbox.mapboxsdk.utils.Compare.compare; import static javax.microedition.khronos.egl.EGL10.EGL_ALPHA_MASK_SIZE; @@ -38,6 +37,8 @@ import static javax.microedition.khronos.egl.EGL10.EGL_WINDOW_BIT; */ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { + private static final String TAG = "Mbgl-EGLConfigChooser"; + /** * Requires API level 17 * @@ -72,7 +73,7 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { // Determine number of possible configurations int[] numConfigs = getNumberOfConfigurations(egl, display, configAttribs); if (numConfigs[0] < 1) { - Timber.e("eglChooseConfig() returned no configs."); + Logger.e(TAG, "eglChooseConfig() returned no configs."); throw new EGLConfigException("eglChooseConfig() failed"); } @@ -82,7 +83,7 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { // Choose best match EGLConfig config = chooseBestMatchConfig(egl, display, possibleConfigurations); if (config == null) { - Timber.e("No config chosen"); + Logger.e(TAG, "No config chosen"); throw new EGLConfigException("No config chosen"); } @@ -92,7 +93,9 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { private int[] getNumberOfConfigurations(EGL10 egl, EGLDisplay display, int[] configAttributes) { int[] numConfigs = new int[1]; if (!egl.eglChooseConfig(display, configAttributes, null, 0, numConfigs)) { - Timber.e("eglChooseConfig(NULL) returned error %d", egl.eglGetError()); + Logger.e(TAG, String.format( + MapboxConstants.MAPBOX_LOCALE, "eglChooseConfig(NULL) returned error %d", egl.eglGetError()) + ); throw new EGLConfigException("eglChooseConfig() failed"); } return numConfigs; @@ -102,7 +105,9 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { int[] configAttributes, int[] numConfigs) { EGLConfig[] configs = new EGLConfig[numConfigs[0]]; if (!egl.eglChooseConfig(display, configAttributes, configs, numConfigs[0], numConfigs)) { - Timber.e("eglChooseConfig() returned error %d", egl.eglGetError()); + Logger.e(TAG, String.format( + MapboxConstants.MAPBOX_LOCALE, "eglChooseConfig() returned error %d", egl.eglGetError()) + ); throw new EGLConfigException("eglChooseConfig() failed"); } return configs; @@ -254,11 +259,11 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { Config bestMatch = matches.get(0); if (bestMatch.isCaveat) { - Timber.w("Chosen config has a caveat."); + Logger.w(TAG, "Chosen config has a caveat."); } if (bestMatch.isNotConformant) { - Timber.w("Chosen config is not conformant."); + Logger.w(TAG, "Chosen config is not conformant."); } return bestMatch.config; @@ -267,7 +272,9 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { private int getConfigAttr(EGL10 egl, EGLDisplay display, EGLConfig config, int attributeName) { int[] attributevalue = new int[1]; if (!egl.eglGetConfigAttrib(display, config, attributeName, attributevalue)) { - Timber.e("eglGetConfigAttrib(%d) returned error %d", attributeName, egl.eglGetError()); + Logger.e(TAG, String.format( + MapboxConstants.MAPBOX_LOCALE, "eglGetConfigAttrib(%d) returned error %d", attributeName, egl.eglGetError()) + ); throw new EGLConfigException("eglGetConfigAttrib() failed"); } return attributevalue[0]; @@ -275,7 +282,7 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { private int[] getConfigAttributes() { boolean emulator = inEmulator() || inGenymotion(); - Timber.i("In emulator: %s", emulator); + Logger.i(TAG, String.format("In emulator: %s", emulator)); // Get all configs at least RGB 565 with 16 depth and 8 stencil return new int[] { |