diff options
author | Tobrun <tobrun@mapbox.com> | 2017-04-18 16:12:27 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2017-06-28 00:52:25 +0200 |
commit | 780d0622c8090f87e1adcd2d3c89e6024e0d5fc5 (patch) | |
tree | fb60b3fcf0f27c44f5fe3db1fbff24c74c56f7f0 | |
parent | acafdae7bdbb58196a8ff8b51beeff25b1382caf (diff) | |
download | qtlocation-mapboxgl-780d0622c8090f87e1adcd2d3c89e6024e0d5fc5.tar.gz |
[android] - synchronize display and context initalisation with create surface to avoid EGL bad surface (#8759)
-rw-r--r-- | platform/android/CHANGELOG.md | 39 | ||||
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java | 34 |
2 files changed, 56 insertions, 17 deletions
diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index b89e498d21..6db87b4609 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -4,7 +4,44 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to ## 5.0.0 - TBA -<<<<<<< HEAD +5.1.0 builds further on 5.0.1 and adds: + +* Limit Viewport [#8622](https://github.com/mapbox/mapbox-gl-native/pull/8622) +* Transition Properties for Layer attributes [#8509](https://github.com/mapbox/mapbox-gl-native/pull/8509) +* Style wide transition duration and transition offset in milliseconds [#8576](https://github.com/mapbox/mapbox-gl-native/pull/8576) +* Transifex integration, Catalan & Dutch translations [#8556](https://github.com/mapbox/mapbox-gl-native/pull/8556) +* LatLngBounds includes with another bounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +* LatLngBounds includes takes in account LatLng on the edges (cfr. core) [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +* LatLngBounds facility getters/setters for LatLnbg on the edges of the bounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +* Expose world bounds in LatLngBounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +* OfflineRegion are validated if the bounds is found in the world bounds, else onError will be invoked [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +* Polygon holes [#8557](https://github.com/mapbox/mapbox-gl-native/pull/8557) and [#8722](https://github.com/mapbox/mapbox-gl-native/pull/8722) +* Custom location source [#8710](https://github.com/mapbox/mapbox-gl-native/pull/8710) +* Ensure surface is created after display and context [#8759](https://github.com/mapbox/mapbox-gl-native/pull/8759) + +## 5.0.2 - April 3, 2017 + +5.0.2 is a patch release that contains the following changes: + +* Binary shader caching [#8604](https://github.com/mapbox/mapbox-gl-native/pull/8604) +* Fix resource transform callback [#8582](https://github.com/mapbox/mapbox-gl-native/pull/8582) +* Restore onTouch behaviour to 4.x version [#8585](https://github.com/mapbox/mapbox-gl-native/pull/8585) +* Restore anchoring after updating MarkerView Icon [#8519](https://github.com/mapbox/mapbox-gl-native/pull/8519) + +## 5.0.1 - March 22nd, 2017 + +5.0.1 is a patch release that addresses a shader precision issue that created a rendering problem on some devices. + +* Use `highp` for color attributes [#8385](https://github.com/mapbox/mapbox-gl-native/issues/8385) + +## 5.0.0 - March 17th, 2017 + +5.0.0 final release contains: + +* Support for data-driven styles [#7752](https://github.com/mapbox/mapbox-gl-native/pull/7752) +* Additional APIs to manage runtime styling layers [#8195](https://github.com/mapbox/mapbox-gl-native/pull/8195) +* Allow query all features in sources (`querySourceFeatures`) [#5792](https://github.com/mapbox/mapbox-gl-native/issues/5792) +* Improve accessibility TalkBack support by including content description in views [#8230](https://github.com/mapbox/mapbox-gl-native/pull/8230) * Consistent double tap zoom acceleration [#7514](https://github.com/mapbox/mapbox-gl-native/issues/7514) * Cleanup inconsistencies float vs double [#4445](https://github.com/mapbox/mapbox-gl-native/issues/4445) * Add `mapbox_` prefix to attributes [#6482](https://github.com/mapbox/mapbox-gl-native/issues/6482) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index a9fc1e1700..8954b3b312 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -72,6 +72,7 @@ import java.util.List; public class MapView extends FrameLayout { private NativeMapView nativeMapView; + private boolean textureMode; private boolean destroyed; private boolean hasSurface = false; @@ -117,12 +118,14 @@ public class MapView extends FrameLayout { return; } + // determine render surface + textureMode = options.getTextureMode(); + // inflate view View view = LayoutInflater.from(context).inflate(R.layout.mapbox_mapview_internal, this); CompassView compassView = (CompassView) view.findViewById(R.id.compassView); MyLocationView myLocationView = (MyLocationView) view.findViewById(R.id.userLocationView); ImageView attrView = (ImageView) view.findViewById(R.id.attributionView); - initalizeDrawingSurface(context, options); // create native Map object nativeMapView = new NativeMapView(this); @@ -171,18 +174,6 @@ public class MapView extends FrameLayout { mapboxMap.initialise(context, options); } - private void initalizeDrawingSurface(Context context, MapboxMapOptions options) { - if (options.getTextureMode()) { - TextureView textureView = new TextureView(context); - textureView.setSurfaceTextureListener(new SurfaceTextureListener()); - addView(textureView, 0); - } else { - SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView); - surfaceView.getHolder().addCallback(new SurfaceCallback()); - surfaceView.setVisibility(View.VISIBLE); - } - } - // // Lifecycle events // @@ -208,11 +199,22 @@ public class MapView extends FrameLayout { mapboxMap.onRestoreInstanceState(savedInstanceState); } - // Initialize EGL + initialiseDrawingSurface(textureMode); + addOnMapChangedListener(mapCallback = new MapCallback(mapboxMap)); + } + + private void initialiseDrawingSurface(boolean textureMode) { nativeMapView.initializeDisplay(); nativeMapView.initializeContext(); - - addOnMapChangedListener(mapCallback = new MapCallback(mapboxMap)); + if (textureMode) { + TextureView textureView = new TextureView(getContext()); + textureView.setSurfaceTextureListener(new SurfaceTextureListener()); + addView(textureView, 0); + } else { + SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView); + surfaceView.getHolder().addCallback(new SurfaceCallback()); + surfaceView.setVisibility(View.VISIBLE); + } } /** |