[android] - don't recreate surface as part of view resize

This commit is contained in:
tobrun
2018-02-08 13:37:37 +01:00
committed by Tobrun
parent 6afff00ed4
commit f581adde16

View File

@@ -4,7 +4,6 @@ import android.graphics.SurfaceTexture;
import android.support.annotation.NonNull;
import android.support.annotation.UiThread;
import android.view.TextureView;
import com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser;
import java.lang.ref.WeakReference;
@@ -219,13 +218,6 @@ class TextureViewRenderThread extends Thread implements TextureView.SurfaceTextu
break;
}
// Check if the size has changed
if (sizeChanged) {
recreateSurface = true;
sizeChanged = false;
break;
}
// Reset the request render flag now, so we can catch new requests
// while rendering
requestRender = false;
@@ -273,6 +265,12 @@ class TextureViewRenderThread extends Thread implements TextureView.SurfaceTextu
continue;
}
if (sizeChanged) {
mapRenderer.onSurfaceChanged(gl, w, h);
sizeChanged = false;
continue;
}
// Don't continue without a surface
if (eglHolder.eglSurface == EGL10.EGL_NO_SURFACE) {
continue;