[android] #2835 - limit the amount of object allocations on high traffic code

This commit is contained in:
Tobrun
2016-04-22 09:41:22 +02:00
parent aded1b145d
commit c636d5a613
2 changed files with 11 additions and 12 deletions

View File

@@ -888,22 +888,17 @@ public class MapView extends FrameLayout {
if (mDestroyed) {
return new LatLng();
}
float x = point.x;
float y = point.y;
return mNativeMapView.latLngForPixel(new PointF(x / mScreenDensity, y / mScreenDensity));
point.set(point.x / mScreenDensity, point.y / mScreenDensity);
return mNativeMapView.latLngForPixel(point);
}
PointF toScreenLocation(@NonNull LatLng location) {
if (mDestroyed) {
return new PointF();
}
PointF point = mNativeMapView.pixelForLatLng(location);
float x = point.x * mScreenDensity;
float y = point.y * mScreenDensity;
return new PointF(x, y);
PointF pointF = mNativeMapView.pixelForLatLng(location);
pointF.set(pointF.x * mScreenDensity, pointF.y * mScreenDensity);
return pointF;
}
//