[core] Render from the main thread
Do not create a thread for the MapContext anymore.
This commit is contained in:
@@ -521,7 +521,6 @@ public class MapView extends FrameLayout {
|
||||
mConnectivityReceiver = null;
|
||||
|
||||
mUserLocationView.onPause();
|
||||
mNativeMapView.pause();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -533,7 +532,6 @@ public class MapView extends FrameLayout {
|
||||
mConnectivityReceiver = new ConnectivityReceiver();
|
||||
getContext().registerReceiver(mConnectivityReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
|
||||
|
||||
mNativeMapView.resume();
|
||||
mNativeMapView.update();
|
||||
mUserLocationView.onResume();
|
||||
|
||||
@@ -1094,9 +1092,7 @@ public class MapView extends FrameLayout {
|
||||
}
|
||||
|
||||
int getTopOffsetPixelsForIcon(Icon icon) {
|
||||
// This method will dead lock if map paused. Causes a freeze if you add a marker in an
|
||||
// activity's onCreate()
|
||||
if (mDestroyed || mNativeMapView.isPaused()) {
|
||||
if (mDestroyed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1243,11 +1239,11 @@ public class MapView extends FrameLayout {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDestroyed || mNativeMapView.isPaused()) {
|
||||
if (mDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
mNativeMapView.renderSync();
|
||||
mNativeMapView.render();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -119,24 +119,12 @@ final class NativeMapView {
|
||||
nativeDestroySurface(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
nativePause(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public boolean isPaused() {
|
||||
return nativeIsPaused(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
nativeResume(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
nativeUpdate(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public void renderSync() {
|
||||
nativeRenderSync(mNativeMapViewPtr);
|
||||
public void render() {
|
||||
nativeRender(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public void resizeView(int width, int height) {
|
||||
@@ -515,15 +503,9 @@ final class NativeMapView {
|
||||
|
||||
private native void nativeDestroySurface(long nativeMapViewPtr);
|
||||
|
||||
private native void nativePause(long nativeMapViewPtr);
|
||||
|
||||
private native boolean nativeIsPaused(long nativeMapViewPtr);
|
||||
|
||||
private native void nativeResume(long nativeMapViewPtr);
|
||||
|
||||
private native void nativeUpdate(long nativeMapViewPtr);
|
||||
|
||||
private native void nativeRenderSync(long nativeMapViewPtr);
|
||||
private native void nativeRender(long nativeMapViewPtr);
|
||||
|
||||
private native void nativeViewResize(long nativeMapViewPtr, int width, int height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user